[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [-Wconversion] on "*yyssp = yystate;"
From: |
Akim Demaille |
Subject: |
Re: [-Wconversion] on "*yyssp = yystate;" |
Date: |
Tue, 11 Aug 2015 14:09:56 +0200 |
> Le 6 août 2015 à 20:03, Ulya Fokanova <address@hidden> a écrit :
>
> Hello!
>
> I get the following warning compling bison-3.0.4 generated parser with GCC:
>
> warning: conversion to ‘yytype_int16 {aka short int}’ from ‘int’ may
> alter its value [-Wconversion]
> *yyssp = yystate;
>
> As I understand, yyssp has to be 16-bit in order to reduce stack space. If
> this conversion is safe, bison could generate explicit cast; otherwise a more
> serious fix is needed. Could you fix it, or perhaps you'd like me to try send
> a patch ? Should I provide an example?
Hi Ulya,
Bison tries to use the smallest possible size of int for the tables. But I
guess yystate does not use the same type. However, it's safe.
If you can work out a patch (I'd avoid the cast though), that would be fine!
Otherwise, I'll probably address this at some point.
Cheers.