Closed jsonn closed 10 years ago
r196372
For the reference, gcc 4.7.0 gives no warnings:
gcc -Wall -M a.h a.o: a.h
TO REPRODUCE:
cat << EOF > test.h
EOF
clang -Wall -M a.h
ACTUAL RESULT:
a.h:1:13: warning: unknown pragma ignored [-Wunknown-pragmas]
^
a.h:2:13: warning: unknown pragma ignored [-Wunknown-pragmas]
^
a.o: a.h 2 warnings generated.
EXPECTED RESULT:
No warnings
Have the same problem when using -M flag to generate dependencies:
$ clang -I. -I../include -Wall -fno-strict-aliasing -Wstrict-prototypes -Werror -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -O0 -DDEBUG -I/usr/include/libxml2 -fPIC -fvisibility=hidden -M uuid.c delta_read.c delta_sysfs.c balloon_util.c fsck_util.c ploop.c xml.c logger.c balloon.c lock.c fsutils.c gpt.c crc32.c merge.c util.c pcopy.c di.c cleanup.c > .depend In file included from uuid.c:28: In file included from ./ploop.h:11: ../include/libploop.h:21:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas]
^
../include/libploop.h:238:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas]
^
2 errors generated.
$ clang --version clang version 3.0 (tags/RELEASE_30/final) Target: x86_64-redhat-linux-gnu Thread model: posix
Extended Description
Create a file containing only:
_Pragma("GCC visibility push(default)")
and compile with "clang -MM test.c -Wall". Observe warnings about unknown pragma.