🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.nsc.32k
Article #118

Re: GNU C Pointer alignments compared to other ns32k compilers

#118
From: Avi Bloch
Date: Sun, 06 May 1990 08:16
30 lines
2173 bytes
In article <MEISSNER.90May2112857@curley.osf.org> meissner@osf.org (Michael Meissner) writes:
>Our kernel group recently noticed that by default, the native C
>compiler on Encore's Mach system aligns pointers on 4 byte boundaries
>(which is reasonable).  As far as I can tell, this compiler is
>originally produced by Greenhills.  The current sources of GNU C for
>the National 32k only aligns pointers to 2 byte boundaries.  Needless
>to say, this can cause things to go at the wrong address when building
>structures.  I was wondering if this were purely an Encore feature, a
>Greenhills feature, and what other ns32k compilers do.  If you run the
>following program, it will print 2 if your compiler does no padding,
>or pads to a 16-bit boundary, and it will print 4 if it pads to a
>32-bit boundary.  In particular, I would be interested in the non-4
>answers (since I already changed my version of the sources).

National's GNX C compiler by default aligns both pointer variables and
pointer structure members on 4 byte boundaries. However there exist
compilation switches which control these alignments. Note that you can
control separately the alignment within structures and the alignment of
variables since there are cases where the user's need of alignment in 
these 2 cases do not coincide. For more information see the GNX C compiler
manual or mail me and I'll be happy to answer any questions.

Avi Bloch
National Semiconductor (Israel)
avi%taux01@nsc
-- 
	Avi Bloch
National Semiconductor (Israel)
6 Maskit st. P.O.B. 3007, Herzlia 46104, Israel		Tel: (972) 52-522263
avi%taux01@nsc
Technical Details
Message-ID: <3773@taux01.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!sdd.hp.com!hplabs!nsc!taux01!avi
References: <MEISSNER.90May2112857@curley.osf.org>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!sdd.hp.com!hplabs!nsc!taux01!avi
From: avi@taux01.UUCP (Avi Bloch)
Newsgroups: comp.sys.nsc.32k,comp.sys.encore,comp.sys.sequent
Subject: Re: GNU C Pointer alignments compared to other ns32k compilers
Message-ID: <3773@taux01.UUCP>
Date: 6 May 90 08:16:26 GMT
References: <MEISSNER.90May2112857@curley.osf.org>
Reply-To: avi@taux01.UUCP (Avi Bloch)
Followup-To: comp.sys.nsc.32k
Distribution: comp
Organization: National Semiconductor (IC) Ltd, Israel
Lines: 30