- To: Grant Edwards <grant.b.edwards@xxxxxxxxx>
- Subject: Re: net/bsd_tcp code conditional on (__NetBSD__ || __OpenBSD__)
- From: Sergei Gavrikov <sergei.gavrikov@xxxxxxxxx>
- Date: Wed, 7 Mar 2012 22:49:00 +0300 (FET)
- Cc: ecos-discuss@xxxxxxxxxxxxxxxxxx
- Comment: DKIM? See http://www.dkim.org
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- In-reply-to: <jj877q$1nl$1@dough.gmane.org>
- User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Wed, 7 Mar 2012, Grant Edwards wrote:
> I'm still working on clean up compiler warnings generated by gcc 4.6,
> and all that's left is stuff under net/bsd_tcpip. There are variables
> that are set in code that's compiled unconditionally, but only
> referenced in code that's conditional on
>
> #if defined(__NetBSD__) || defined(__OpenBSD__)
Would it possible "hide" those variables by the same condition?
Oops, grep shows there are _too many_ such conditional checks. So, it
is hard job
> Does eCos ever build that code with either __NetBSD__ or __OpenBSD__
> defined?
and no way to test fixes then.
> If not, just removing the variables would seem to be cleaner than
> marking them with the "unused" attribute. [My guess is that the
> compiler generates the same code either way, but I haven't verified
> that.]
I would avoid removing those variables even they are referred from the
"died" blocks.
> However, removing the variables rather than marking them unused will
> probably mean a lot more work when it comes time to incorporate
> updates from upstream (which we all hope will happen someday when
> "somebody else" has time to work on it).
>
> So: remove or mark as "unused"?
And may be leave all such places (=warnings) *as is* by that reason you
pointed out? What's about to enter a temporary suppression using the
GCC diagnostic pragma for net/bcd_tcp code? (not tested, just an idea)
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html
Perhaps, that should be included with a check for GCC 4.X version.
So: remove, mark as "unused", or leave as is?
Sergei
> --
> Grant Edwards grant.b.edwards Yow! Jesus is my POSTMASTER
> at GENERAL ...
> gmail.com
>
>
> --
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
[Linux Embedded]
[U-Boot V2]
[Linux Kernel]
[Linux MIPS]
[Linux ARM]
[Linux for the Blind]
[Linux Resources]
[Photo]
[Yosemite]
[ISDN Cause Codes]
[ECOS Home]
[Site Home]