From aotto1968@21:1/5 to All on Thu Aug 29 10:51:54 2024
Hi,
I use a MACRO to give my API a specific namespace
#define MQ(name) my_namespace_ ## name
and every "public" item in the library is defined with (example)
int MQ(myFunc) { ... }
this works fine BUT it is annoying that in a compiler-error this specific namespace
always show-up as first (unnecessary) item in the error-message
(example)
.../MqContextC_py.c: In function ‘py_mqmsgque_MqContextC_ConfigGetIdentFrom’:
.../LibMqMsgque_py.h:76:15: error: ‘py_mqmsgque_MqIdentE’ undeclared (first use in this function); did you mean
‘py_mqmsgque_MqIdent’?
76 | #define MQ(n) py_mqmsgque_ ## n <<<<<<<<<<<< this step I want to miss
| ^~~~~~~~~~~~
.../LibMkKernel_py.h:399:47: note: in definition of macro ‘OT_retObj_SET’
399 | #define OT_retObj_SET(val) retObj = (val);
| ^~~ .../LibMqMsgque_py.h:204:71: note: in expansion of macro ‘MQ’
204 | #define OT_NEW_Mq_enum_OBJ(typ,val) PyObject_CallFunction((PyObject*)MQ(Mq ## typ),"i",val)
| ^~
../MqContextC_py.c:649:17: note: in expansion of macro ‘OT_NEW_Mq_enum_OBJ’
649 | OT_retObj_SET(OT_NEW_Mq_enum_OBJ(IdentE,MqConfigGetIdentFrom (hdl)))
| ^~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
→ it is possible to set in GCC a specific macro to "silent"