Re:Three proposals for the C standard WG14
by jcranmer on Wednesday June 20, 2018 @09:08PM
(#17361256)
What the author wants, essentially, is to dictate that common disable-UB flags (e.g., -fwrapv, -fno-strict-aliasing) be folded into the C standard. Well, he probably knew that the C standards committee isn't going to accept that, so instead he's trying to "only" disable the bits of undefined behavior that don't screw over the user. Except he doesn't have a good enough grasp of the standard to actually effect proper wording:
(1) essentially disables inlining as a side effect, at least if undefined behavior is involved. (2) either is 100% redundant or means that every implementation must strictly execute the C abstract machine with absolutely no optimization permitted. (3) means you can no longer access any type with a char. You also couldn't access the bits of a float by casting to an int.
(2) seems like it is already specified; the trouble is in determining what "the semantics of the program" are. This relates to (1) although it doesn't seem like the author has a completely solid grasp of the legalities of the language.