On 04/08/2020 04:42, Keith Thompson wrote:
> But J.2 (which is non-normative) says that the behavior is undefined if:
> A function, object, type, or macro that is specified as being
> declared or defined by some standard header is used before any
> header that declares or defines it is included (7.1.2).
This is a fine example of the ambiguity in English that makes
writing standards therein fraught with difficulties. The structure is
"UB if A before B". Keith reads that as forbidding "A" without "B",
the same structure as "you can't go out before Saturday"; others read
it as "A" being allowed by itself or following "B", but not if there
is a later "B", the same structure as "you can't eat before swimming".
So it's ambiguous.
I used to use "while" to illustrate a similar ambiguity; the
UK used to have a road sign "wait here while lights are red" in front
of temporary signals for road works. But whereas most people read
"while" as meaning "for as long as" [also the programming usage],
in parts of the UK it means "until" ["wait here while the doctor
comes"], which left locals [allegedly] waiting on the green light
and driving through on red [even in Yorkshire, they're probably
not that daft, though it might be an ingenious excuse following an
accident].
This article is brought to you from the campaign for formal
definitions of languages. [There has been a relevant thread over
in "comp.lang.misc".]
--
Andy Walker,
Nottingham.