mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
build: fix compatibility with old compilers
GCC 4.2 dies with
src/InadequacyList.c: In function 'InadequacyList__new_conflict':
src/InadequacyList.c:37: error: #pragma GCC diagnostic not allowed inside functions
src/InadequacyList.c:37: error: #pragma GCC diagnostic not allowed inside functions
src/InadequacyList.c:40: error: #pragma GCC diagnostic not allowed inside functions
Reported by Evan Lavelle.
See https://lists.gnu.org/r/bug-bison/2020-03/msg00021.html
and https://trac.macports.org/ticket/59927.
* src/system.h (GCC_VERSION): New.
Use it to control IGNORE_TYPE_LIMITS_BEGIN and
IGNORE_TYPE_LIMITS_END.
This commit is contained in:
1
THANKS
1
THANKS
@@ -61,6 +61,7 @@ Enrico Scholz enrico.scholz@informatik.tu-chemnitz.de
|
|||||||
Eric Blake ebb9@byu.net
|
Eric Blake ebb9@byu.net
|
||||||
Eric S. Raymond esr@thyrsus.com
|
Eric S. Raymond esr@thyrsus.com
|
||||||
Étienne Renault renault@lrde.epita.fr
|
Étienne Renault renault@lrde.epita.fr
|
||||||
|
Evan Lavelle eml-bison@cyconix.com
|
||||||
Evan Nemerson evan@nemerson.com
|
Evan Nemerson evan@nemerson.com
|
||||||
Evgeny Stambulchik fnevgeny@plasma-gate.weizmann.ac.il
|
Evgeny Stambulchik fnevgeny@plasma-gate.weizmann.ac.il
|
||||||
Fabrice Bauzac noon@cote-dazur.com
|
Fabrice Bauzac noon@cote-dazur.com
|
||||||
|
|||||||
@@ -73,9 +73,14 @@ typedef size_t uintptr_t;
|
|||||||
# include <verify.h>
|
# include <verify.h>
|
||||||
# include <xalloc.h>
|
# include <xalloc.h>
|
||||||
|
|
||||||
|
// Clang and ICC like to pretend they are GCC.
|
||||||
|
#if defined __GNUC__ && !defined __clang__ && !defined __ICC
|
||||||
|
# define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* See https://lists.gnu.org/archive/html/bug-bison/2019-10/msg00061.html. */
|
// See https://lists.gnu.org/archive/html/bug-bison/2019-10/msg00061.html
|
||||||
# if defined __GNUC__ && ! defined __clang__ && ! defined __ICC && __GNUC__ < 5
|
// and https://trac.macports.org/ticket/59927.
|
||||||
|
#if defined GCC_VERSION && 405 <= GCC_VERSION
|
||||||
# define IGNORE_TYPE_LIMITS_BEGIN \
|
# define IGNORE_TYPE_LIMITS_BEGIN \
|
||||||
_Pragma ("GCC diagnostic push") \
|
_Pragma ("GCC diagnostic push") \
|
||||||
_Pragma ("GCC diagnostic ignored \"-Wtype-limits\"")
|
_Pragma ("GCC diagnostic ignored \"-Wtype-limits\"")
|
||||||
|
|||||||
Reference in New Issue
Block a user