[En-Nut-Discussion] Bugs in Uart.c

Bernard Fouché bernard.fouche at kuantic.com
Wed Mar 26 10:02:20 CET 2008


Moritz Struebe wrote:
>
> The Impact is bigger. Depending on your function it's also one more byte 
> that has to be pushed around and one more register which has to be 
> saved. Are there any disadvantages on other architectures using one byte 
> instead of two? Maybe use something like:
>
> enum boolean __attribute__  ((packed)) { // 
> http://www.delorie.com/gnu/docs/gcc/gcc_63.html
>     true = 1,
>     false = 0
> } ;
>
> With the packed attribute for 8bit uC?
>   

avr-gcc offers -fshort-enums. However the man page says: "Warning: the 
-fshort-enums switch causes GCC to generate code that is not binary 
compatible with code generated without that switch." So you have to 
compile NutUs AND your application code with that flag.

 Bernard



More information about the En-Nut-Discussion mailing list