This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: SCO OpenServer / UnixWare port update


You introduce a new arbitrary limit. If the current working directory
No, I really don't.

Right now, there is code in natFilePosix.cc that says:
   char buf2[MAXPATHLEN];

That code is obviously working for all platforms currently, because
no-one else is getting compile time failures for that file. Thus,
the code is currently limited to whatever MAXPATHLEN is defined as
on every other system out there, except mine. So this function is
"limited" already, on every other system.

The code is using a constant for its buffer. All my patch does is
say ... "if this constant, which appears to be defined for almost
everybody, isn't defined, set it to a reasonable default".

The reason why your approach of dynamically resizing a buffer is
wrong in this case, is there is also a member function initialized
to the same value. Simply doing a dynamic allocation for the
realpath() buffer will get rid of the one case, but not that one.
And that static member function *cant* check things dynamically,
becuase it has no current path to work from.

I could work around this problem by having fixincludes define
MAXPATHLEN, and then this problem wouldn't ever be seen. But I
prefer to make an informed decision to set MAXPATHLEN where it
is used (and leave it undefined) so that in the cases where I
*CAN* use a more flexible, dynamically-sizing approach, it
becomes obvious. This just isn't one of them.

Kean


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