0

When I launch the value plugin of frama-c, I get many times the same warning :

/Users/philippeantoine/.opam/4.02.3/bin/frama-c -val myprog.c
In file included from /Users/philippeantoine/.opam/4.02.3/share/frama-c/libc/stdint.h:27:
/Users/philippeantoine/.opam/4.02.3/share/frama-c/libc/features.h:63:9: warning: '__nonnull' macro redefined [-Wmacro-redefined]

#define __nonnull(args...)
    ^
<built-in>:286:9: note: previous definition is here
#define __nonnull _Nonnull
    ^
1 warning generated.
/var/folders/rj/vl86bl2n6cgdjg7m7tszcvm40000gn/T/ppannot48d4bd.c:543:9: warning: '__nonnull' macro redefined [-Wmacro-redefined]
#define __nonnull(args...) 
    ^
/var/folders/rj/vl86bl2n6cgdjg7m7tszcvm40000gn/T/ppannot48d4bd.c:286:9: note: previous definition is here
#define __nonnull _Nonnull
    ^
1 warning generated.

Has anyone experience these before ? What is the best way to avoid these and see the meaningful warnings ?

I get this with the simple code :

#include <stdlib.h>
int main (){
    char * test = malloc(10);
    test[0] = 'a';
}
  • 2
    Could you please post the source code that causes this? It could be an issue with Frama-C's stdlib, some specific code pattern that triggers it, some GCC-ism, or something else... it should not happen normally. I suppose that gcc emits no warnings for the program you're analyzing? – anol Apr 19 '16 at 11:09
  • I added some simple code. Looks like a Frama-c stdlib oddity, or maybe a GCC-ism – Philippe Antoine Apr 22 '16 at 09:58
  • Yes, it seems to be caused by some mismatches between `share/libc/features.h` from the Frama-C stdlib and your system files. Frama-C is developed mainly on Linux, so sometimes Mac OSX-specific or BSD-specific issues are not property considered. In the short term, you could manually edit Frama-C's stdlib files to remove or conditionally define `__nonnull` (which is there mainly to allow Frama-C to parse more files, but it is ignored). In the long term, it may be worth filing a bug report, indicating your precise version of Mac OSX, which compiler you're using, etc. – anol Apr 22 '16 at 10:34
  • I modified features.h and no longer see warnings – Philippe Antoine Apr 22 '16 at 11:57

0 Answers0