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: Add warning for boolean ?: value


On Fri, 29 Mar 2002, Andi Kleen wrote:

> It happened twice to me recently, so I added this warning to gcc. IMHO it is 
> near always a mistake so I made the warning unconditional.

Have you any analysis showing that it is nearly always an error when other
people use this extension?  For example, a large body of code using this
extension, by multiple authors, analysed by how many uses of this
extension do / do not use a boolean, and, of those using a boolean, how
many are errors?

Obviously, testcases would be needed for this warning, and the
documentation for the extension in extend.texi would need to explain that
GCC considers this usage a mistake and warns for it.

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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