C (or any) compilers deterministic performance -


whilst working on recent project, visited customer qa representitive, asked me question hadn't considered before:

how know compiler using generates machine code matches c code's functionality , compiler deterministic?

to question had absolutely no reply have taken compiler granted. takes in code , spews out machine code. how can go , test compiler isn't adding functionality haven't asked for? or more dangerously implementing code in different manner expect?

i aware perhapse not issue everyone, , indeed answer might be... "you're on barrel , deal it". however, when working in embedded environment, trust compiler implicitly. how can prove myself , qa right in doing so?

for safety critical embedded application certifying agencies require satisfy "proven-in-use" requirement compiler. there typically requirements (kind of "hours of operation") need met , proven detailed documentation. however, people either cannot or don't want meet these requirements because can difficult on first project new target/compiler.

one other approach not trust compiler's output @ all. compiler , language-dependent (appendix g of c-90 standard, anyone?) deficiencies need covered strict set of static analysis, unit- , coverage testing in addition later functional testing.

a standard misra-c can restrict input compiler "safe" subset of c language. approach restrict input compiler subset of language , test output entire subset is. if our application built of components subset assumed known output of compiler be. goes "qualification of compiler".

the goal of of able answer qa representative's question "we don't rely on determinism of compiler way prove it...".


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -