You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4c9117d
But because C89 based compiler warning flag -Wdeclaration-after-statement, latest compiler (gcc version 14.1.1 20240522, clang version 18.1.6) told me that some warning.
In file included from /usr/include/python3.12/Python.h:44,
from /home/paran/uftrace/utils/script-python.h:20,
from /home/paran/uftrace/utils/script.h:13,
from /home/paran/uftrace/utils/script-luajit.c:9:
/usr/include/python3.12/object.h: In function ‘Py_SIZE’:
/usr/include/python3.12/object.h:233:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
233 | PyVarObject *var_ob = _PyVarObject_CAST(ob);
| ^~~~~~~~~~~
In file included from /usr/include/python3.12/Python.h:53:
/usr/include/python3.12/cpython/longintrepr.h: In function ‘_PyLong_CompactValue’:
/usr/include/python3.12/cpython/longintrepr.h:121:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
121 | Py_ssize_t sign = 1 - (op->long_value.lv_tag & _PyLong_SIGN_MASK);
| ^~~~~~~~~~
CC utils/script-python.o
In file included from /usr/include/python3.12/Python.h:44,
from /home/paran/uftrace/utils/script-python.h:20,
from /home/paran/uftrace/utils/script-python.c:15:
/usr/include/python3.12/object.h: In function ‘Py_SIZE’:
/usr/include/python3.12/object.h:233:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
233 | PyVarObject *var_ob = _PyVarObject_CAST(ob);
| ^~~~~~~~~~~
In file included from /usr/include/python3.12/Python.h:53:
/usr/include/python3.12/cpython/longintrepr.h: In function ‘_PyLong_CompactValue’:
/usr/include/python3.12/cpython/longintrepr.h:121:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
121 | Py_ssize_t sign = 1 - (op->long_value.lv_tag & _PyLong_SIGN_MASK);
| ^~~~~~~~~~
The text was updated successfully, but these errors were encountered:
It's a matter of coding style and I feel it's better to have declarations before statements. Maybe I need to reconsider later but let's fix the external codes like python (or luajit) with pragma push/pop:
In file included from /usr/include/python3.12/Python.h:44,
from /home/paran/uftrace/utils/script-python.h:20,
from /home/paran/uftrace/utils/script.h:13,
from /home/paran/uftrace/utils/script-luajit.c:9:
Also, it seems we include python headers for the luajit script. This is not needed and I think we should remove the language specific headers from the utils/script.h file.
In
Makefile
, We useC11
.But because C89 based compiler warning flag
-Wdeclaration-after-statement
, latest compiler (gcc version 14.1.1 20240522, clang version 18.1.6) told me that some warning.Here is the build log.
The text was updated successfully, but these errors were encountered: