public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/41091]  New: Using section attribute in c and c++ function causes section type conflict
@ 2009-08-17 13:58 mark at gcc dot gnu dot org
  2009-10-14  4:50 ` [Bug c++/41091] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: mark at gcc dot gnu dot org @ 2009-08-17 13:58 UTC (permalink / raw)
  To: gcc-bugs

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


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

end of thread, other threads:[~2024-05-21 16:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-41091-4@http.gcc.gnu.org/bugzilla/>
2021-02-02 18:09 ` [Bug c++/41091] Using section attribute in c and c++ function causes section type conflict equinox-gccbugs at diac24 dot net
2022-05-18 16:38 ` boreynol at microsoft dot com
2022-05-18 17:03 ` pinskia at gcc dot gnu.org
2024-05-21 16:09 ` paul_robinson at playstation dot sony.com
2009-08-17 13:58 [Bug c++/41091] New: " mark at gcc dot gnu dot org
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

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).