[cfe-dev] [staticAnalyzer] abort() not recognized as 'noreturn' function

Дмитрий Дьяченко dimhen at gmail.com
Sun Aug 9 11:01:24 PDT 2009


Hello,

static checker rev.78534, Fedora 10/x86, release build  for a code
below produce incorrect diagnostique message.

scan-build gcc -c abort.c
abort.c:9:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
ANALYZE: abort.c foo
1 diagnostic generated.

#include <stdlib.h>

int foo(int x)
{
    if(x != 0)
	abort();
    if(x == 0)
	return 0;
}

Looks as checker does not recognize 'noreturn' for abort() function.
For 'exit()' checker emits similar message.

Is this a known problem? Or i miss something trivial?

Thanks,
Dmitry



More information about the cfe-dev mailing list