public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/8859: [CygWin] Initializer element allegedly not constant
@ 2003-04-07 13:52 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-04-07 13:52 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, mlt, nobody

Old Synopsis: [CygWin] internal error: Segmentation fault
New Synopsis: [CygWin] Initializer element allegedly not constant

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Mon Apr  7 13:52:42 2003
State-Changed-Why:
    Giovanni comfirmed this

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8859


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

* Re: c/8859: [CygWin] Initializer element allegedly not constant
@ 2003-04-07 21:56 Danny Smith
  0 siblings, 0 replies; 2+ messages in thread
From: Danny Smith @ 2003-04-07 21:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/8859; it has been noted by GNATS.

From: Danny Smith <dannysmith@clear.net.nz>
To: mlt@bredband.net, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
 nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org
Cc:  
Subject: Re: c/8859: [CygWin] Initializer element allegedly not constant
Date: Mon, 07 Apr 2003 22:49:35 +0100

 http://gcc.gnu.org/cgi-bin/gnatseb.pl?cmd=view%20audit-trail&database=gc
 c&pr=8859
 
 
 This is not a a regression, but  YA  "dllimport" expectation that the MS
 native compiler fulfills, but GCC does not.
 
 The dllimport attribute,  does this in config/i386/winnt.c
 (i386_pe_mark_dllimport):
 
 at line 343, config/i386/winnt.c:
 
   /* Can't treat a pointer to this as a constant address */
   DECL_NON_ADDR_CONST_P (decl) = 1;
 
 This is because:
 
 __attribute__((dllimport)) int foo;
 
 really means something like:
 
 extern int* _imp__foo;
 #define foo  *_imp__foo
 
 Because of this, the assignment error in the PR is actually valid: in C
 it is illegal
 to assign to non-constant at global scope. in C++  it works but requires
 dynamic
 global initialisation.
 
 Apparently, the native MS compiler ignores the the dllimport attribute
 in (some/all??) cases of assignment at global scope.
 
 Golly, I wonder if these MS rules are documented somewhere.
 I haven't found all the rules yet.
 
 
 Danny
 


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

end of thread, other threads:[~2003-04-07 21:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-07 13:52 c/8859: [CygWin] Initializer element allegedly not constant bangerth
2003-04-07 21:56 Danny Smith

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