This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB 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: build/1097: gdb_realpath in gdb/utils.c cannot compile if HAVE_REALPATH is set


The following reply was made to PR build/1097; it has been noted by GNATS.

From: Daniel Jacobowitz <drow at mvista dot com>
To: sven dot c dot meyer at gmx dot de
Cc: gdb-gnats at sources dot redhat dot com
Subject: Re: build/1097: gdb_realpath in gdb/utils.c cannot compile if HAVE_REALPATH is set
Date: Wed, 26 Feb 2003 09:35:42 -0500

 On Wed, Feb 26, 2003 at 12:43:21PM -0000, sven dot c dot meyer at gmx dot de wrote:
 > 
 > >Number:         1097
 > >Category:       build
 > >Synopsis:       gdb_realpath in gdb/utils.c cannot compile if HAVE_REALPATH is set
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       medium
 > >Responsible:    unassigned
 > >State:          open
 > >Class:          mistaken
 > >Submitter-Id:   net
 > >Arrival-Date:   Wed Feb 26 12:48:01 UTC 2003
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     sven dot c dot meyer at gmx dot de
 > >Release:        gdb-5.3, in CVS at 26.02.2003
 > >Organization:
 > >Environment:
 > SCO OpenServer 5.0.6 (i386)
 > >Description:
 > Compiler (gcc 3.0.4) complains about parse error at end of
 > file gdb/util.c and claims to be in function gdb_realpath().
 > Actually, the compiler is right. The is a small type in
 > "Method 1", which is used when HAVE_REALPATH is defined:
 > 
 > ------------------------------------
 > char *
 > gdb_realpath (const char *filename)
 > {
 >   /* Method 1: The system has a compile time upper bound on a filename
 >      path.  Use that and realpath() to canonicalize the name.  This is
 >      the most common case.  Note that, if there isn't a compile time
 >      upper bound, you want to avoid realpath() at all costs.  */
 > #if defined(HAVE_REALPATH)
 >   {
 > # if defined (PATH_MAX)
 >     char buf[PATH_MAX];
 > #  define USE_REALPATH
 > # elif defined (MAXPATHLEN)
 >     char buf[MAXPATHLEN];
 > #  define USE_REALPATH
 > # endif
 > # if defined (USE_REALPATH)
 >     const char *rp = realpath (filename, buf);
 >     if (rp == NULL)
 >       rp = filename;
 >     return xstrdup (rp);
 >   }
 > # endif
 > #endif /* HAVE_REALPATH */:
 > ------------------------------------
 > 
 > The last closing brace "}" before the second last #endif 
 > has to be moved one line down.
 > >How-To-Repeat:
 > As a problem linked to preprocessing this file, it may be
 > reproduced by trying to recompile the source. 
 > >Fix:
 > please see description
 
 Thanks for the report!  I've fixed this in CVS.
 
 -- 
 Daniel Jacobowitz
 MontaVista Software                         Debian GNU/Linux Developer


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