I can suppress this warning easy enough, but I'm perplexed why I get it. Below I show a simple recipe to generate this warning and the only thing I'm changing is the location of an include file. Is this a bug or expected behavior? If an attribute is not supported I don't understand how the location of the file has anything to do with it.
First, here's my system stats.
joe@joe99:/tmp> uname -a
Linux joe99 3.7.10-1.16-desktop #1 SMP PREEMPT Fri May 31 20:21:23 UTC 2013 (97c14ba) x86_64 x86_64 x86_64 GNU/Linux
joe@joe99:/tmp> icc --version
icc (ICC) 14.0.2 20140120
Copyright (C) 1985-2014 Intel Corporation. All rights reserved.
joe@joe99:/tmp> gcc --version
gcc (SUSE Linux) 4.7.2 20130108 [gcc-4_7-branch revision 195012]
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Now generate a trivial piece of code.
joe@joe99:/tmp> echo "#include <string.h>"> tst.c
Compile normally and note where exactly the header files come from.
joe@joe99:/tmp> icc -H -c tst.c
. /usr/include/string.h
.. /usr/include/features.h
... /usr/include/stdc-predef.h
... /usr/include/sys/cdefs.h
.... /usr/include/bits/wordsize.h
... /usr/include/gnu/stubs.h
.... /usr/include/gnu/stubs-64.h
.. /usr/lib64/gcc/x86_64-suse-linux/4.7/include/stddef.h
.. /usr/include/xlocale.h
.. /usr/include/bits/string.h
.. /usr/include/bits/string2.h
Use the EXACT same header files, but include from a different directory. Why is this any different than before???
joe@joe99:/tmp> cp /usr/include/string.h .
joe@joe99:/tmp> icc -I . -H -c tst.c
. ./string.h
.. /usr/include/features.h
... /usr/include/stdc-predef.h
... /usr/include/sys/cdefs.h
.... /usr/include/bits/wordsize.h
... /usr/include/gnu/stubs.h
.... /usr/include/gnu/stubs-64.h
.. /usr/lib64/gcc/x86_64-suse-linux/4.7/include/stddef.h
In file included from tst.c(1):
./string.h(43): warning #1292: unknown attribute "__leaf__"
size_t __n) __THROW __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(47): warning #1292: unknown attribute "__leaf__"
__THROW __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(56): warning #1292: unknown attribute "__leaf__"
__THROW __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(62): warning #1292: unknown attribute "__leaf__"
extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
^In file included from tst.c(1):
./string.h(66): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(93): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1));
^In file included from tst.c(1):
./string.h(126): warning #1292: unknown attribute "__leaf__"
__THROW __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(130): warning #1292: unknown attribute "__leaf__"
__THROW __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(134): warning #1292: unknown attribute "__leaf__"
__THROW __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(137): warning #1292: unknown attribute "__leaf__"
size_t __n) __THROW __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(141): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(144): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(148): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(152): warning #1292: unknown attribute "__leaf__"
__THROW __nonnull ((2));
^.. /usr/include/xlocale.h
In file included from tst.c(1):
./string.h(163): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1, 2, 3));
^In file included from tst.c(1):
./string.h(166): warning #1292: unknown attribute "__leaf__"
__locale_t __l) __THROW __nonnull ((2, 4));
^In file included from tst.c(1):
./string.h(173): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_malloc__ __nonnull ((1));
^In file included from tst.c(1):
./string.h(181): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_malloc__ __nonnull ((1));
^In file included from tst.c(1):
./string.h(233): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1));
^In file included from tst.c(1):
./string.h(260): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1));
^In file included from tst.c(1):
./string.h(282): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(286): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(312): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(339): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(345): warning #1292: unknown attribute "__leaf__"
__THROW __nonnull ((2));
^In file included from tst.c(1):
./string.h(353): warning #1292: unknown attribute "__leaf__"
__THROW __nonnull ((2, 3));
^In file included from tst.c(1):
./string.h(357): warning #1292: unknown attribute "__leaf__"
__THROW __nonnull ((2, 3));
^In file included from tst.c(1):
./string.h(396): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1));
^In file included from tst.c(1):
./string.h(403): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1));
^In file included from tst.c(1):
./string.h(409): warning #1292: unknown attribute "__leaf__"
extern char *strerror (int __errnum) __THROW;
^In file included from tst.c(1):
./string.h(423): warning #1292: unknown attribute "__leaf__"
extern int __REDIRECT_NTH (strerror_r,
^In file included from tst.c(1):
./string.h(441): warning #1292: unknown attribute "__leaf__"
extern char *strerror_l (int __errnum, __locale_t __l) __THROW;
^In file included from tst.c(1):
./string.h(447): warning #1292: unknown attribute "__leaf__"
extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1));
^In file included from tst.c(1):
./string.h(452): warning #1292: unknown attribute "__leaf__"
__THROW __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(455): warning #1292: unknown attribute "__leaf__"
extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
^In file included from tst.c(1):
./string.h(459): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(486): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1));
^In file included from tst.c(1):
./string.h(514): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1));
^In file included from tst.c(1):
./string.h(519): warning #1292: unknown attribute "__leaf__"
extern int ffs (int __i) __THROW __attribute__ ((__const__));
^In file included from tst.c(1):
./string.h(533): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(537): warning #1292: unknown attribute "__leaf__"
__THROW __attribute_pure__ __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(557): warning #1292: unknown attribute "__leaf__"
__THROW __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(562): warning #1292: unknown attribute "__leaf__"
extern char *strsignal (int __sig) __THROW;
^In file included from tst.c(1):
./string.h(566): warning #1292: unknown attribute "__leaf__"
__THROW __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(568): warning #1292: unknown attribute "__leaf__"
__THROW __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(574): warning #1292: unknown attribute "__leaf__"
__THROW __nonnull ((1, 2));
^In file included from tst.c(1):
./string.h(577): warning #1292: unknown attribute "__leaf__"
__THROW __nonnull ((1, 2));
^.. /usr/include/bits/string.h
.. /usr/include/bits/string2.h