-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cflags parsing (#2510, #2265) #2590
Conversation
This reverts commit 8037f47.
I went through GCC's man page and selected flags that can safely be passed to GCC and that can be useful to syntax checking. These include: - -I/-i* include flags - preprocessor flags such as -D - -W* warning flags - -O* optimization flags - most -f options - -m arch dependent options
My bad. It was caused by the revert. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be fine. I'll ask people to test this to see if it fixes their issues.
@0mco @davidvandebunte @ranebrown What do you think? |
That fixes #2265 for me. Thanks! |
It works for me. But since this just considered |
I prefer the whitelist option, because there are a lot of options that should be removed. And gcc/clang may add more unwanted options in future versions, so we would have to be more careful about that. However, we could add an option for additional whitelisted flags, which would enable easy configuring for other compilers and/or newer versions without changing the source code. |
Okay, I'll merge this now. Thanks for this! |
…analysis#2590) * Parse CFLAGS that can be passed using a whitelist I went through GCC's man page and selected flags that can safely be passed to GCC and that can be useful to syntax checking. These include: - -I/-i* include flags - preprocessor flags such as -D - -W* warning flags - -O* optimization flags - most -f options - -m arch dependent options * Fix CFLAGS tests: -Idir is now parsed to -I dir * Added two tests for flags we want or don't want to pass. * Also check for / in addition to s:sep
…analysis#2590) * Parse CFLAGS that can be passed using a whitelist I went through GCC's man page and selected flags that can safely be passed to GCC and that can be useful to syntax checking. These include: - -I/-i* include flags - preprocessor flags such as -D - -W* warning flags - -O* optimization flags - most -f options - -m arch dependent options * Fix CFLAGS tests: -Idir is now parsed to -I dir * Added two tests for flags we want or don't want to pass. * Also check for / in addition to s:sep
This PR fixes the cflags parsing problem I had in #2510: some filenames were passed as arguments. I believe it should fix #2265 as well.
Ping for testing: @0mco @davidvandebunte @ranebrown