Re:A Guide to Undefined Behavior in C and C++
by UncleMeat on Thursday August 17, 2023 @05:33PM
(#37168418)
Right and the next part is the hard part: defining this clearly. What I'm saying is that there is a surprising amount of "wait, actually I do want that" when you dig into this proposal.
[ Parent
| on HN ]
Re:A Guide to Undefined Behavior in C and C++
by fluoridation on Thursday August 17, 2023 @07:28PM
(#37169671)
A reasonable compiler would let you turn off a specific warning for a section of code.
Re:A Guide to Undefined Behavior in C and C++
by torstenvl on Thursday August 17, 2023 @11:54PM
(#37171233)
They pretty much all do.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wwhatever"
// code
#pragma clang diagnostic pop
Re:A Guide to Undefined Behavior in C and C++
by fluoridation on Friday August 18, 2023 @03:05AM
(#37172226)
I was going to comment that GCC doesn't, but it seems it was added as some point since the last time I checked. I know at one time GCC had as a policy not to allow doing that.