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
Interesting - maybe a regression or something I am using pycparser right now to parse _Pragmas just fine
(though surely my version is quite old, ~2018?)
my code where I use it (string replacement for macro stuff that doesnt work with #pragma THING syntax doesnt work where THING could be another macro etc.)
#definePRAGMA_MESSAGE(x) _Pragma(#x)
// And then PRAGMA_MESSAGE() macro is used placesPRAGMA_MESSAGE(THING)
Maybe someone with string escape syntax or preprocessor used or not
🤷
This is a gray area for pycparser since preprocessor directives start with #. The preprocessor can leave some pragmas in the source so they are kind-of supported. I don't mind supporting _Pragma similarly if the PR is not too complicated
The use of
_Pragma
instead of#pragma
is accepted in C99. [1]pycparser raises a ParseError on this minimal main.c:
Python3+pycparser prompt:
Output:
[1] https://gcc.gnu.org/onlinedocs/cpp/Pragmas.html
The text was updated successfully, but these errors were encountered: