[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Having fun with the following C code (UB)



On 13/04/14 06:32, Russ Allbery wrote:
Like I said before, I am not against the compilers warning about such
> cases. I just think that these warnings need to be done very carefully,
> or they become worse than useless.  As such, if you see a case in which
> you feel gcc (or clang, or whatever) should warn, by all means open a
> bug for it.  Just make sure you make it a "feature request" and not a
> "security hole" severity.  In other words, don't get mad merely because
> the compiler author did not read your mind.
I'll be sure to keep that in mind, since I've never reported a bug or
discussed issues with compiler writers before.
No issues with most of what you said. It boils down to this: Different people write in C/C++ for different reasons, and therefor have different needs. I think the compiler writers are doing what they can, but there really is no pleasing everyone.

Personally, I simply try to have my code compile on as broad a range of compilers as I can, and thus enjoy their combined warnings.

The thing about the above is this. In the past, we've seen some people really explode over these issues. I think this is incorrect. The bug is, when all is said and done, in the code. While it's perfectly acceptable, in my eyes, to ask the compiler to help you find that bug, getting mad at it for not doing so makes no sense.

Shachar

Reply to: