[En-Nut-Discussion] Returning ints (was Missing possibility in the I2CBUS API)

Harald Kipp harald.kipp at egnite.de
Wed May 15 19:18:57 CEST 2013

Hi Ulrich,

On 15.05.2013 18:09, Ulrich Prinz wrote:
>> External C function never return less than an int. This is required,
>> because functions may be called without explicitly defining a prototype,
>> in which case an int is assumed.
> Using external C functions without proper header file and accepting
> compiler warnings is bad coding style and I do not like to support
> that in any way.

But the compiler supports the C standard, not your preferences.
Therefore the compiler cannot return smaller types than an int, even if
you declare a return value of int8_t.

> Who cares about AVR if you can use ARM with more power and memory for
> the same price...

AFAIK, the majority of Nut/OS implementations is running on 8 bit
targets. So Nut/OS developers should care.



More information about the En-Nut-Discussion mailing list