This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] getc/putc -Wunused-value warnings in source.c
- From: Tom Tromey <tromey at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 07 May 2013 08:33:29 -0600
- Subject: Re: [RFC] getc/putc -Wunused-value warnings in source.c
- References: <1367926842-22398-1-git-send-email-brobecker at adacore dot com>
>>>>> "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