This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Unfortunately still not satisfactory, I've been testing it against a few packages, and I notice excessive warnings with the use of __typeof (__error) that doesn't propagate the inline keyword.
For instance, a reduced use extracted from the glibc
extern __inline __attribute__ ((__always_inline__)) void error () {
}
extern void __error () { }
extern __typeof (__error) error __attribute__ ((weak, alias ("__error")));
emits an annoying warning on the error redefinition.
So, a check in addition of the DECL_DECLARED_INLINED_P is needed, TREE_ADDRESSABLE seems appropriate, since in the case of missing inline the function would be emitted. So I'm testing:
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (decl)) && !DECL_DECLARED_INLINE_P (decl) && TREE_ADDRESSABLE (decl))
other idea ? or should be just drop this warning ?
Hmm. Honza, any idea on the above? Christian, I suppose you could check if the cgraph node for that decl has the redefined_extern_inline flag set (checking TREE_ADDRESSABLE looks bogus to me). I'm not sure how the frontend merges those two decls - I suppose it will have a weak always-inline function with body :/
to the following code: --------------------------------- #include <stdlib.h>
char * realpath(path, resolved) const char *path; char *resolved; { ... return (NULL); } -------------------------------- preprocesses as:
char * realpath(path, resolved) const char *path; char *resolved; { return (((void *)0)); }
Richard.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |