Re: [PATCH 16/16] fix handling of integer constant expressions

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Josh Triplett
Date: Wednesday, June 27, 2007 - 9:34 am

On Wed, 2007-06-27 at 09:19 -0700, Linus Torvalds wrote:
[...]

Agreed.  Issuing a warning on these kinds of constructs does not seem
useful, but if people really want it, it should go in some warning
option that does not get turned on by default, and probably should not
get turned on by -Wall either.


Also agreed.  Same goes for other short-circuiting operations like &&,
||, and ?: without the center argument; if you can determine at
compilation time that it does not need to evaluate part of the
expression at all, go ahead and ignore that part of the expression even
if it does not constitute an integer constant expression.  If you want
to optionally check for this case and issue a diagnostic, put it under
-Wstrict-constant-expressions or similar.

- Josh Triplett


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 16/16] fix handling of integer constant expressions, Segher Boessenkool, (Sun Jun 24, 11:18 am)
Re: [PATCH 16/16] fix handling of integer constant expressions, Segher Boessenkool, (Sun Jun 24, 12:09 pm)
Re: [PATCH 16/16] fix handling of integer constant expressions, Segher Boessenkool, (Sun Jun 24, 12:40 pm)
Re: [PATCH 16/16] fix handling of integer constant expressions, Segher Boessenkool, (Sun Jun 24, 11:13 pm)
Re: [PATCH 16/16] fix handling of integer constant expressions, Segher Boessenkool, (Sun Jun 24, 11:16 pm)
Re: [PATCH 16/16] fix handling of integer constant expressions, Josh Triplett, (Wed Jun 27, 9:34 am)
Re: [PATCH 16/16] fix handling of integer constant expressions, Segher Boessenkool, (Thu Jun 28, 2:08 am)