E. Weddington wrote:
Wojtek Kaniewski wrote:
unfortunately it's only a gcc extension, so if anyone tries to
compile uisp with another compiled, it will probably throw an error.
#ifdef __GNUC__ would be nice. however if uisp is said to compile
only with gcc, this is not the case.
An alternative: instead of using the packed attribute, you can
compile the file with the -fpack-struct compiler switch, which should
do the same thing. However, the tradeoff is that you then have to
make sure that that flag gets included in the build structure, i.e.
makefile.
I tried that previously but it did not work. Just to be sure I tried
again. Here is what I did:
export CFLAGS=-fpack-struct
export CXXFLAGS=-fpack-struct
./configure
make
And here is the is the relevant compilation line. -fpack-struct is
present:
arm-linux-g++ -DHAVE_CONFIG_H -I. -I. -I. -Wall -Werror
-fpack-struct -c -o Stk500.o `test -f 'Stk500.C' || echo './'`Stk500.C
Still, the sizeof was 24 instead of 22. Maybe it does not work with C++?