[cfe-dev] Possibly invalid enum tautology warning

David Blaikie dblaikie at gmail.com
Sun Aug 7 13:32:28 PDT 2011


On Sun, Aug 7, 2011 at 12:29 PM, John McCall <rjmccall at apple.com> wrote:
> but it sounds
> like you're arguing that we should suppress warnings when another
> platform exists where the warning wouldn't trigger.

In this particular case I think that's what he's saying, yes. But I
wouldn't say that implies the general statement you've made.

> it's
> contrary to what most people writing portable code want;  indeed,
> we frequently get the dual request, to enable warnings on code that
> works on the current platform but wouldn't on something else.

& what's your opinion when such a request is made?

I think the key here is that it depends on the semantics of the
warning. I'd say these requests you mention are consistent with
Peter's request: Help me write portable code. If you're warning me
about something that is useful on some implementations & trivial on
others, that's not helping me. If you aren't warning me about
something because it happens to be reasonable on this compiler but
wouldn't be on others, that's not helping (not as much as it could)
either.

Though, yes, I agree that it's probably a lot of work to try to aim
for such a bar - I don't know whether that means clang should throw
out the goal entirely, or just try to do it opportunistically.

I'm sure I'm not sufficiently expressing myself here, but hopefully
it'll make some sense,

- David




More information about the cfe-dev mailing list