Many aspects of the C Standard are rather "hand-wavy", and do not seriously attempt to unambiguously characterize every possible C program as being unambiguously strictly conforming or unambiguously not strictly conforming. Indeed, it's impossible to determine whether any particular source text is a strictly conforming C program based solely on the text.
Consider the program:
#include <stdio.h>
int main(void)
{
printf("1") + printf("2");
printf("\n");
return 0;
}
the above could be:
- A Strictly Conforming C Program to output an arbitrary multiple of 3.
- A non-portable program to output an arbitrary multiple of 4.
- A non-portable program to output an arbitrary multiple of 7.
- A Strictly Conforming but buggy program to output an arbitrary multiple of 8.
- A non-portable and buggy program to output an arbitrary multiple of 8.
If a program which is supposed to produce a particular image on on a display is specified as sending a certain sequence of characters to stdout, with whatever consequences result, then such a program could be strictly conforming even if the sequence of bytes was chosen because it will produce a particular image when run on a particular system. If the program which specified as producing that particular image outputs the same sequence of bytes, it would be a non-portable program to produce that particular image on a particular system.
A standard for things that are supposed to work together, such as plugs and sockets, would have separate specifications for plugs, sockets, plug testers, and socket testers, such that:
It would be impossible for any combination of plug and plug tester to exist, such that the plug would be rejected, unless either the plug or tester was unambiguously non-conforming.
It would be impossible for any combination of plug and plug tester to exist, such that the plug would be rejected, unless either the plug or tester was unambiguously non-conforming.
It would be impossible for any combination of plug, socket, plug tester, and socket tester to exist, such that the plug and socket pass their respective tests, but the plug wouldn't work with the socket, unless at least one of the testers was unambiguously non-conforming.
Note that there is no need to unambiguously partition the universe unambiguously into things that are conforming plugs and things that are not conforming plugs, nor likewise for sockets, plug testers, or socket testers. If there are some things that cannot be reliably classified as being conforming plugs or not being conforming plugs, but plug testers would unambiguously be required to accept them, the presence of ambiguity wouldn't pose a particular problem beyond increasing the cost of conformance. Good standard should seek to tolerate whatever level of ambiguity would be most practical, rather than trying to eliminate all ambiguity altogether.
The C Standard, unfortunately, tries to use one specification for everything, without either trying to eliminate ambiguity nor make any accommodations for it. Instead, the Standard falls back on a hand-waving reliance upon implementations to exercise common sense in deciding how to process constructs without regard for whether they are "technically" strictly conforming, thus avoiding any need for the Standard to unambiguously say whether they are or not.