News for hackers. Stuff that matters.
Re:C and C++ Prioritize Performance over Correctness by pdw on Friday August 18, 2023 @03:23PM (#37180785)
You're quoting from a footnote. The footnotes are not part of the normative text, so how you choose to interpret it is irrelevant.

The actual definition of undefined behavior given by § 3.4.3 is: "behavior, upon use of a nonportable or erroneous program construct or of erroneous data, for which this International Standard imposes no requirements."

Since no requirement is imposed, compilers can do as they want.

Re:C and C++ Prioritize Performance over Correctness by torstenvl on Friday August 18, 2023 @03:32PM (#37180920)
> You're quoting from a footnote. The footnotes are not part of the normative text

I am not quoting from a footnote.

Footnote 1 pertains to § 1.

Footnote 2 pertains to § 3.19.5.

There are no footnotes pertaining to § 3.4.3.

And do you have a citation for the proposition that footnotes or notes of any other kind are not normative?

Re:C and C++ Prioritize Performance over Correctness by pdw on Friday August 18, 2023 @04:05PM (#37181361)
Apologies, it's a note, not a footnote. But notes in ISO standards aren't normative either.

This is a general principle of ISO standards, see https://share.ansi.org/Shared%20Documents/Standards%20Activi...:

> 6.5 Other informative elements

> 6.5.1 Notes and examples integrated in the text

> Notes and examples integrated in the text of a document shall only be used for giving additional information intended to assist the understanding or use of the document. They shall not contain requirements ("shall"; see 3.3.1 and Table H.1) or any information considered indispensable for the use of the document, e.g. instructions (imperative; see Table H.1), recommendations ("should"; see 3.3.2 and Table H.2) or permission ("may"; see Table H.3). Notes may be written as a statement of fact.

Re:C and C++ Prioritize Performance over Correctness by torstenvl on Saturday August 19, 2023 @12:26AM (#37185503)
I don't view "You shall not do this" and "If you do this, it's meaningless" as identical statements.

Besides, clang does the same thing with -std=c89, where this provision was emphatically not a note.