public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mark at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/41091]  New: Using section attribute in c and c++ function causes section type conflict
Date: Mon, 17 Aug 2009 13:58:00 -0000	[thread overview]
Message-ID: <bug-41091-3639@http.gcc.gnu.org/bugzilla/> (raw)

The following code that puts two static variables into their own section won't
compile because of a section type conflict.

class C
{
public:
  void m()
  {
    static const int TWO __attribute__((section(".consts"))) = 2;
  }
}; 

static void c()
{
  static const int ONE __attribute__((section(".consts"))) = 1;
}

int
main (int argc, char **argv)
{
  C inst = C();
  inst.m();
  c();
  return 0;
}

$ g++ section.cxx 
section.cxx:12: error: ONE causes a section type conflict

The section should have the same type in both definitions, but apparently
doesn't.


-- 
           Summary: Using section attribute in c and c++ function causes
                    section type conflict
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mark at gcc dot gnu dot org


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


             reply	other threads:[~2009-08-17 13:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 13:58 mark at gcc dot gnu dot org [this message]
2009-10-14  4:50 ` [Bug c++/41091] " pinskia at gcc dot gnu dot org
2009-10-14  7:48 ` mark at gcc dot gnu dot org
2009-10-17 11:28 ` mark at gcc dot gnu dot org
2010-08-11 23:52 ` roland at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-41091-3639@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).