[En-Nut-Discussion] Nut/OS finally moving to C99 types

Harald Kipp harald.kipp at egnite.de
Wed Apr 16 20:26:22 CEST 2008


Hi all,

For a very long time it was planned to replace all those BSD style types 
like u_char, u_short etc. by C99 types specified in stdint.h. One reason 
to delay this was the lack of C99 support by ICCAVR.

To solve this, there will be a new directory include/crt, which contains 
standard include files not provided by the compiler. The platform 
related Makedefs will add this path, if required by the specific 
compiler, currently ICC only.

Here's the contents of the new Makedefs.avr-icc7, which additionally has 
been modified to support backward compatibility with ICCAVR v6.

DEFS = -DATMEGA -D_MCU_$(MCU) -DCONST="" $(HWDEF)
INCPRE=-I
INCDIR = $(INCPRE)$(top_srcdir)/include/crt/iccavr 
$(INCPRE)$(top_srcdir)/include
CC  = iccavr
AR  = ilibw
CP  = cp
AS  = iccavr
CPFLAGS = $(INCFIRST) $(INCPRE). $(INCDIR) $(INCLAST) -Wf-const_is_flash 
-e $(DEFS) -l -Mavr_$(MCU)
LDFLAGS = -m -Wl,-Map=$(PROJ).map,--cref
ARFLAGS = -a
ASFLAGS = $(INCLAST) -e -l -g -Wa-W -Wa-n

Sorry for not discussing this in the list. It will be a radical change 
with modifications all over the code. I understand if you get upset, but 
calm down. So far, just a few places in the TCP stack had been changed 
and the BSD types will remain available. Only the internal Nut/OS code 
will move to the new types. However, if you feel that you have some code 
which should go into the official distribution, it is time now to hurry.

Despite my arbitrary act, feel free to post your comments, suggestions 
or even flames.

Harald

P.S.: I forgot to mention, why this is done: Types like int_fast8_t are 
most attractive when writing code for 8 and 32 bit targets. See
http://docs.hp.com/en/B2355-60130/stdint.5.html




More information about the En-Nut-Discussion mailing list