[En-Nut-Discussion] Portability of candemo.c

Harald Kipp harald.kipp at egnite.de
Fri Oct 12 16:57:00 CEST 2007


The following error appears when compiling app/canbus/candemo.c for 
arm7tdmi:

candemo.c: In function 'main':
candemo.c:135: error: 'int8_t' undeclared (first use in this function)
candemo.c:135: error: (Each undeclared identifier is reported only once
candemo.c:135: error: for each function it appears in.)
candemo.c:135: error: expected ';' before 'j'
candemo.c:138: error: 'j' undeclared (first use in this function)

I'm aware that the candemo currently works with AVR devices only. But it 
should be at least compile without errors.

The currently known type for int8_t should be char. However, as 
canFrame.len is an u_char, this would result in a sign conflict. Unless 
we have C99 compatible types, I suggest to use u_char. The best solution 
IMHO would be uint_fast8_t, but this is not yet available in all 
environments.

Harald




More information about the En-Nut-Discussion mailing list