Skip to content
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

Added the SYSTEM flag to include_directories #435

Merged
merged 1 commit into from Jul 7, 2015

Conversation

mkoval
Copy link
Collaborator

@mkoval mkoval commented Jul 6, 2015

This pull request flags include_directories on third-party packages with the SYSTEM flag. This lets the compiler suppress warnings from those headers, typically by passing the directory using the -isystem flag instead of -i.

This is important when building DART with a modern version of Clang, which produce a large number of warnings every time Eigen is included.

@mxgrey
Copy link
Member

mxgrey commented Jul 6, 2015

👍 I like not being yelled at for other people's issues.

But just to be clear: If my code uses a deprecated function from one of those headers, would the warning be blocked? I'm having trouble finding specifics about the behavior.

@mxgrey
Copy link
Member

mxgrey commented Jul 6, 2015

I can't find anything that says it explicitly, but I think the answer to my question is almost definitely a "No, those warnings will not be suppressed", because it seems that the -isystem flag does not recklessly block all warnings from a header.

@mkoval
Copy link
Collaborator Author

mkoval commented Jul 6, 2015

This is what the the Clang documentation says:

Warnings are suppressed when they occur in system headers. By default, an included file is treated as a system header if it is found in an include path specified by -isystem, but this can be overridden in several ways.

GCC says something similar:

The header files declaring interfaces to the operating system and runtime libraries often cannot be written in strictly conforming C. Therefore, GCC gives code found in system headers special treatment. All warnings, other than those generated by ‘#warning’ (see Diagnostics), are suppressed while GCC is processing a system header. Macros defined in a system header are immune to a few warnings wherever they are expanded. This immunity is granted on an ad-hoc basis, when we find that a warning generates lots of false positives because of code in macros defined in system headers.

I can't find a concrete statement either way.

@jslee02
Copy link
Member

jslee02 commented Jul 6, 2015

I tested an simple example of what @mxgrey said. The use of deprecated API warnings were not suppressed as expected.

👍

@jslee02 jslee02 added this to the DART 5.1.0 milestone Jul 6, 2015
jslee02 added a commit that referenced this pull request Jul 7, 2015
Added the SYSTEM flag to include_directories
@jslee02 jslee02 merged commit 36ec220 into dartsim:master Jul 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants