On 14/12/14 17:03, Tim Rühsen wrote: > Hi, > > libgnutls fails to compile here due to an issue with gnulib. > > The maintainer (Nikos Mavrogiannopoulos <n...@gnutls.org>) asked me to report > it here. > > > The declaration and definition of yylex() function differ (and maybe I get an > error because of gcc's -Wstrict-prototypes, but did not verify it). > > This patch fixes it for me: > > diff --git a/src/gl/parse-datetime.y b/src/gl/parse-datetime.y > index 52e6a0c..72d6c38 100644 > --- a/src/gl/parse-datetime.y > +++ b/src/gl/parse-datetime.y > @@ -1031,7 +1031,7 @@ lookup_word (parser_control const *pc, char *word) > } > > static int > -yylex (YYSTYPE *lvalp, parser_control *pc) > +yylex (union YYSTYPE *lvalp, parser_control *pc) > { > unsigned char c; > size_t count; > > > Regards, Tim
What version of compiler and what compile flags are you using? I can't reproduce with gcc 4.9.2 with these options: -W -Wabi -Waddress -Waggressive-loop-optimizations -Wall -Warray-bounds -Wattributes -Wbad-function-cast -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcomments -Wcoverage-mismatch -Wcpp -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wdouble-promotion -Wempty-body -Wendif-labels -Wenum-compare -Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wformat-zero-length -Wfree-nonheap-object -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-memory-model -Winvalid-pch -Wjump-misses-init -Wmain -Wmaybe-uninitialized -Wmissing-braces -Wmissing-declarations -Wmissing-field-initializers -Wmissing-include-dirs -Wmissing-parameter-type -Wmissing-prototypes -Wmultichar -Wnarrowing -Wnonnull -Wnormalized=nfc -Wold-style-declaration -Wold-style-definition -Woverflow -Woverlength-strings -Woverride-init -Wpacked -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-sign -Wpointer-to-int-cast -Wpragmas -Wreturn-local-addr -Wreturn-type -Wsequence-point -Wshadow -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstrict-prototypes -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wswitch -Wsync-nand -Wtrampolines -Wtrigraphs -Wtype-limits -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function -Wunused-label -Wunused-local-typedefs -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvarargs -Wvariadic-macros -Wvector-operation-performance -Wvolatile-register-var -Wwrite-strings -fdiagnostics-show-option -funit-at-a-time -Wno-sign-compare -Wno-unused-parameter -Wno-format-nonliteral -Wlogical-op Also would it be better to remove the "union" from the declaration. I.E. not have "union" in any of the declarations as there are many uses of YYSTYPE in that file. thanks, Pádraig