This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH RFA: C++ frontend: Don't warn about shifts which will not be run


On Fri, 12 Jun 2009, Ian Lance Taylor wrote:

> -/* Nonzero means the expression being parsed will never be evaluated.
> -   This is a count, since unevaluated expressions can nest.  */
> +/* Nonzero means the expression being parsed will never be
> +   evaluated.  */

Pre-existing condition, but this is not accurate.  skip_evaluation is a 
*heuristic* to avoid spurious warnings; it's set inside sizeof even though 
we don't know until after the whole expression/type inside sizeof has been 
parsed whether it's actually sizeof(VLA) which is evaluated.

I'm not convinced the distinction you are making here between 
unexecuted/unevaluated is a very well-defined one for C, although such 
concepts do appear in the standard to some extent (6.9 considers only 
expressions inside sizeof-non-VLA while 6.6#3 has a less precisely defined 
"not evaluated" for constant expressions that includes at least the 
example 2 || 1 / 0).  The implementations of these two distinct concepts 
in GCC are quite complicated, and separate from the heuristic 
skip_evaluation.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]