[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [patch #5822] Handle unused arguments
From: |
Jonathan Larmour |
Subject: |
[lwip-devel] [patch #5822] Handle unused arguments |
Date: |
Wed, 11 Apr 2007 22:21:23 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060513 Fedora/1.0.8-1.1.fc3.1.legacy Firefox/1.0.8 |
Follow-up Comment #11, patch #5822 (project lwip):
"-Wuninitialized -Winit-self" should do all the 'arg = arg' cases.
For 'if(arg);' Supposedly -Wextra warns when:
' An empty body occurs in an `if' or `else' statement.'
It also warns about a lot of other things too so may well be quite noisy. I
guess you can search in the compiler output for the specific warning message
that gets produced for that case.
BTW, I hadn't noticed this patch discussion before. Out of interest, in our
code we use the following which from experience on various compilers is more
portable at preventing warnings - some compilers are quite aggressive at
reporting them. It's slightly harder to apply retrospectively because you
need the type though:
#define CYG_UNUSED_PARAM( _type_, _name_ ) do { \
_type_ __tmp1 = (_name_); \
_type_ __tmp2 = __tmp1; \
__tmp1 = __tmp2; \
while(0)
I imagine it's not worth changing now you've already been through the code.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/patch/?5822>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/