[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bison 3.5 - y.tab.c generates compiler warnings
From: |
Andy Fiddaman |
Subject: |
Re: Bison 3.5 - y.tab.c generates compiler warnings |
Date: |
Thu, 19 Dec 2019 10:25:14 +0000 (UTC) |
On Wed, 18 Dec 2019, Paul Eggert wrote:
; On 12/18/19 10:22 PM, Akim Demaille wrote:
; > I was unable to reproduce that warning
(https://travis-ci.org/akimd/bison/builds/626034753)
;
; I suspect you need a platform where plain 'char' is unsigned, so that 'typedef
; yytype_uint8 yy_state_t;' is treated as if it were 'typedef char yy_state_t;'
; which means yy_state_t indexes provoke the diagnostic. (A GCC bug, if you ask
me.)
Given this in the template:
#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
typedef __UINT_LEAST8_TYPE__ yytype_uint8;
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
&& UINT_LEAST8_MAX <= INT_MAX)
typedef uint_least8_t yytype_uint8;
#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
typedef unsigned char yytype_uint8;
#else
typedef short yytype_uint8;
#endif
and this from gcc:
#define __UINT_LEAST8_MAX__ 0xff
#define __INT_MAX__ 0x7fffffff
#define __UINT_LEAST8_TYPE__ unsigned char
It's the first part of the clause that is being selected and ending up with
typedef unsigned char yytype_uint8;
Andy
- Bison 3.5 - y.tab.c generates compiler warnings, Andy Fiddaman, 2019/12/16
- Re: Bison 3.5 - y.tab.c generates compiler warnings, Andy Fiddaman, 2019/12/19
- Re: Bison 3.5 - y.tab.c generates compiler warnings, Akim Demaille, 2019/12/29
- Re: Bison 3.5 - y.tab.c generates compiler warnings, Akim Demaille, 2019/12/31
- Re: Bison 3.5 - y.tab.c generates compiler warnings, Andy Fiddaman, 2019/12/31