portability: don't use _Pragma with ICC

ICC defines __GNUC__ [1], but does not support GCC's _Pragma for
diagnostics.  As a matter of fact, I believe it does not support
_Pragma at all (only #pragma) [2].

Reported by Maxim Prohorenko.
https://savannah.gnu.org/support/index.php?108339

[1] https://software.intel.com/en-us/cpp-compiler-18.0-developer-guide-and-reference-gcc-compatibility-and-interoperability
[2] https://software.intel.com/en-us/cpp-compiler-18.0-developer-guide-and-reference-pragmas

* data/c.m4 (YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN): Exclude ICC from
the club.
This commit is contained in:
Akim Demaille
2018-08-18 11:27:24 +02:00
parent 005ea24cbb
commit 5010af94d0
3 changed files with 7 additions and 1 deletions

5
NEWS
View File

@@ -92,6 +92,11 @@ GNU Bison NEWS
%printer/%destructor, which resulted in compiler errors if there are %printer/%destructor, which resulted in compiler errors if there are
backslashes or double-quotes in the grammar file name. backslashes or double-quotes in the grammar file name.
*** Portability on ICC
The Intel compiler claims compatibility with GCC, yet rejects its _Pragma.
Generated parsers now work around this.
* Noteworthy changes in release 3.0.5 (2018-05-27) [stable] * Noteworthy changes in release 3.0.5 (2018-05-27) [stable]
** Bug fixes ** Bug fixes

1
THANKS
View File

@@ -89,6 +89,7 @@ Martin Mokrejs mmokrejs@natur.cuni.cz
Martin Nylin martin.nylin@linuxmail.org Martin Nylin martin.nylin@linuxmail.org
Matt Kraai kraai@alumni.cmu.edu Matt Kraai kraai@alumni.cmu.edu
Matt Rosing rosing@peakfive.com Matt Rosing rosing@peakfive.com
Maxim Prohorenko Maxim.Prohorenko@gmail.com
Michael Catanzaro mcatanzaro@gnome.org Michael Catanzaro mcatanzaro@gnome.org
Michael Felt mamfelt@gmail.com Michael Felt mamfelt@gmail.com
Michael Hayes m.hayes@elec.canterbury.ac.nz Michael Hayes m.hayes@elec.canterbury.ac.nz

View File

@@ -242,7 +242,7 @@ m4_define([b4_attribute_define],
# define YYUSE(E) /* empty */ # define YYUSE(E) /* empty */
#endif #endif
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */ /* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic push") \