This is the mail archive of the
mailing list for the GDB project.
Re: sim/arm/armos.c: IsTTY [PATCH]
> Date: Sat, 17 Sep 2005 18:37:28 -0400
> From: Daniel Jacobowitz <email@example.com>
> Cc: Richard Earnshaw <firstname.lastname@example.org>, email@example.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
> 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.