[PATCH] libcpp: use better locations for _Pragma tokens (preprocessor/69126)

Steve Ellcey sellcey@imgtec.com
Thu Jan 28 19:12:00 GMT 2016


David,

This patch has broken the top-of-tree glibc build.  I get an error on an
undef that is supposed to be protected by Pragmas.  It happens when
compiling intl/plural.c in glibc.  I created a preprocessed source file
but when I compile it, the error doesn't happen.  I will try to create a
small unpreprocessed standalone test case but maybe this is enough for
you to know what is happening.

If I look at the preprocessed code, the statement in question is
under ingore warning pragmas.

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuninitialized"
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
  *++yyvsp = __gettextlval;
#pragma GCC diagnostic pop


Steve Ellcey
sellcey@imgtec.com

plural.c: In function '__gettextparse':
plural.c:1767:12: error: '__gettextlval.num' may be used uninitialized
in this function [-Werror=maybe-uninitialized]
   *++yyvsp = yylval;
             
plural.c:66:25: note: '__gettextlval.num' was declared here
 #define yylval          __gettextlval
                         ^
plural.c:1265:9: note: in expansion of macro 'yylval'
 YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
         ^~~~~~
cc1: all warnings being treated as errors



More information about the Gcc-patches mailing list