3 ms·
As fun as the template contraptions can be, is anyone realistically compiling C code with the abstract C machine from the standard as their target ? All other
by obl 8y ago
As fun as the template contraptions can be, is anyone realistically compiling C code with the abstract C machine from the standard as their target ?
All other things being equal, I guess it's a plus to conform to the letter of the standard, except they are not.
It's much more productive to pick a few practical compilers/architectures as your target and allow yourself to work within the assumptions they provide you.
I'm sure some people will disagree but I'd much rather enable no-strict-aliasing and be on my way than trying to figure out if I actually abide by the convoluted standard rule, since, after all, it does not mandate the existence of this option.
- userbinator 8y agoAbsolutely. The same goes for portability: trying to write code that can run on any platform ever created or ever will be created is a futile effort. There are so many other things more important than that, and chances are if you do end up needing your code to run on a "weird" platform, the standard is the least of your concerns. The standard is merely a "lowest common denominator". Relevant Linus Torvalds quote: "There are competent people on standards bodies. But they aren't _always_ competent, and the translation of intent to English isn't always perfect either. So standards are not some kind of holy book that has to be revered. Standards too need to be questioned."
- saagarjha 8y ago> is anyone realistically compiling C code with the abstract C machine from the standard as their target There are a lot of people that try. The nasty issue I've seen with the C standard is that most things work even if you bend the rules, until they suddenly don't and deviate in a weird way when you least expect it. Say you were porting software like this to a different compiler/architecture: how happy would you be to have to track down that floating point operations were broken because the author made assumptions about where the code would be running?