Sujet : gcc usage skip a specific MACRO from GCC trace De : aotto1968 (at) *nospam* t-online.de (aotto1968) Groupes :comp.lang.c Date : 29. Aug 2024, 09:51:54 Autres entêtes Organisation : A noiseless patient Spider Message-ID :<vapcra$3tds9$1@dont-email.me> User-Agent : Mozilla Thunderbird
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"