Do not remove -Wp, before -D and -U when recording used compiler flags
This breaks the pattern used when undefining and then defining a variable in the same flag: $ echo | g++ -Wp,-UVAR,-DVAR=1 -c -x c++ - Here -Wp,-UVAR,-DVAR=1 will first undefine VAR and then define it to 1 If the -Wp, is dropped, this fails: $ echo | g++ -UVAR,-DVAR=1 -c -x c++ - <command-line>: warning: extra tokens at end of #undef directive Now it will only undefine VAR, but not define it. I.e. instead of #undef VAR #define VAR 1 you get #undef VAR,-DVAR=1 which explains the rather cryptic warning about extra token after #undef.
Loading
Please register or sign in to comment