linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Arnaud Lacombe <lacombar@gmail.com>,
	Sam Ravnborg <sam@ravnborg.org>
Subject: Re: linux-next: build warning after merge of the kbuild tree
Date: Thu, 30 Sep 2010 22:25:07 +0200	[thread overview]
Message-ID: <20100930202507.GC25629@sepie.suse.cz> (raw)
In-Reply-To: <20100930105025.c46e2fe0.sfr@canb.auug.org.au>

On Thu, Sep 30, 2010 at 10:50:25AM +1000, Stephen Rothwell wrote:
> Hi Michal,
> 
> After merging the kbuild tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
> 
> scripts/kconfig/kxgettext.c: In function 'menu_build_message_list':
> scripts/kconfig/kxgettext.c:175: warning: passing argument 3 of 'message__add' discards qualifiers from pointer target type
> scripts/kconfig/kxgettext.c:148: note: expected 'char *' but argument is of type 'const char * const'
> scripts/kconfig/kxgettext.c:180: warning: passing argument 3 of 'message__add' discards qualifiers from pointer target type
> scripts/kconfig/kxgettext.c:148: note: expected 'char *' but argument is of type 'const char * const'

Thanks, fixed with


From: Michal Marek <mmarek@suse.cz>
Subject: kconfig: Propagate const

Commit 2e7a091 made struct file->name a const char*, but forgot to
constify all users of it.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 scripts/kconfig/kxgettext.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c
index dcc3fcc..e9d8e79 100644
--- a/scripts/kconfig/kxgettext.c
+++ b/scripts/kconfig/kxgettext.c
@@ -63,11 +63,11 @@ next:
 
 struct file_line {
 	struct file_line *next;
-	char*		 file;
-	int		 lineno;
+	const char *file;
+	int lineno;
 };
 
-static struct file_line *file_line__new(char *file, int lineno)
+static struct file_line *file_line__new(const char *file, int lineno)
 {
 	struct file_line *self = malloc(sizeof(*self));
 
@@ -90,7 +90,8 @@ struct message {
 
 static struct message *message__list;
 
-static struct message *message__new(const char *msg, char *option, char *file, int lineno)
+static struct message *message__new(const char *msg, char *option,
+				    const char *file, int lineno)
 {
 	struct message *self = malloc(sizeof(*self));
 
@@ -130,7 +131,8 @@ static struct message *mesage__find(const char *msg)
 	return m;
 }
 
-static int message__add_file_line(struct message *self, char *file, int lineno)
+static int message__add_file_line(struct message *self, const char *file,
+				  int lineno)
 {
 	int rc = -1;
 	struct file_line *fl = file_line__new(file, lineno);
@@ -145,7 +147,8 @@ out:
 	return rc;
 }
 
-static int message__add(const char *msg, char *option, char *file, int lineno)
+static int message__add(const char *msg, char *option, const char *file,
+			int lineno)
 {
 	int rc = 0;
 	char bf[16384];
-- 
1.7.1

  reply	other threads:[~2010-09-30 20:25 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-30  0:50 linux-next: build warning after merge of the kbuild tree Stephen Rothwell
2010-09-30 20:25 ` Michal Marek [this message]
2010-09-30  0:52 Stephen Rothwell
2010-09-30 20:24 ` Michal Marek
2010-12-23  0:00 Stephen Rothwell
2011-05-02  2:18 Stephen Rothwell
2011-05-02  2:24 ` Dave Jones
2011-05-02  3:45   ` Stephen Rothwell
2011-05-02  4:02     ` Dave Jones
2011-05-02  4:44       ` Stephen Rothwell
2011-05-02  4:24     ` Stephen Rothwell
2011-05-02  4:36       ` Dave Jones
2011-05-02  5:57         ` Stephen Rothwell
2011-05-02  4:53       ` Stephen Rothwell
2011-05-02 11:13         ` Michal Marek
2011-05-02 15:17           ` Valdis.Kletnieks
2011-05-02 15:31             ` Michal Marek
2016-11-30 23:06 Stephen Rothwell
2016-12-01  2:00 ` Nicholas Piggin
2017-12-10 22:52 Stephen Rothwell
2017-12-11  0:22 ` Masahiro Yamada
2017-12-11 16:11   ` Bart Van Assche
2020-12-09  9:30 Stephen Rothwell
2020-12-09 13:01 ` Dominique Martinet
2020-12-09 20:56   ` Stephen Rothwell
2020-12-10  6:47     ` Dominique Martinet
2020-12-14 20:44 ` Stephen Rothwell
2020-12-20 22:10 Stephen Rothwell
2021-08-19 23:28 Stephen Rothwell
2021-08-23  0:25 ` Masahiro Yamada
2023-08-28  4:57 Stephen Rothwell
2023-08-28 17:28 ` Nick Desaulniers
2023-10-03 23:13 Stephen Rothwell

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=20100930202507.GC25629@sepie.suse.cz \
    --to=mmarek@suse.cz \
    --cc=lacombar@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=sfr@canb.auug.org.au \
    /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).