leafsr / gcc-poison

gcc-poison
189 stars 18 forks source link

how could I remove the warnings generated by include files. #3

Open subh007 opened 10 years ago

subh007 commented 10 years ago

I included string.h and poison.h to my sample program and it results in warning :

In file included from example.c:3:
./poison.h:12:21: warning: poisoning existing macro
#       pragma GCC poison strcpy wcscpy stpcpy wcpcpy
                          ^
./poison.h:12:35: warning: poisoning existing macro
#       pragma GCC poison strcpy wcscpy stpcpy wcpcpy
                                        ^
./poison.h:15:21: warning: poisoning existing macro
#       pragma GCC poison strcat wcscat
                          ^
./poison.h:17:21: warning: poisoning existing macro
#       pragma GCC poison sprintf vsprintf vfprintf
                          ^
./poison.h:17:29: warning: poisoning existing macro
#       pragma GCC poison sprintf vsprintf vfprintf
                                  ^
./poison.h:19:21: warning: poisoning existing macro
#       pragma GCC poison strncpy wcsncpy
                          ^
example.c:7:3: error: attempt to use a poisoned identifier
  strcpy(a,b);
  ^
6 warnings and 1 error generated.

how can I remove the warnings from the include files ?

leafsr commented 10 years ago

What version of GCC are you using? Try -Wno-pragmas

subh007 commented 10 years ago

I am using Apple LLVM version 5.0. For clang -Wno-pragmas is unknown warning option. warning: unknown warning option '-Wno-pragmas' [-Wunknown-warning-option] I tried by supplying -Wunknown-warning-option but still getting same warnings.