Article View: gnu.g++.bug
Article #2217Non-constant static sinitializer of struct
From: bothner
Date: Mon, 26 Feb 1990 22:10
Date: Mon, 26 Feb 1990 22:10
21 lines
965 bytes
965 bytes
The following doesn't work. It would seem to me it should.
G++ correctly compiles I and S3, but gives error messages
for S2 and S3. No code is emitted to initialize S2 or S3.
(I have g++-1.36.4, based on gcc-1.37.1, for the DECstation-3100,
with some additional patches that are unlikely to be
the cause of the problem.)
--Per Bothner
bothner@cs.wisc.edu Computer Science Dept, U. of Wisconsin-Madison
int F(int i)
{
return i + 10;
}
struct ab { int a; int b;};
int I = F(4);
ab S1 = (struct ab){3, F(5)};
ab S2 = {3, F(6)};
ab S3 = {3, 7};
Technical Details
Message-ID:
<9002262211.AA25445@sevenlayer.cs.wisc.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!CS.WISC.EDU!bothnerShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!CS.WISC.EDU!bothner From: bothner@CS.WISC.EDU Newsgroups: gnu.g++.bug Subject: Non-constant static sinitializer of struct Message-ID: <9002262211.AA25445@sevenlayer.cs.wisc.edu> Date: 26 Feb 90 22:10:59 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 21