This is the mail archive of the gcc-bugs@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]

Re: ../../gcc/cppfiles.c:823: size of array `intermed' has non-integer type


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


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