Obsolete C for you and me
Obsolete C for you and me
Posted Dec 10, 2023 19:49 UTC (Sun) by smoogen (subscriber, #97)In reply to: Obsolete C for you and me by NYKevin
Parent article: Modern C for Fedora (and the world)
Posted Dec 10, 2023 20:36 UTC (Sun)
by NYKevin (subscriber, #129325)
[Link] (1 responses)
What I'm really getting at is, what is K&R C, from the compiler author's perspective? How do you know if a given compiler is a "valid" implementation of K&R? How do you know what optimizations are permitted? If the answer is "no optimizations are allowed, because there's no C abstract machine yet, so everything must be translated 1:1," then how do you decide what constitutes "1:1" output? Even the modern C standard does not define such a notion, and users would probably like to have some optimizations anyway.
I don't think there's any sensible answer to those questions that doesn't ultimately look like C89 with a bunch of -f options to enable K&R constructs, which is why there's no -std=kr option. The second edition explicitly acknowledges this limitation in the preface, and directs compiler authors to the C standard.
Posted Dec 11, 2023 16:03 UTC (Mon)
by smoogen (subscriber, #97)
[Link]
Obsolete C for you and me
Obsolete C for you and me