Ian said:
Well I still support a couple of embedded projects and I can't remember
the last time I did any debugging on the targets. Everything is
developed and unit tested on the host, even the acceptance test suite
can run against both the target and the host simulation.
In most cases this is a recipe for disaster.
Only the most perfect emulators can REALLY
reproduce 100% of the features of the target, either
because it is too slow/too fast for the same real
time conditions, either because the simulated input stream
doesn't correspond with the actual input stream 100%,
and a thousand of other reasons.
The emulator is never the REAL THING, it is a an emulator!
Of course all this depends on the specific machine being used
For some applications an emulator can be OK, probably.
It's no where near that bad. Yes there is a performance penalty, but
this can be mitigated by only applying the full set of checks to
selected parts of the application.
OK. Then you would agree with me that this feature
#pragma STDC_BOUNDS_CHECK(ON)
would be much better since it wouldn't be constrained
to just dbx...
But they are not required everywhere. On many embedded targets, there
simply would not be space for the extra code.
Maybe, maybe not, it depends. In any case nobody is advocating making
it mandatory.
The real problem behind this is the difficulty of the standard library
since if you store the meta data with the object, the object layout
changes slightly and all library routines not compiled with bounds
checking will not work.
That is why a standard procedure would much better.
It would be possible to build compatible libraries.