All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Jim Rees <rees@umich.edu>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] Removed compilation warnings from mountd/cache.c
Date: Tue, 17 May 2011 10:00:51 -0400	[thread overview]
Message-ID: <4DD27F93.80201@RedHat.com> (raw)
In-Reply-To: <20110516192530.GB1680@fieldses.org>



On 05/16/2011 03:25 PM, J. Bruce Fields wrote:
> On Mon, May 16, 2011 at 03:18:11PM -0400, Jim Rees wrote:
>> J. Bruce Fields wrote:
>>
>>   On Mon, May 16, 2011 at 11:50:14AM -0400, Steve Dickson wrote:
>>   > Commit 5604b35a6 introduced a number of missing initializer
>>   > warnings that were missed. This patch removes those warnings.
>>   > 
>>   > Signed-off-by: Steve Dickson <steved@redhat.com>
>>   > ---
>>   >  utils/mountd/cache.c |    6 ++++--
>>   >  1 files changed, 4 insertions(+), 2 deletions(-)
>>   > 
>>   > diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
>>   > index df6b38f..86a2790 100644
>>   > --- a/utils/mountd/cache.c
>>   > +++ b/utils/mountd/cache.c
>>   > @@ -825,7 +825,6 @@ struct {
>>   >  	char *cache_name;
>>   >  	void (*cache_handle)(FILE *f);
>>   >  	FILE *f;
>>   > -	char vbuf[RPC_CHAN_BUF_SIZE];
>>   >  } cachelist[] = {
>>   >  	{ "auth.unix.ip", auth_unix_ip, NULL},
>>   >  	{ "auth.unix.gid", auth_unix_gid, NULL},
>>   > @@ -833,6 +832,9 @@ struct {
>>   >  	{ "nfsd.fh", nfsd_fh, NULL},
>>   >  	{ NULL, NULL, NULL }
>>   >  };
>>   > +struct vbs {
>>   > +	char vbuf[RPC_CHAN_BUF_SIZE];
>>   > +} vbufs [(sizeof(cachelist)/sizeof(cachelist[0])) - 1];
>>   
>>   Weird--why does that make a difference?  It's statically initialized
>>   memory either way, isn't it?
>>
>> The problem is the vbuf item was added to the struct but no initializer was
>> given for it.  It could also have been fixed by supplying the missing
>> initializer:
>>
>> 	{ "auth.unix.ip", auth_unix_ip, NULL, ""}, ...
> 
> Oh, OK.  Then could we do that, Steve, instead of moving the buffer
> to a separate structure?
Good point... I thought I tried added a "" and it warnings still 
appeared, which was the reason for the extra structure.... I guess
I was a bit confused... because by far adding  "" is a much better fix.... 

thanks!

steved.

      reply	other threads:[~2011-05-17 14:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-16 15:50 [PATCH] Removed compilation warnings from mountd/cache.c Steve Dickson
2011-05-16 17:29 ` J. Bruce Fields
2011-05-16 19:18   ` Jim Rees
2011-05-16 19:25     ` J. Bruce Fields
2011-05-17 14:00       ` Steve Dickson [this message]

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=4DD27F93.80201@RedHat.com \
    --to=steved@redhat.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=rees@umich.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.