bug-bison
[Top][All Lists]
Advanced

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

Re: bison-2.6.4-generated parser triggers pragma warnings in GCC 4.6.3


From: Sergei Steshenko
Subject: Re: bison-2.6.4-generated parser triggers pragma warnings in GCC 4.6.3
Date: Tue, 6 Nov 2012 05:43:24 -0800 (PST)




----- Original Message -----
> From: Akim Demaille <address@hidden>
> To: Paul Eggert <address@hidden>
> Cc: Bison Bugs <address@hidden>; Peter Simons <address@hidden>
> Sent: Tuesday, November 6, 2012 2:43 PM
> Subject: Re: bison-2.6.4-generated parser triggers pragma warnings in GCC 
> 4.6.3
> 
> 
[snip]
> This is a nightmare.  Trying to please GCC in all the situation
> is painful work.  
[snip]

You know, 'gcc' in fact tries very hard to press you to stick to KISS principle.

I didn't look into 'bison' warnings, but once looking at somebody else's 
complaints regarding 'gcc' warnings I easily found poor coding style.

It was something like this:

for(i = 0; i < N; i++)
  {
  if(i == 0)
    {
    ...
    }
  else
    {
    ...
    }
  }

- in that case the loop shouldn't have contained 'i = 0' in the first place, 
i.e. the code after 'if' should have been put before the loop, and the 'for' 
statement should have been

for(i = 1; i < N; i++)
.

Regards,
  Sergei.




reply via email to

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