This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

CPP warnings under DJGPP


Current code in cppfiles.c (read_with_read()) assumes that 
read() asked to read whole file at once would return the
size of file as a number of bytes read. However, if file
is opened as text under DJGPP and newline conversion takes
place, this is not true - read() returns smaller number.
This leads to harmless but confusing warnings 
'file.h is shorter than expected' everywhere.

read() can be made to behave as code expects under DJGPP by
passing additional flag O_BINARY to it:

  return open (filename, O_RDONLY|O_NOCTTY
#ifdef DJGPP
|O_BINARY
#endif
), 0666);

However, if other DOS-based platforms have different ways to
do this or GCC maintainers want a cleanier fix, another
solution is required?

Laurynas

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]