This is ridiculous. Have you considered that there are only so many
resources for your goals and that switching tools might just not be an
option?
Do you really think that using broken tools is better than switching?
This obviously depends on the definition of broken, whether it simply
means "incorrect C" or "behaves faulty". In one case, you say "if it is
incorrect C, then it is incorrect C", duh. In the other case you say "if it
behaves correctly and is incorrect C, it behaves faulty". One statement is
obviously correct, the other obviously rubbish. Am I perhaps missing a
third definition of "broken"?
If my automobile is supposed to get water put into the cap marked
"radiator" but you really have to put it into the one marked "oil"
then something is amiss.
If the C standard says that a function should behave in a certain way,
but it does not, then that function is broken and you should send a
defect report to the compiler vendor.
So? Bugs happen. Testing helps against shipping broken code.
If you are using broken tools, tesing can be the cause of broken code.
What is it that
you do with the standard that helps you against shipping buggy programs?
That is the fundamental intention of the standard. A conforming C
compiler *has* to behave exactly as the standards document says. If
it does not behave in that way, then the compiler vendor must fix it
in a timely manner or they are negligent.
Dude, you don't get it: if the observable behaviour of a program is correct,
it eventually doesn't matter to e.g. a customer if this behaviour relies on
undefined behaviour or not.
Are you able to test every possible input? If a function has 8 bytes
of input, that is 2^64 different inputs. Are you willing to trust a
compiler vendor who is not able to follow an extremely well designed
specification?
In fact pretty many programs rely at least on
implementation-defined behaviour.
There is nothing wrong with that. Possibly 90% of the programs I
write rely on implementation defined behavior (or at least behavior
defined by another standard such as POSIX) at some point.
OTOH, if the behaviour is incorrect, it
similarly doesn't matter if it complies to any standard or not, you will
not be able to sell it.
Is it better to break your code so that it works according to a broken
compiler or to use a compiler that works?
This is reality, and I don't understand why you
keep arguing that.
I think that your attitude is something scary and is a reason why
there are so many serious problems in the software industry. If I
were a bridge builder and failed to follow standards I would go to
jail.
Whining about standard compliance doesn't help if you get fried. Your
real-world program must behave, even if it is compiled by real-world,
non-perfect tools. Using real-world, non-perfect tools to find errors is
the only choice we (i.e. the people living in the real world) have, the C
standard is not a tool that can be efficiently used to find errors, you can
only use it to distinguish between a bug in your program and in the
implementation, once you found it.
The C standard does not diagnose errors. It teaches you how to code
correctly. However, it is a terrible mistake to imagine that running
a mass of tools against a software base and using some sort of vote
system as to what is right is going to determine correctness.
I use real world tools to help find defects also. But those tools are
not what determines what is correct. They only determine what is
observed. To imagine that this is how to build software is an
indication that software engineering has a long way to go in some
places before it can produce reliable software. If the blueprint says
I should use a 12mm bolt, I should not use a 10mm bolt. And if the
blueprint says that the bolt should have 3 diamonds on its head, then
it should have 3 diamonds on its head. If the C standard says that
something is correct, then that is what is correct. If someone's tool
does something different than what the C standard says it should, that
tells you your tool is broken. Do you know what happens when you
build something out of broken components? You get a broken product.
If you do not know what the C standard says some part of a C program
should do, then it is a hole in your education that should be filled.
It is simply part of being a responsible programmer.
IMO-YMMV.