Skip to content

Commit f4dc224

Browse files
committed
Fixed #65431 (Discarded qualifiers from pointer target warnings when using --enable-dtrace) by Sixd
1 parent 72aacbf commit f4dc224

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

Zend/zend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
10971097
if(DTRACE_ERROR_ENABLED()) {
10981098
char *dtrace_error_buffer;
10991099
zend_vspprintf(&dtrace_error_buffer, 0, format, args);
1100-
DTRACE_ERROR(dtrace_error_buffer, error_filename, error_lineno);
1100+
DTRACE_ERROR(dtrace_error_buffer, (char *)error_filename, error_lineno);
11011101
efree(dtrace_error_buffer);
11021102
}
11031103
#endif /* HAVE_DTRACE */

Zend/zend_dtrace.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#ifdef HAVE_DTRACE
2626
/* PHP DTrace probes {{{ */
27-
static inline char *dtrace_get_executed_filename(TSRMLS_D)
27+
static inline const char *dtrace_get_executed_filename(TSRMLS_D)
2828
{
2929
if (EG(current_execute_data) && EG(current_execute_data)->op_array) {
3030
return EG(current_execute_data)->op_array->filename;
@@ -36,9 +36,9 @@ static inline char *dtrace_get_executed_filename(TSRMLS_D)
3636
ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
3737
{
3838
zend_op_array *res;
39-
DTRACE_COMPILE_FILE_ENTRY(file_handle->opened_path, file_handle->filename);
39+
DTRACE_COMPILE_FILE_ENTRY(file_handle->opened_path, (char *)file_handle->filename);
4040
res = compile_file(file_handle, type TSRMLS_CC);
41-
DTRACE_COMPILE_FILE_RETURN(file_handle->opened_path, file_handle->filename);
41+
DTRACE_COMPILE_FILE_RETURN(file_handle->opened_path, (char *)file_handle->filename);
4242

4343
return res;
4444
}
@@ -47,7 +47,7 @@ ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int t
4747
ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC)
4848
{
4949
int lineno;
50-
char *scope, *filename, *funcname, *classname;
50+
const char *scope, *filename, *funcname, *classname;
5151
scope = filename = funcname = classname = NULL;
5252

5353
/* we need filename and lineno for both execute and function probes */
@@ -65,41 +65,41 @@ ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC)
6565
}
6666

6767
if (DTRACE_EXECUTE_ENTRY_ENABLED()) {
68-
DTRACE_EXECUTE_ENTRY(filename, lineno);
68+
DTRACE_EXECUTE_ENTRY((char *)filename, lineno);
6969
}
7070

7171
if (DTRACE_FUNCTION_ENTRY_ENABLED() && funcname != NULL) {
72-
DTRACE_FUNCTION_ENTRY(funcname, filename, lineno, classname, scope);
72+
DTRACE_FUNCTION_ENTRY((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope);
7373
}
7474

7575
execute(op_array TSRMLS_CC);
7676

7777
if (DTRACE_FUNCTION_RETURN_ENABLED() && funcname != NULL) {
78-
DTRACE_FUNCTION_RETURN(funcname, filename, lineno, classname, scope);
78+
DTRACE_FUNCTION_RETURN((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope);
7979
}
8080

8181
if (DTRACE_EXECUTE_RETURN_ENABLED()) {
82-
DTRACE_EXECUTE_RETURN(filename, lineno);
82+
DTRACE_EXECUTE_RETURN((char *)filename, lineno);
8383
}
8484
}
8585

8686
ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC)
8787
{
8888
int lineno;
89-
char *filename;
89+
const char *filename;
9090
if (DTRACE_EXECUTE_ENTRY_ENABLED() || DTRACE_EXECUTE_RETURN_ENABLED()) {
9191
filename = dtrace_get_executed_filename(TSRMLS_C);
9292
lineno = zend_get_executed_lineno(TSRMLS_C);
9393
}
9494

9595
if (DTRACE_EXECUTE_ENTRY_ENABLED()) {
96-
DTRACE_EXECUTE_ENTRY(filename, lineno);
96+
DTRACE_EXECUTE_ENTRY((char *)filename, lineno);
9797
}
9898

9999
execute_internal(execute_data_ptr, return_value_used TSRMLS_CC);
100100

101101
if (DTRACE_EXECUTE_RETURN_ENABLED()) {
102-
DTRACE_EXECUTE_RETURN(filename, lineno);
102+
DTRACE_EXECUTE_RETURN((char *)filename, lineno);
103103
}
104104
}
105105

Zend/zend_vm_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2984,7 +2984,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
29842984

29852985
#ifdef HAVE_DTRACE
29862986
if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) {
2987-
DTRACE_EXCEPTION_CAUGHT(ce->name);
2987+
DTRACE_EXCEPTION_CAUGHT((char *)ce->name);
29882988
}
29892989
#endif /* HAVE_DTRACE */
29902990

Zend/zend_vm_execute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6279,7 +6279,7 @@ static int ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
62796279

62806280
#ifdef HAVE_DTRACE
62816281
if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) {
6282-
DTRACE_EXCEPTION_CAUGHT(ce->name);
6282+
DTRACE_EXCEPTION_CAUGHT((char *)ce->name);
62836283
}
62846284
#endif /* HAVE_DTRACE */
62856285

main/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,7 @@ int php_request_startup(TSRMLS_D)
15261526
int retval = SUCCESS;
15271527

15281528
#ifdef HAVE_DTRACE
1529-
DTRACE_REQUEST_STARTUP(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), SAFE_FILENAME(SG(request_info).request_method));
1529+
DTRACE_REQUEST_STARTUP(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), (char *)SAFE_FILENAME(SG(request_info).request_method));
15301530
#endif /* HAVE_DTRACE */
15311531

15321532
#ifdef PHP_WIN32
@@ -1836,7 +1836,7 @@ void php_request_shutdown(void *dummy)
18361836
#endif
18371837

18381838
#ifdef HAVE_DTRACE
1839-
DTRACE_REQUEST_SHUTDOWN(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), SAFE_FILENAME(SG(request_info).request_method));
1839+
DTRACE_REQUEST_SHUTDOWN(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), (char *)SAFE_FILENAME(SG(request_info).request_method));
18401840
#endif /* HAVE_DTRACE */
18411841
}
18421842
/* }}} */

0 commit comments

Comments
 (0)