🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #13543

sun cc

#13543
From: Bob Molyneaux
Date: Thu, 01 Feb 1990 19:32
21 lines
1286 bytes
I seem to have experienced a flaw in the C compiler for the Sun stations.
I have declared static variables at the top of a number of source files.
Some have identical names.  Those that do default to the declaration in
the source file which is compiled last.

example:
Consider 2 source files each with the following declaration at the top

static int tempvar;

One may accertain the address of the variable tempvar declared in file B.
When B is compiled last, any assignment of tempvar in file A is stored in
the address allocated in file B.  (ie. the two variables are but one.)

My local sysadmin tells me that the compiler may not handle static
variables properly and to try the gnu compiler.  Is this true!?

If this has been discussed before please forgive me as I am not a regular
reader of this group.  Some response would be appreciated.

Thanks in advance
Technical Details
Message-ID: <4662@brazos.Rice.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!rice!sun-spots-request
From: bobm@ee.rochester.edu (Bob Molyneaux)
Newsgroups: comp.sys.sun
Subject: sun cc
Keywords: SunOS
Message-ID: <4662@brazos.Rice.edu>
Date: 1 Feb 90 19:32:41 GMT
Sender: root@rice.edu
Organization: Sun-Spots
Lines: 21
Approved: Sun-Spots@rice.edu
X-Sun-Spots-Digest: Volume 9, Issue 22, message 15 of 16