🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2912

gcc 1.37 bug 900227_01

#2912
From: Ronald Guilmette
Date: Wed, 28 Feb 1990 08:06
22 lines
1194 bytes
/* gcc 1.37 bug 900227_01

   gcc allows short and char type global variables to be initialized with
   addresses of relocatable entities.

   Even if the ANSI C standard seems to permit this, I believe that GCC should
   not allow it.  I tried this code on 5 different machines and it failed on
   all five (unless I also use the GNU assembler and the GNU linker).  Three
   of the five (Sun3, Sun4, and Symmetry) got link-time errors about byte
   offset overflows.  The other two (368/SystemV and AViiON) got assembly
   time errors about relocatable names used in "constant" expressions.

   It is clearly of very little value to allows this, and since mysterious
   linker or assembler errors may ensue, gcc should *not* allow it.
*/

int main ();

short s = (short) &main;
char c = (char) &main;

int main () { return 0; }
Technical Details
Message-ID: <25EB8674.4961@paris.ics.uci.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!brutus.cs.uiuc.edu!jarthur!uci-ics!gateway

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!brutus.cs.uiuc.edu!jarthur!uci-ics!gateway
From: rfg@paris.ics.uci.edu (Ronald Guilmette)
Newsgroups: gnu.gcc.bug
Subject: gcc 1.37 bug 900227_01
Message-ID: <25EB8674.4961@paris.ics.uci.edu>
Date: 28 Feb 90 08:06:12 GMT
Organization: UC Irvine Department of ICS
Lines: 22