On Mon, Oct 7, 2024 at 12:02 AM Дилян Палаузов <dilyan.palau...@aegee.org> wrote: > > Hello, > > https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsuggest-attribute_003d > says for -Wsuggest-attribute=noreturn: > > > The compiler only warns for functions visible in other compilation units. > > Why? clang -Wmissing-noreturn does warn even for static functions.
The reasoning is since static functions can only be called from the local TU; adding the attribute won't change anything but for non-local functions it can help other TUs so putting it on the declaration rather than the definition of the function. Thanks, Andrew Pinski > > Greetings > Дилян