From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Randy Dunlap <randy.dunlap@oracle.com>,
Stephen Rothwell <sfr@canb.auug.org.au>,
linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
linux-nfs@vger.kernel.org
Subject: Re: [PATCH -next] nfs: fix ISO C90 warning
Date: Wed, 16 Dec 2009 18:01:37 -0500 [thread overview]
Message-ID: <1261004497.13878.9.camel@localhost> (raw)
In-Reply-To: <alpine.LFD.2.00.0912162355350.2755@localhost.localdomain>
On Wed, 2009-12-16 at 23:58 +0100, Thomas Gleixner wrote:
> On Wed, 16 Dec 2009, Randy Dunlap wrote:
> > On Wed, 16 Dec 2009 17:40:19 -0500 Trond Myklebust wrote:
> >
> > > On Wed, 2009-12-16 at 14:23 -0800, Randy Dunlap wrote:
> > > > From: Randy Dunlap <randy.dunlap@oracle.com>
> > > >
> > > > Fix gcc ISO C90 warning:
> > > >
> > > > fs/nfs/callback.c:356: warning: ISO C90 forbids mixed declarations and code
> > > >
> > > > Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> > > > ---
> > > > fs/nfs/callback.c | 2 +-
> > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > --- linux-next-20091215.orig/fs/nfs/callback.c
> > > > +++ linux-next-20091215/fs/nfs/callback.c
> > > > @@ -352,8 +352,8 @@ static int check_gss_callback_principal(
> > > > static int nfs_callback_authenticate(struct svc_rqst *rqstp)
> > > > {
> > > > struct nfs_client *clp;
> > > > - RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
> > > > int ret = SVC_OK;
> > > > + RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
> > > >
> > >
> > > What version of gcc is giving rise to this warning?
> >
> > > gcc --version
> > gcc (GCC) 4.2.1 (SUSE Linux)
> >
> > > RPC_IFDEBUG is a macro that either evaluates to its argument, or to
> > > nothing, depending on whether or not RPC_DEBUG is defined or not. In
> > > neither case should it evaluate to anything illegal under C90 rules
> > > afaics.
> >
> > Yep. Odd warning.
>
> Not really. If the debug macro evaluates to nothing then you have:
>
> struct nfs_client *clp;
> ;
> int ret = SVC_OK;
>
> So you have a stray semicolon, which is interpreted as an empty code
> line. That qualifies for the mixed declaration and code case :)
>
> I know it's nitpicking, but ...
Ah... I see what you mean.
So really what we should do is just move that semicolon inside the
macro. That would change the !RPC_DEBUG case to
struct nfs_client *clp;
int ret = SVC_OK;
which is 100% legal...
Cheers
Trond
next prev parent reply other threads:[~2009-12-16 23:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-15 5:53 linux-next: Tree for December 15 Stephen Rothwell
[not found] ` <20091215165309.58e98eea.sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
2009-12-16 22:23 ` [PATCH -next] nfs: fix ISO C90 warning Randy Dunlap
2009-12-16 22:40 ` Trond Myklebust
2009-12-16 22:47 ` Randy Dunlap
2009-12-16 22:58 ` Thomas Gleixner
2009-12-16 23:01 ` Trond Myklebust [this message]
2009-12-17 10:00 ` Américo Wang
[not found] ` <2375c9f90912170200m12a5310cg90343c5c1081fbb8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-12-17 21:58 ` Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1261004497.13878.9.camel@localhost \
--to=trond.myklebust@fys.uio.no \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=randy.dunlap@oracle.com \
--cc=sfr@canb.auug.org.au \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).