Content originally posted in LPCWare by jonper on Sat May 10 15:41:19 MST 2014
I get the same results on a Keil MCB4357, and also tried LPCXpresso Support's retarget.h workaround but it made no difference.
If the getc macro in Redlib's stdio.h and the __FILE_struct in sys/libconfig-arm.h are valid predictors of the library handling, then regardless of what READFUNC returns to the buffered IO code in Redlib, it seems it will be reverted to unsigned char before returning to the calling xxgetcxx as 0xFF.
If you search the forums for fsigned you will find that both GCC Arm and Redlib default to char being unsigned which appears to be the root problem, and that LPCXpresso Support is looking into this for a future release.
If it's imperative to have a simple ==EOF test for legacy code, company policy, or just aesthetics, you could look at Newlib as an alternate library. A quick test on the MCB4357 with your test code gave the all 0xFFFFFFFF (EOF) results expected with NewlibNano(nohost).
Good luck.