From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5778 invoked by alias); 18 Sep 2005 03:32:40 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5651 invoked by uid 22791); 18 Sep 2005 03:32:31 -0000 Received: from romy.inter.net.il (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 18 Sep 2005 03:32:31 +0000 Received: from HOME-C4E4A596F7 (IGLD-83-130-212-92.inter.net.il [83.130.212.92]) by romy.inter.net.il (MOS 3.5.8-GR) with ESMTP id CKM27555 (AUTH halo1); Sun, 18 Sep 2005 06:32:25 +0300 (IDT) Date: Sun, 18 Sep 2005 03:32:00 -0000 Message-Id: From: Eli Zaretskii To: Shaun Jackman , Richard Earnshaw CC: gdb-patches@sources.redhat.com In-reply-to: <20050917223728.GL8777@nevyn.them.org> (message from Daniel Jacobowitz on Sat, 17 Sep 2005 18:37:28 -0400) Subject: Re: sim/arm/armos.c: IsTTY [PATCH] Reply-to: Eli Zaretskii References: <7f45d9390508151204ca0b146@mail.gmail.com> <20050830023718.GB16189@nevyn.them.org> <7f45d93905090709516f912861@mail.gmail.com> <1126170388.18092.16.camel@pc960.cambridge.arm.com> <7f45d93905090910237c63acf0@mail.gmail.com> <20050917223728.GL8777@nevyn.them.org> X-SW-Source: 2005-09/txt/msg00153.txt.bz2 > Date: Sat, 17 Sep 2005 18:37:28 -0400 > From: Daniel Jacobowitz > Cc: Richard Earnshaw , 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.