Lex macro redefinition warnings

22 views
Skip to first unread message

Paul J

unread,
May 9, 2025, 3:05:30 AM5/9/25
to golden-cheetah-developers
I'm not sure whether anyone else is seeing this minor issue?

I've always had Lex macro redefinition warnings during builds (msvc2022, Flex-Bison 3.7)

Studio\2022\Community\VC\Tools\MSVC\14.43.34808\include\stdint.h(49): warning C4005: 'INT8_MIN': macro redefinition
Studio\2022\Community\VC\Tools\MSVC\14.43.34808\include\stdint.h(50): warning C4005: 'INT16_MIN': macro redefinition
....
....

After searching on the internet,

The problem appears to be:

These INT8_MIN, INT16_MIN, etc. macros are defined in stdint.h, so I am guessing that you are seeing this warning because your .l file has a block enclosed with %{ and }% in the definitions section with some #include directives, one of which is transitively including stdint.h.

 the solution is to place:

%top{
  #include <stdint.h>
}

at the top of the Lex .l files, this addition to the Lex files removes the warnings.

Maybe there is a better way, if not would you like me to create a PR with this fix ?

Ale Martinez

unread,
May 13, 2025, 11:14:12 AM5/13/25
to golden-cheetah-developers
El viernes, 9 de mayo de 2025 a la(s) 4:05:30 a.m. UTC-3, Paul J escribió:
I'm not sure whether anyone else is seeing this minor issue?

As you can see looking at AppVeyor ci-build logs it is a MSVC/Windows only apparently harmless warning
It looks like a clean solution if you want to remove the warning. 
Reply all
Reply to author
Forward
0 new messages