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: Zack Weinberg <zack at rabi dot columbia dot edu>
- Subject: Re: ../../gcc/cppfiles.c:823: size of array `intermed' has non-integer type
- From: Jeffrey A Law <law at hurl dot cygnus dot com>
- Date: Wed, 17 Mar 1999 21:18:53 -0700
- cc: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>, egcs-bugs at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199903171739.MAA12438@blastula.phys.columbia.edu>you write:
> Hmm... I suppose in theory we ought to do it like this:
>
> #ifdef _PC_PIPE_BUF
> #undef PIPE_BUF
> #define PIPE_BUF fpathconf (desc, _PC_PIPE_BUF)
> #else
> #ifndef PIPE_BUF
> #define PIPE_BUF 4096 /* sane default */
> #endif
> #endif
>
> The problem with this is PIPE_BUF is being used in an array
> declaration, so we need a constant. I don't think this is worth
> sweating over, the only thing this choice affects is performance, and
> it *should* be in the noise anyway. If we have horrible performance
> problems on systems like hpux9 we can revisit.
No, fpathconf may actually be a function call. If PIPE_BUF is used in an
array declaration, then we must be a compile-time constant.
Why not malloc the memory instead of having an array in static storage? That
would allow you to use fpathconf.
jeff