4 ms·
Worth pointing out Plan9's C was itself sort of its own language. I think it was a strict subset, but I can't remember all the details. The preprocessor was muc
by spijdar 5y ago
Worth pointing out Plan9's C was itself sort of its own language. I think it was a strict subset, but I can't remember all the details. The preprocessor was much simpler, that much I remember.
- mananaysiempre 5y agoNot exactly a subset, there were at least the anonymous struct/union members that partially made it into C11 much later. But then if we look beyond the syntax almost any C implementation is “its own language” in that it defines behaviour the standard doesn’t specify, and frequently also changes behaviour the standard does, if in minor ways. Like how the Windows ABI forces a noncompliant wchar_t. (Even if we look at the preprocessor, the classic algorithm implemented in most places [that I can’t be bothered to find a link for] in fact expands more than the standard strictly guarantees, e.g. you can sometimes get recursive expansion out of it by creative use of token pasting,—I remember reading the ANSI committee thought the case was too “perverse” and didn’t specify anything [no link here as well, sorry... poke me again if you actually care about this]. The standalone preprocessor mcpp has warnings about this specification hole, but other implementations don’t as far as I know. And you’d think the preprocessor, an almost purely syntactic thing, wouldn’t have implementation differences worth keeping around.)
- MisterTea 5y agoYes, Plan 9 c has its own C library which does not follow ANSI/ISO though it is very similar to ISO C. Its syntax is pretty much c89 and the useful bits of c99. To build ANSI/POSIX you use the APE (ANSI/POSIX Environment) compilers and libraries which are built in. It's only reason for existing is to help with porting Unix baggage. The compiler is kencc which is why it is different. Plan 9 also still uses a.out for binary images.