[gccsdk] fgets problem/Unixlib
leenoar at sky.com
Wed Mar 5 12:06:57 PST 2014
On 04/03/14 11:05, david_m_gee wrote:
> On GCC 4.1.2/Unixlib, running on a Raspberry Pi, fgets() does not appear
> to work. It returns NULL when there is data in the file to read. It
> makes no difference whether the code is statically or dynamically
> linked, but the shared C library version works fine with exactly the
> same data file.
> See https://www.riscosopen.org/forum/forums/11/topics/2447 for further
I tried the test binaries, both dynamic and static, with RISC OS running
in rpcemu. They both worked as expected. When you say that there is an
infinite loop, do you get:
repeated over and over? I found that this occurred when the test file
was not found. For example, from the directory holding the binary and
failed with an infinite loop as above, but
This may explain why it works with the SharedCLibrary as it doesn't
use filename translation.
Perhaps you could alter the code to test the result of fopen to ensure
the file is in fact being found?
More information about the gcc