🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52710

Problem with __attribute__((aligned(x)))

#52710
From: Daniel C. O'Connor
Date: Tue, 26 May 1992 08:37
39 lines
1743 bytes
Has anyone out there discovered a problem with the aligned attribute?

On a Solbourne 500/5E, running sunos4.1 and openwindows3, and gcc-2.1
with the following program:

void main ()
{

long long unsigned int temp1 __attribute__ ((aligned(16)));
long long unsigned int temp2 __attribute__ ((aligned(16)));

printf ("The address of temp1 is %08x\n",&temp1);
printf ("The address of temp2 is %08x\n",&temp2);
}

using the command "gcc -Wall -ansi -O foo.c.

I get the following output from running the program:

The address of temp1 is f7fffc58
The address of temp2 is f7fffc50


*** The usual alignment of a long long is 8, does gcc ignore the
    aligned attribute when it "knows" what the alignment of a 
    varible is? ***

Thanks for any and all help.

Regards,
Dan O'Connor
doconnor@apple.com

*************************************************************************
Yeah, I know I work for a "Look and Feel" bandit but I don't necessarily
agree with anything/everything that the Company does. 
--What an understatement--
-Change from within comes fast than change from with out.
*************************************************************************
Technical Details
Message-ID: <25668@goofy.Apple.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!apple!mumbo.apple.com!apple!apple!apple.com!doconnor

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,9d442fd4f2262ecf,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-05-26 09:42:42 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!apple!mumbo.apple.com!apple!apple!apple.com!doconnor
From: doconnor@apple.com (Daniel C. O'Connor)
Newsgroups: gnu.gcc.help
Subject: Problem with __attribute__((aligned(x)))
Message-ID: <25668@goofy.Apple.COM>
Date: 26 May 92 08:37:04 GMT
Sender: usenet@Apple.COM
Distribution: gnu
Organization: Apple Computer, Inc
Lines: 39