[cfe-dev] Spurious -Wunused-comparison

Csaba Raduly rcsaba at gmail.com
Sun Jul 13 08:35:55 PDT 2014


Hi Samuel,

On Sat, Jul 12, 2014 at 7:34 AM, Samuel Williams  wrote:
> Hi.
>
> I'm implementing
>
> class Foo {
>     void operator==(...) {}
> }
>
> for a DSL and getting errors:
>
> warning: equality comparison result unused [-Wunused-comparison]
>
> I feel this error is not appropriate in such circumstances?

What's the point of implementing operator== (equality comparison!) if
you can't get the result?

The return type of operator== should be bool.

Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds



More information about the cfe-dev mailing list