This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
CPP warnings under DJGPP
- To: GNU Compiler <gcc at gcc dot gnu dot org>
- Subject: CPP warnings under DJGPP
- From: Laurynas Biveinis <lauras at softhome dot net>
- Date: Tue, 30 May 2000 20:39:09 +0300
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