This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch commited] sh-linux: Fix a compile time warning


I've applied the attached sh-linux specific patch on mainline
to fix a compile time warning:

../../LOCAL/gcc/gcc/final.c: In function 'profile_function':
../../LOCAL/gcc/gcc/final.c:1448: warning: initialization discards qualifiers from pointer target type

Tested on sh4-unknown-linux-gnu.

2005-06-20  Kaz Kojima  <>

	config/sh/linux.h (FUNCTION_PROFILER): Constify a char*.

--- ORIG/gcc/gcc/config/sh/linux.h	2005-06-08 12:20:26.000000000 +0900
+++ LOCAL/gcc/gcc/config/sh/linux.h	2005-06-20 22:05:47.000000000 +0900
@@ -75,7 +75,7 @@ Boston, MA 02111-1307, USA.  */
 	fprintf (STREAM, "\tst.l\tr15,0,r18\n");			\
 	if (flag_pic)							\
 	  {								\
-	    char *gofs = "(datalabel _GLOBAL_OFFSET_TABLE_-(0f-.))";	\
+	    const char *gofs = "(datalabel _GLOBAL_OFFSET_TABLE_-(0f-.))"; \
 	    fprintf (STREAM, "\tmovi\t((%s>>16)&0xffff),r21\n", gofs);	\
 	    fprintf (STREAM, "\tshori\t(%s & 0xffff),r21\n", gofs);	\
 	    fprintf (STREAM, "0:\tptrel/u\tr21,tr0\n");			\

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]