[PATCH] Silence a const vs non-const warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

This patch silences a const vs. non-const warning issued by very
recent GCC versions:

$ vax-linux-uclibc-gcc -v 2>&1 | grep version
gcc version 4.2.0 20060331 (experimental)

$ make CROSS_COMPILE=vax-linux-uclibc- ARCH=vax mopboot
[...]
  CC      lib/string.o
lib/string.c: In function 'memcpy':
lib/string.c:470: warning: initialization discards qualifiers from pointer target type
[...]

Signed-off-by: Jan-Benedict Glaw <[email protected]>

----

 string.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/string.c b/lib/string.c
index b3c28a3..dd2bfdd 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -467,7 +467,7 @@ EXPORT_SYMBOL(memset);
 void *memcpy(void *dest, const void *src, size_t count)
 {
 	char *tmp = dest;
-	char *s = src;
+	const char *s = src;
 
 	while (count--)
 		*tmp++ = *s++;
-- 
Jan-Benedict Glaw       [email protected]    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 für einen Freien Staat voll Freier Bürger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux