This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Patch] Fix build problem with system call in compile/compile.c
- From: Steve Ellcey <sellcey at imgtec dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Tue, 6 Jan 2015 08:04:15 -0800
- Subject: Re: [Patch] Fix build problem with system call in compile/compile.c
- Authentication-results: sourceware.org; auth=none
- References: <c2ab3326-5227-43ff-a755-35cf75e209d8 at BAMAIL02 dot ba dot imgtec dot org> <20150106041615 dot GJ5445 at adacore dot com>
- Reply-to: <sellcey at imgtec dot com>
On Tue, 2015-01-06 at 08:16 +0400, Joel Brobecker wrote:
> > diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
> > index 1d18bd7..f9f03f1 100644
> > --- a/gdb/compile/compile.c
> > +++ b/gdb/compile/compile.c
> > @@ -169,10 +169,12 @@ do_rmdir (void *arg)
> > {
> > const char *dir = arg;
> > char *zap;
> > + int i;
> >
> > gdb_assert (strncmp (dir, TMP_PREFIX, strlen (TMP_PREFIX)) == 0);
> > zap = concat ("rm -rf ", dir, (char *) NULL);
> > - system (zap);
> > + /* GCC may generate warning if we ignore the return value of system call. */
> > + i = system (zap);
> > }
> >
> > /* Return the name of the temporary directory to use for .o files, and
>
> Does it work to cast the result of the call to system to (void)
> instead? In your case, I fear that you'd be exchanging one warning
> (return value being ignored) by another (value assigned but never
> used).
No, I tried using "(void) system (zap);" instead of "i = system (zap);"
and I still got the warning message.
I am going to respond on the "GDB 7.9 branching" email thread that I
think this bug is a blocking bug since it breaks the build on some
machines. I certainly think it needs to be addressed somehow before we
release the next GDB.
Steve Ellcey
sellcey@imgtec.com