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: Joel Brobecker <brobecker at adacore dot com>
- To: Steve Ellcey <sellcey at imgtec dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 7 Jan 2015 08:13:51 +0400
- 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> <1420560255 dot 15691 dot 21 dot camel at ubuntu-sellcey>
> > 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.
In that case, I have no objection to your patch either, provided
a small comment is added to explain why we allow ourselves to ignore
the return value (and since you'll be touching that code anyways,
I would also rename your variable to something more explicit, such
as "ignored" or "unused" for instance).
Thank you,
--
Joel