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/>]
* [Bug c++/39159] unhelpful attribute warning on matching declaration after definition
[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
1 sibling, 0 replies; 4+ messages in thread
From: jj at chaosbits dot net @ 2014-08-15 22:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39159
Jesper Juhl <jj at chaosbits dot net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jj at chaosbits dot net
--- Comment #2 from Jesper Juhl <jj at chaosbits dot net> ---
I've run into this as well with GCC 4.8.2 - it's rather annoying.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/39159] unhelpful attribute warning on matching declaration after definition
[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
1 sibling, 0 replies; 4+ messages in thread
From: manu at gcc dot gnu.org @ 2014-08-16 3:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39159
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-08-16
CC| |manu at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Confirmed.
Perhaps it is not hard to fix. Just look how it is handled for functions.
Probably it is at the same place as this:
void __attribute__ ((visibility ("default"))) foo () { }
void __attribute__ ((visibility ("hidden"))) foo ();
pr39159.C:4:49: warning: ‘void foo()’: visibility attribute ignored because it
conflicts with previous declaration [-Wattributes]
void __attribute__ ((visibility ("default"))) foo () { }
^
pr39159.C:4:49: note: previous declaration of ‘void foo()’
and see if you can implement the same thing for types, probably at the point
where the " type attributes ignored" warning is given.
>From gcc-bugs-return-458624-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Aug 16 07:59:05 2014
Return-Path: <gcc-bugs-return-458624-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 32101 invoked by alias); 16 Aug 2014 07:59:04 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 32072 invoked by uid 48); 16 Aug 2014 07:59:00 -0000
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/57466] [DR 1584] Argument deduction fails for 'const T*' when T is function type
Date: Sat, 16 Aug 2014 07:59:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.7.3
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: paolo.carlini at oracle dot com
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: paolo.carlini at oracle dot com
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status assigned_to
Message-ID: <bug-57466-4-pOV5BbNm0L@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57466-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57466-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-08/txt/msg01121.txt.bz2
Content-length: 485
https://gcc.gnu.org/bugzilla/show_bug.cgi?idW466
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |paolo.carlini at oracle dot com
--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Still working on this.
^ permalink raw reply [flat|nested] 4+ messages in thread
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).