How to Use the Plan 9 C Compiler [pdf]
plan9.bell-labs.com
plan9.bell-labs.com
This can be a major security vulnerability if the #define is enabling a security feature but it gets silently disabled because of a misspelling.
Theo de Raadt considered using it for OpenBSD at the turn of the 21st century, but backed out over licensing.
I have no idea what angle you're getting at here.
--
0: ftp://nic.funet.fi/pub/OS/plan9/doc/plan-9-docs/dist.ps.Z
I can compile nearly any C program using gcc and get correct behavior. Obviously I can also compile a lot of other things using gcc, including things that are not found in C, and if I do so then I cannot expect any definition of C to specify the resulting behavior. But most C programs will not compile using the Plan 9 compilers at all, because they do not accept the C language by any meaningful definition. In the case of const, it's also true that many dangerously incorrect programs will compile when using Plan 9's compiler, even though any definition of C prohibits that explicitly. These are qualitative differences.
Let's be even more concrete. In case 1, we consider a language exactly like C (pick whatever C you want here), but with the following additional preprocessor symbols always defined:
#define _FBEGIN {
#define _FEND }
This language allows, but does not require, the use of alternate tokens instead of { and } around function bodies. Because the tokens are taken from a namespace reserved by the standards, every correct C program is also a correct program in this language, and will have the same behavior. I submit that one may reasonably claim that a compiler for this language is a C compiler that supports extensions, even though a very limited subset of incorrect programs will fail to compile in a different way than they would when submitted to a C compiler.In case 2, we consider the same language except that in this case the use of { and } around function bodies is not accepted. Instead, one must use _FBEGIN and _FEND. I submit that a compiler for this language is not a C compiler, as no (useful) correct C program is accepted by it.
What the Plan 9 compiler authors did, repeatedly, reduces to case 2. There is nothing unethical about creating a new language. There is something unethical about creating a new language and not only deliberately giving it the same name as a similar (very popular) language, but disingenuously acting as if it were that language. At best, the implication that all other (again, very popular) standards and implementations of C are wrong simply for not being Plan 9's is obnoxiously smug.
Yikes.
Or maybe they went off the rails and lost their minds, like Bill Shockley.
Volatile's behavior is not really defined by the standard and is rarely useful in any case. I'm pretty sure that you can ignore it and remain a fully compliant C compiler.