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] Add -Womitted-conditional-op warning


On Fri, 2 Feb 2007, Andi Kleen wrote:

[...]

| Actually not having an option and always one would be ok for this one IMHO,
| i just added the option for paranoia reasons in case it really is a
| serious problem for someone.

Either the short name or no name at all.

I've seen people contruct arguments about existing long names for -W
options.  I would like to diminish the overall effect, not multiply it.
So, either the short name, or no name at all.

| And -Wconditional would suggest it applying to all conditions, but it's
| really only for a narrow special case. That would be somewhat misleading.

I disagree. The issue is about the whole conditional expression.
In normal setting, it is ill-formed.  It makes sense only when in GNU
extension mode.

[...]

| > However, I'm fine with
| >
| >    warning: missing second operand in '?:'
| >    note: if the condition is a generalized 'true', it is the value
| >    note: of the whole conditional expression
|
| I don't like this version because it sounds like it is warning that the GNU extension
| is used.

Yes, precisely.  When the GNU extension is not used, it is an error.
So, we can get to that point only if the extension is used.

-- Gaby


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