3 ms·
> Anyone who's written C knows that full ISO C standard-adhering code is an impractical rarity. I've written quite a bit of C code and do not know that to be a
by einpoklum 5mo ago
> Anyone who's written C knows that full ISO C standard-adhering code is an impractical rarity.
I've written quite a bit of C code and do not know that to be a rarity. Especially when it comes to libraries rather than applications, and FOSS as opposed to proprietary code.
> Most real world C code out there relies on non-standard behaviors and language extensions to varying extents
Maybe it depends on which domain you're working in. At companies whose target platform is not a PC, relying on idiosycratic behavior, or extensions, is difficult: The compiler for the target device may simply not support the bells and whistles of GCC or whatever, so you stick to C99, (or even C89, ugh) to be on the safe side. And even then there will be things which are standard, but... well, I would be wary of relying on them being supported robustly enough, e.g. variable-length arrays.
And of course, once your code does not target just one single machine then you're forced to have to worry about portability and standard compliance etc.
- kouosi 5mo ago> And of course, once your code does not target just one single machine then you're forced to have to worry about portability and standard compliance etc. Well linux exclusively usages gcc to compile.
- fanf2 5mo agohttps://www.kernel.org/doc/html/latest/kbuild/llvm.html https://www.kernel.org/doc/html/latest/kbuild/llvm.html
- Maxatar 5mo agoThat's a good point, the more precise statement is that Linux exclusively uses gnu11 to compile. Clang happens to implement gnu11, I think it's the only non-GCC compiler to do so.
- pjmlp 5mo agoWhich was largely sponsored by Google, as they removed GCC from Android, and needed to have clang compile the Linux kernel. For a long time only Android Linux kernel downstream supported it.
- einpoklum 5mo agoYes, sorry, mistype, that should have been "single kind of machine" or "single operating system".
- bmink 5mo agoYes, while the article makes some good points the first paragraph was puzzling.