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

Alejandro Colomar <foss+...@alejandro-colomar.es> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |foss+gcc@alejandro-colomar.
                   |                            |es

--- Comment #6 from Alejandro Colomar <foss+...@alejandro-colomar.es> ---
(In reply to Eric Gallager from comment #5)
> (In reply to Eric Gallager from comment #4)
> > (In reply to Martin Sebor from comment #3)
> > > It should be easy to white-list the main function in the
> > > -Wsuggest-attribute= checker.  At the same time, I'm not sure it's 
> > > necessary
> > > or that the problem is unique to main.  The reasons noted in comment #0
> > > apply to other functions as well.  Defining empty functions is useful for 
> > > a
> > > variety of reasons (e.g., default no-op handlers or, in C++, default no-op
> > > implementations of virtual functions).  Similarly, without perfect data 
> > > flow
> > > analysis across the whole program it's impossible to tell whether an 
> > > extern
> > > function is ever called.  Why should main be treated differently from 
> > > those?
> > 
> > Because it's an easy first step that doesn't require doing all of those
> > extra data flow analyses
> 
> Also main() is already treated specially for -Wmain

+1

Also, I think attributes are not legal in main(); are they?  The suggestion is
misleading.

Reply via email to