| Summary: | [MSVC] preprocessor symbol __STDC__ always defined | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Missing name <Gert.Grossmann> |
| Component: | cdt-parser | Assignee: | Marc-André Laperle <malaperle> |
| Status: | RESOLVED FIXED | QA Contact: | Markus Schorn <mschorn.eclipse> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug, malaperle, yevshif, zeratul976 |
| Version: | 8.0 | ||
| Target Milestone: | 9.10.0 | ||
| Hardware: | PC | ||
| OS: | Windows All | ||
| See Also: |
https://git.eclipse.org/r/150322 https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=4e16631f30de08444342b0ad6622cfcf3cd39fd4 |
||
| Whiteboard: | |||
|
Description
Missing name
Currently it is defined by cdt parser in CPreprocessor. But it should be probably defined by scanner discovery where it could inspect toolchain options. If so I think we should remove the macro definition from CPreprocessor class. I don't mind removing the builtin definition in the preprocessor. However, we may make the situation worse for other users that then miss the definition for __STDC__. I think we first need to provide the support for scanner configuration for the microsoft compiler (or do we already have that?) and only afterwards remove the predefined value for __STDC__. Fixed in commit http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=48d5341bf7fdfd5b11540e032ed2dc969e8c32d1. (In reply to Nathan Ridge from comment #3) > Fixed in commit > http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/ > ?id=48d5341bf7fdfd5b11540e032ed2dc969e8c32d1. Please ignore that, I meant to post that to a different bug. New Gerrit change created: https://git.eclipse.org/r/150322 Gerrit change https://git.eclipse.org/r/150322 was merged to [master]. Commit: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=4e16631f30de08444342b0ad6622cfcf3cd39fd4 (In reply to Markus Schorn from comment #2) > I don't mind removing the builtin definition in the preprocessor. However, > we may make the situation worse for other users that then miss the > definition for __STDC__. > I think we first need to provide the support for scanner configuration for > the microsoft compiler (or do we already have that?) and only afterwards > remove the predefined value for __STDC__. We don't have a scanner configuration for MSVC yet but instead use the CompilerType in GPP/GCC Scanner configuration to decide whether or not to add __STDC__. We also use CompilerType so set other MSVC specific keywords so it is trivial to add another macro. Other scanner configurations not extending GPP/GCCScannerExtensionConfiguration are changed to add __STDC__ for minimizing client impact. Having MSVC have its own scanner configuration and language will be a better solution but can be done separately. If anyone knows how to do that based on toolchain that would be helpful! We are also missing the case where files are compiled as C and /Za is used, but that should be much less common. See bug 551758. |