[cfe-dev] Clang Analysis of several open source projects.

David Chisnall theraven at sucs.org
Fri May 13 11:03:38 PDT 2011


On 13 May 2011, at 18:33, Kaelyn Uhrain wrote:

> Once I added the declaration "void fatal() __attribute__ ((noreturn));", clang's static analyzer no longer complained that x might be uninitialized.  I haven't looked into the code, but I suspect that either the analyzer isn't propagating the noreturn function attribute properly (in cases where the only return path in a function hits a call to another function marked as noreturn) or possibly that the attribute is missing in a key spot within a header.

The analyser won't propagate it (because it doesn't do [much] interprocedural analysis yet), but it would probably make a good candidate for a hint - if a function has no return paths, suggest marking it as not returning - this will help the optimiser.  Suggesting adding const, no-capture attributes, and so on to function arguments would also be a nice idea.

David

--
This email complies with ISO 3103



More information about the cfe-dev mailing list