Re: sim/arm/armos.c: IsTTY [PATCH]

Eli Zaretskii
2005-09-18T03:32:40Z

> Date: Sat, 17 Sep 2005 18:37:28 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: Richard Earnshaw <rearnsha@gcc.gnu.org>, gdb-patches@sources.redhat.com
>
> Usage Note: Don't use FILENAME_MAX as the size of an array in which
> to store a file name! You can't possibly make an array that big! Use
> dynamic allocation (see section 3.2 Allocating Storage For Program
> Data) instead.

That's a very strange advice, especially since there's gobs of code
out there that define arrays like that to store file names. What's
the value of FILENAME_MAX on those systems where a file name can have
unlimited length? Is it really larger than a typical stack
limitation?

> I'd recommend following Richard's suggestion: use PATH_MAX, if it's not
> there, default to 1K.

FWIW, I hate those arbitrary 1K definitions.