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] Warn for dangerous use of omitted middle operand in ?:


> As a follow up, if the else-branch is a comparison too you could warn as
> 
>     "the omitted middle operand in ?: will always be %<true%>, "
>     "suggest using || instead of ?:"

That would assume the omitted operand wasn't a mistake.

At least in the case that prompted me originally to add this
warning it was a mistake and was supposed to be a different value.

-Andi
-- 
ak@linux.intel.com -- Speaking for myself only.


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