Skip to content

Commit

Permalink
yacc.c: fix warnings about undefined macros
Browse files Browse the repository at this point in the history
For instance with GCC 4.9 and --enable-gcc-warnings:

    25. input.at:1201: testing Torturing the Scanner ...
    ../../tests/input.at:1344: $CC $CFLAGS $CPPFLAGS  -c -o input.o input.c
    stderr:
    input.c:239:18: error: "__STDC_VERSION__" is not defined [-Werror=undef]
     # elif 199901 <= __STDC_VERSION__
                      ^
    input.c:256:18: error: "__STDC_VERSION__" is not defined [-Werror=undef]
     # elif 199901 <= __STDC_VERSION__
                      ^

* data/skeletons/yacc.c: Check that __STDC_VERSION__ is defined before
using it.
  • Loading branch information
akimd committed Oct 4, 2019
1 parent 1133220 commit bc96b75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/skeletons/yacc.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ typedef short yytype_int16;
# elif defined ptrdiff_t && defined PTRDIFF_MAX
# define YYPTRDIFF_T ptrdiff_t
# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
# elif 199901 <= __STDC_VERSION__
# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYPTRDIFF_T ptrdiff_t
# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
Expand All @@ -436,7 +436,7 @@ typedef short yytype_int16;
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
# elif 199901 <= __STDC_VERSION__
# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
Expand Down

0 comments on commit bc96b75

Please sign in to comment.