https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118005
--- Comment #2 from Alejandro Colomar <alx at kernel dot org> --- (In reply to Andrew Pinski from comment #1) > So noipa implies noinline. Hmmm, I thought it could be considered something like <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117853>, where you're showing an internal transformation. Although in this case it doesn't hurt, since users of noipa actually know that it implies noinline, so I guess it's okay-ish. > The diagnostic is correct and is wanted. > > On the question of using -Wattribute or it's own flag, I think we don't want > to do that. Since the fix is to remove inline keywords. Do you mean that I should never write a function is both inline and noipa? Please allow me to disagree. My actual code is something like the following: // <foo.h>: #if (FOO_INTERNAL) #define foo_inline inline #else #define foo_inline inline [[gnu::noipa]] #endif foo_inline int foo(void); inline int foo(void) { return 42; } // foo.c #define FOO_INTERNAL #include "foo.h" extern inline int foo(void);