Experimental Physics and Industrial Control System
Dalesio, Leo wrote:
Is there a compiler switch on the GNU compiler to turn off the RISC byte alignment?
Define the specific structure you want with the gcc-specific syntax
__attribute__((packed). You do that like this:
struct foo {
char a;
short b __attribute__((packed));
int c __attribute__((packed));
};
I think you can also put the attribute on the structure itself (after the
closing {}) to pack all fields together.
Variable attributes in gcc are described here:
http://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html
HTH,
- Andrew
--
Dear God, I didn't think orange went with purple until I saw
the sunset you made last night. That was really cool. - Caro
- References:
- Compiler switches on RISC byte alignment Dalesio, Leo
- Navigate by Date:
- Prev:
Compiler switches on RISC byte alignment Dalesio, Leo
- Next:
RE: I see the light (with epics) Lawrence T. Hoff
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
<2004>
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
- Navigate by Thread:
- Prev:
Compiler switches on RISC byte alignment Dalesio, Leo
- Next:
RE: Compiler switches on RISC byte alignment Fairley, Diane
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
<2004>
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025