This is the mail archive of the gcc-bugs@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]

[Bug c/80515] __attribute__ ((__noreturn__)) false alarm for 'main'


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80515

--- Comment #4 from Paul Eggert <eggert at gnu dot org> ---
> main() has an implicit return 0.

That's irrelevant to the purpose of the warning. The warning is there to catch
the common typo of a function containing a return statement even though it is
declared 'noreturn'. But there is no typo here.

As it stands now, the 'main' function cannot have __attribute__
((__noreturn__)), even when 'main' is designed to never return. This
restriction makes no sense from the user's point of view.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]