public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39159]  New: unhelpful attribute warning on matching declaration after definition
@ 2009-02-11 23:50 sebor at roguewave dot com
  2009-02-12 17:02 ` [Bug c++/39159] " sebor at roguewave dot com
  0 siblings, 1 reply; 4+ messages in thread
From: sebor at roguewave dot com @ 2009-02-11 23:50 UTC (permalink / raw)
  To: gcc-bugs

gcc 4.3 issues a warning for the declaration of struct A below despite the
attribute on the declaration being consistent with that on the definition and
thus benign. While the warning is valuable in cases where the attributes
between the declaration and the definition do not match, it is not useful in
benign cases such as the one below. In these cases the warning makes applying
the attribute difficult in existing C++ libraries that rely heavily but not
completely on forward declarations and that also already make use of the Visual
C++ __declspec(dllexport) feature or the Sun C++ __global or __protected
specifiers, neither of which warns about such benign cases.

$ cat t.C && g++ -c t.C
struct __attribute__ ((visibility ("default"))) A { };
struct __attribute__ ((visibility ("default"))) A;
t.C:2: warning: type attributes ignored after type is already defined


-- 
           Summary: unhelpful attribute warning on matching declaration
                    after definition
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sebor at roguewave dot com


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


^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <bug-39159-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2014-08-16  3:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-11 23:50 [Bug c++/39159] New: unhelpful attribute warning on matching declaration after definition sebor at roguewave dot com
2009-02-12 17:02 ` [Bug c++/39159] " sebor at roguewave dot com
     [not found] <bug-39159-4@http.gcc.gnu.org/bugzilla/>
2014-08-15 22:55 ` jj at chaosbits dot net
2014-08-16  3:23 ` manu 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).