[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: |
Carsten Beth |
Subject: |
Re: [avr-gcc-list] enum with 8 bit encoding |
Date: |
Thu, 18 Apr 2002 21:06:17 +0200 |
Hallo Dean!
Thank you for the suggestions, but they don't have any influence on the
generated code. Maybe the shortest size for the constants are ints?!
Dean Ferreyra wrote:
> 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));
Greetings
Carsten
avr-gcc-list at http://avr1.org