Obsolete C for you and me
Obsolete C for you and me
Posted Dec 9, 2023 8:21 UTC (Sat) by pm215 (subscriber, #98099)In reply to: Obsolete C for you and me by rrolls
Parent article: Modern C for Fedora (and the world)
Posted Dec 12, 2023 13:33 UTC (Tue)
by rrolls (subscriber, #151126)
[Link] (2 responses)
However:
Did any actual C standard parse it as the latter?
If yes, then my point stands, meaning that if someone invokes a C compiler and explicitly tells it to use whatever old C standard that was, then that's the way it should be parsed. Does this cause a security issue? No! Because you have explicitly specify that.
If no, then the point is moot, because if it's not specified behavior then I'd say the compiler is free to change its behavior as it pleases.
Posted Dec 12, 2023 14:08 UTC (Tue)
by farnz (subscriber, #17727)
[Link]
This now comes down to the definition of "actual C standard". No ISO C standard parsed it as the latter, but some K&R versions did. However, K&R wasn't a formal standard - it was more or less defined in terms of what the K&R compiler did.
Posted Dec 12, 2023 14:13 UTC (Tue)
by excors (subscriber, #95769)
[Link]
According to https://www.bell-labs.com/usr/dmr/www/chist.html :
> B introduced generalized assignment operators, using x=+y to add y to x. The notation came from Algol 68 [Wijngaarden 75] via McIlroy, who had incorporated it into his version of TMG. (In B and early C, the operator was spelled =+ instead of += ; this mistake, repaired in 1976, was induced by a seductively easy way of handling the first form in B's lexical analyzer.)
Obsolete C for you and me
Obsolete C for you and me
Obsolete C for you and me