[Background: on some systems, malloc() can return a non-NULL pointer
that eventually fails in some way because of "overcommitment".]
In my experience lazy allocators and overcommitment of virtual memory
are relatively common OS features. [various positive aspects snipped]
I don't offhand see anything in the standard that makes an implementation
which relies on a lazy allocator non-conforming.
Here, by "relies on" I suspect you mean "uses".
We should, I think, note that these systems may (and do) allow
programs to start up with large data arrays, then cause accesses
in those arrays to fail in the same way that the non-NULL malloc()
return value fails.
In other words:
#include <stdio.h>
#define SIZE 32767 /* for now */
char mem[SIZE];
...
int main(void) {
printf("got here\n");
fflush(stdout);
mem[number_less_than_SIZE()] = 42;
printf("done\n");
return 0;
}
can, when run on such a system, fail after printing "got here" and
before "done". Such failures are more *likely* with malloc()
because "real world" programs on such systems tend to allocate much
more space via malloc(), of course -- but the same "lazy allocation"
and overcommittment that make it possible to have enormous three
dimensional arrays (e.g., REAL A(10000,10000,10000) in Fortran --
this array typically needs just under 4 terabytes of RAM, i.e.,
not at all out of line on 64-bit machines) that are only sparsely
used at runtime will cause problems for programs that actually use
every array element (unless, of course, you have 4 terabytes of
swap space -- also hardly out of line these days, since a terabyte
of disk space costs less than $1000).
... Program failure due to overcommitment of virtual
memory strikes me as not essentially different from program failure due
to any other external cause, such as hardware failure or forcible
termination by the OS. The possibility of those failures doesn't
render an implementation non-conforming.
It's arguably a QOI issue, but I for one would vote in favor of the
lazy allocator in many cases.
I would say it is definitely tied to quality-of-implementation, and
that it should work by default under any sort of "strict ANSI mode".
At the same time, as with many compilers, the default might well be
"non-strict non-ANSI mode".