public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/58288] New: Incorrect error message on malformed section attribute syntax.
@ 2013-08-31 23:22 suckfish at ihug dot co.nz
  2013-08-31 23:55 ` [Bug c/58288] " suckfish at ihug dot co.nz
  2015-02-26 19:15 ` mpolacek at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: suckfish at ihug dot co.nz @ 2013-08-31 23:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58288
           Summary: Incorrect error message on malformed section attribute
                    syntax.
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: suckfish at ihug dot co.nz

If a section attribute is malformed, then the gcc error message incorrectly
claims that the "section attribute [is] not allowed".

For the example below, a section attribute is allowed, the actual cause of the
error is that the section name is not specified.

$ cat temp.c
int a __attribute__((section(x)));
$ gcc -m32 -c temp.c
temp.c:1:5: error: section attribute not allowed for ‘a’
 int a __attribute__((section(x)));
     ^

Happens both with gcc (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1) and with current
gcc trunk (rev 202134).
>From gcc-bugs-return-428758-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Aug 31 23:23:51 2013
Return-Path: <gcc-bugs-return-428758-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18326 invoked by alias); 31 Aug 2013 23:23:50 -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 18307 invoked by uid 48); 31 Aug 2013 23:23:48 -0000
From: "suckfish at ihug dot co.nz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/58288] Incorrect error message on malformed section attribute syntax.
Date: Sat, 31 Aug 2013 23:23: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.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: minor
X-Bugzilla-Who: suckfish at ihug dot co.nz
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58288-4-1BcnqHRkHv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58288-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58288-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: 2013-08/txt/msg01682.txt.bz2
Content-length: 195

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX288

--- Comment #1 from Ralph Loader <suckfish at ihug dot co.nz> ---
Whoops I meant "not specified *correctly*" rather than just "not specified".


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

* [Bug c/58288] Incorrect error message on malformed section attribute syntax.
  2013-08-31 23:22 [Bug c/58288] New: Incorrect error message on malformed section attribute syntax suckfish at ihug dot co.nz
@ 2013-08-31 23:55 ` suckfish at ihug dot co.nz
  2015-02-26 19:15 ` mpolacek at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: suckfish at ihug dot co.nz @ 2013-08-31 23:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Ralph Loader <suckfish at ihug dot co.nz> ---
Created attachment 30735
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30735&action=edit
Patch

Patch to change the error message attached.  I also noticed another problem: we
were setting the global variable user_defined_section_attribute for the
following:

int * foo(void) {
   static int a __attribute__((section("mysection")));
   return &a;
}

But looking at how user_defined_section_attribute is used (in bb-reorder.c), it
appears to apply to just the function, not the local variables.


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

* [Bug c/58288] Incorrect error message on malformed section attribute syntax.
  2013-08-31 23:22 [Bug c/58288] New: Incorrect error message on malformed section attribute syntax suckfish at ihug dot co.nz
  2013-08-31 23:55 ` [Bug c/58288] " suckfish at ihug dot co.nz
@ 2015-02-26 19:15 ` mpolacek at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-02-26 19:15 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Please post patches to gcc-patches mailing list.


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

end of thread, other threads:[~2015-02-26 18:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-31 23:22 [Bug c/58288] New: Incorrect error message on malformed section attribute syntax suckfish at ihug dot co.nz
2013-08-31 23:55 ` [Bug c/58288] " suckfish at ihug dot co.nz
2015-02-26 19:15 ` mpolacek 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).