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



  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


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