This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: ../../gcc/cppfiles.c:823: size of array `intermed' has non-integer type
- To: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Subject: Re: ../../gcc/cppfiles.c:823: size of array `intermed' has non-integer type
- From: Zack Weinberg <zack at rabi dot columbia dot edu>
- Date: Thu, 18 Mar 1999 12:30:34 -0500
- cc: egcs-bugs at egcs dot cygnus dot com
On Wed, 17 Mar 1999 13:06:15 -0500 (EST), "John David Anglin" wrote:
>In the case where _PC_PIPE_BUF is defined, you could waste some space
>with a "large" constant buffer size, and read either
>fpathconf (desc, _PC_PIPE_BUF) or a buffer full, whichever is smaller.
>Another way would be to dynamically allocate space for the buffer.
The stack usage of this function is already too big. I may switch to
a dynamically allocated buffer just to fix that.
Using fpathconf may be dangerous. The Solaris documentation sez:
6 If path or fildes refers to a pipe or FIFO, the value
returned applies to the pipe or FIFO. If path or
fildes refers to a directory, the value returned
applies to any FIFOs that exist or can be created
within the directory. If path or fildes refer to any
other type of file, the behavior is undefined.
In particular, we may get garbage if we call it on a regular file. I
have to think about this some more.
zw