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: [RFC] getc/putc -Wunused-value warnings in source.c


>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel> One could easily work around the problem by using fgetc instead of
Joel> getc, as done in this patch.

I think this approach is fine.

I wouldn't even bother with the comment about AIX.  My reasoning is that
those comments always wind up being stale, and nobody is ever really
sure when they can be removed.  On the other hand, if someone changes
this back, or adds a new use of getc, then there are two cases: (1)
there are regular AIX builds, so someone notices soon and fixes the
problem; or (2) nobody is building on AIX, nobody notices, and the code
is fine as-is.

That said, if you wanted to #undef getc in defs.h, then a comment there
would probably be more appropriate.  The difference for me is that in
that case there is a bit of odd code that could potentially be removed
at some future date -- unlike the s/putc/fputc/ change, which I doubt
anybody would have a reason to ever revert.

Tom


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