[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] enum with 8 bit encoding
From: |
Dean Ferreyra |
Subject: |
RE: [avr-gcc-list] enum with 8 bit encoding |
Date: |
Mon, 15 Apr 2002 00:00:25 -0700 |
Carsten,
> Is it possible to force avr-gcc to use only 8 bit constants to code
> eenumeration types?
Two ways that I know of:
1. The command-line option -fshort-enums.
2. The packed attribute, as in:
typedef enum
{
set_state = 's',
send_eeprom = 'm',
change_eeprom = 'l',
send_det = 'd',
synchonization = 'r',
end_of_block = 'e'
} t_symbol __attribute__ ((packed));
As an aside that may help: I download the GCC Manual
(http://www.gnu.org/software/gcc/onlinedocs/) in PostScript and convert it
to a PDF for easy viewing and, more importantly, searching. It has most of
the answers!
Dean
avr-gcc-list at http://avr1.org