From: Mikael Pettersson <mikpe@csd.uu.se>
To: Pierre Ossman <drzeus-list@drzeus.cx>
Cc: zippel@linux-m68k.org, kbuild-devel@lists.sourceforge.net,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Pointer cast warnings in scripts/
Date: Tue, 21 Jun 2005 14:06:32 +0200 [thread overview]
Message-ID: <17080.712.146434.671656@alkaid.it.uu.se> (raw)
In-Reply-To: <42B7F740.6000807@drzeus.cx>
Pierre Ossman writes:
> GCC 4 checks the signedness of pointer casts and generates a whole bunch
> of warnings for code in scripts/ (which makes heavy use of signed char
> strings).
>
> This patch adds explicit casts.
This is way ugly. The _real_ bug is that someone decided to store
plain text pointers in "signed char*" variables. s/signed char/char/g
should be a much better fix.
> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
> Index: linux-wbsd/scripts/basic/fixdep.c
> ===================================================================
> --- linux-wbsd/scripts/basic/fixdep.c (revision 134)
> +++ linux-wbsd/scripts/basic/fixdep.c (working copy)
> @@ -242,7 +242,7 @@
> continue;
>
> found:
> - use_config(p+7, q-p-7);
> + use_config((char*)p+7, q-p-7);
> }
> }
>
> @@ -296,7 +296,7 @@
> signed char *p;
> char s[PATH_MAX];
>
> - p = strchr(m, ':');
> + p = (signed char*)strchr((char*)m, ':');
Clearly this is not the way to do text processing in C.
next prev parent reply other threads:[~2005-06-21 12:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-21 11:17 Pierre Ossman
2005-06-21 12:06 ` Mikael Pettersson [this message]
2005-06-21 12:18 ` Roman Zippel
2005-06-21 12:41 ` Pierre Ossman
2005-06-21 12:51 ` Roman Zippel
2005-06-21 12:59 ` Pierre Ossman
2005-06-21 13:14 ` Bernd Petrovitsch
2005-06-22 9:21 ` Pierre Ossman
2005-06-22 10:04 ` Bernd Petrovitsch
2005-06-22 11:12 ` Pierre Ossman
2005-06-22 11:25 ` Russell King
2005-06-21 13:20 ` Roman Zippel
2005-06-21 14:06 ` Pierre Ossman
2005-06-21 14:14 ` Roman Zippel
2005-06-21 21:31 ` J.A. Magallon
2005-06-21 14:19 ` J.A. Magallon
2005-06-21 13:25 ` Andreas Schwab
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=17080.712.146434.671656@alkaid.it.uu.se \
--to=mikpe@csd.uu.se \
--cc=drzeus-list@drzeus.cx \
--cc=kbuild-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=zippel@linux-m68k.org \
/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
all inboxes | Powered by JetHome®