This is the mail archive of the gdb-patches@sourceware.org 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: [Patch] Fix build problem with system call in compile/compile.c


On Wed, 2015-01-07 at 08:13 +0400, Joel Brobecker wrote:
> > > 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,

I am not sure why we allow ourselves to ignore the return value.  Maybe
we shouldn't.  Chen Gang submitted a different patch where the return
value is checked.  Should we use that instead?

        https://sourceware.org/ml/gdb-patches/2015-01/msg00011.html


Steve Ellcey
sellcey@imgtec.com


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