[En-Nut-Discussion] Yagarto from 23.12.2009 and newlib again...

Ulrich Prinz uprinz2 at netscape.net
Wed Feb 3 22:14:42 CET 2010


Ole Reinhardt schrieb:
> Hi!
> 
>> Ok, in building Nut/OS it is a bit different than in compiling user 
>> software. So here is the log from Nut/OS Configurator:
>>
>> cc1.exe: warnings being treated as errors
>> ../../nut/pro/httpopt.c: In function 'NutHttpURLEncode':
>> ../../nut/pro/httpopt.c:129: error: array subscript has type 'char'
>> ../../nut/pro/httpopt.c:140: error: array subscript has type 'char'
>> make[1]: *** [httpopt.o] Error 1
>> make: *** [all] Error 2
>> 13:38:45: ----- 'make all' failed with error 2 -----
> 
> Im still using Newlib 1.17.x, no problems there... Perhaps I'll build a
> new toolchain and try it with 1.18.0 again. Shure we shoudl try to fix
> these problems. isalnum expects an int instead of a char as it is able
> to accept EOF too (which is a int constant).
> 
> Just use a cast: isalnum((int)(*ptr1))
> 
I fixed the code by adding this typecast at every position causing the 
warning. But talking to Harald he did not like it in that way. But if 
the future newlib releases will insist on that cast, there is only that way.
> Have you fixed the code? Perhaps you could provide a patch? Does it
> still compiles with the older versions of newlib and with other
> toolchains (AVR for example)?
> 
For older versions of newlib I don't think there is a problem, but for 
AVR I have my doubts. It may compile without a remark but may produce 
code needing mor RAM.

I'll give it a try later today.

Best regards, Ulrich



More information about the En-Nut-Discussion mailing list