[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: parse-datetime.y: yylex declaration and definition differ

From: Pádraig Brady
Subject: Re: parse-datetime.y: yylex declaration and definition differ
Date: Sun, 14 Dec 2014 18:20:13 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

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 <address@hidden>) 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
-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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]