avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] -fpacked-struct compiler option


From: E. Weddington
Subject: Re: [avr-gcc-list] -fpacked-struct compiler option
Date: Thu, 06 Jan 2005 13:58:13 -0700
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

Anton Erasmus wrote:

Hi,

The makefile example that comes with WinAVR uses the -fpacked-struct compiler option.

The gcc documentation has the following warning on this option:
Warning: the -fpack-struct switch causes GCC to generate code that is not binary compatible with code generated without that switch. Additionally, it makes the code suboptimial. Use it to conform to a non-default application binary interface.

1. We don't have to worry much about "binary compatibility" as AVR projects are compiled into one image, i.e. no loading of external, 3rd party binary images.
2. AFAIK it is only suboptimal on targets that have alignments > 1.

So why is this option used in the example makefile. I would have thought that 
with the
avr being an 8-bit architecture that structures would automatically be packed, 
as there
is no advantage in accessing non-byte alligned data compared to accessing byte alligned data.

Um, perhaps just being paranoid? Seemed like a good thing to do at the time? It shouldn't hurt anything to have it in?
Anybody have any other reasoning they'd like to throw around? :-)

Eric


reply via email to

[Prev in Thread] Current Thread [Next in Thread]