public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Josef 'Jeff' Sipek" <jeffpc@josefsipek.net>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] fix spurious gcc warnings
Date: Fri, 21 Nov 2008 18:09:48 -0500	[thread overview]
Message-ID: <20081121230948.GZ4144@josefsipek.net> (raw)
In-Reply-To: <20081112114738.GC15216@infradead.org>

On Wed, Nov 12, 2008 at 06:47:38AM -0500, Christoph Hellwig wrote:
> Some recent gcc warnings don't like passing string variables to
> printf-like functions without using at least a "%s" format string.
> Chaneg the two occurances of that in xfs to please gcc.
> 
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> fs/xfs/linux-2.6/xfs_stats.c: In function "xfs_read_xfssta":
> fs/xfs/linux-2.6/xfs_stats.c:64: warning: format not a string literal and no format arguments
> fs/xfs/linux-2.6/xfs_super.c: In function "init_xfs_fs":
> fs/xfs/linux-2.6/xfs_super.c:1833: warning: format not a string literal and no format arguments
> 
> Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.c
> ===================================================================
> --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_stats.c	2008-11-12 11:12:49.000000000 +0100
> +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.c	2008-11-12 11:13:05.000000000 +0100
> @@ -61,7 +61,7 @@ xfs_read_xfsstats(
>  
>  	/* Loop over all stats groups */
>  	for (i=j=len = 0; i < ARRAY_SIZE(xstats); i++) {
> -		len += sprintf(buffer + len, xstats[i].desc);
> +		len += sprintf(buffer + len, "%s", xstats[i].desc);

Why not use strcpy here?

Josef 'Jeff' Sipek.

--
Real Programmers consider "what you see is what you get" to be just as bad a
concept in Text Editors as it is in women. No, the Real Programmer wants a
"you asked for it, you got it" text editor -- complicated, cryptic,
powerful, unforgiving, dangerous.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2008-11-21 23:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-12 11:47 [PATCH] fix spurious gcc warnings Christoph Hellwig
2008-11-21 18:05 ` Eric Sandeen
2008-11-21 23:09 ` Josef 'Jeff' Sipek [this message]
2008-11-21 23:12   ` Christoph Hellwig

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=20081121230948.GZ4144@josefsipek.net \
    --to=jeffpc@josefsipek.net \
    --cc=hch@infradead.org \
    --cc=xfs@oss.sgi.com \
    /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