🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Ronald Guilmette Wed, 28 Feb 1990 08:06
gcc 1.37 bug 900227_01
#2912
Author: 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; }
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads