public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/51677] New: don't suggest giving main() __attribute__((const))
@ 2011-12-25 15:38 b.r.longbons at gmail dot com
  2011-12-30  6:36 ` [Bug middle-end/51677] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: b.r.longbons at gmail dot com @ 2011-12-25 15:38 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51677
           Summary: don't suggest giving main() __attribute__((const))
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: b.r.longbons@gmail.com


With -O -Wsuggest-attribute=const, the following line will generate a warning:
int main() {}

This behavior is bad for 2 reasons:
1. Having an empty main() is quite useful for testing, as it allows linking to
succeed.
2. __attribute__((const)) is only meaningful when you can call the function.

Tested: 4.6.{0..2}, trunk r182496


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug middle-end/51677] don't suggest giving main() __attribute__((const))
  2011-12-25 15:38 [Bug c/51677] New: don't suggest giving main() __attribute__((const)) b.r.longbons at gmail dot com
@ 2011-12-30  6:36 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-12-30  6:36 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-12-30
          Component|c                           |middle-end
     Ever Confirmed|0                           |1
           Severity|normal                      |minor

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-30 06:34:55 UTC ---
Confirmed.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-30  6:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-25 15:38 [Bug c/51677] New: don't suggest giving main() __attribute__((const)) b.r.longbons at gmail dot com
2011-12-30  6:36 ` [Bug middle-end/51677] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).