Patchwork PATCH COMMITTED: Add const qualifier

login
register
mail settings
Submitter Ian Taylor
Date Oct. 5, 2010, 6:40 p.m.
Message ID <mcrlj6ccwk5.fsf@google.com>
Download mbox | patch
Permalink /patch/66852/
State New
Headers show

Comments

Ian Taylor - Oct. 5, 2010, 6:40 p.m.
In lto.c strchr is called with a const char * and the result is caught
in a char * variable.  That is fine in C but in C++ strchr is overloaded
and the result is const char *, which breaks the --enable-build-with-cxx
configure option.  In this case the variable might as well be const
cha r*, so I made that change.  Bootstrapped on x86_64-unknown-linux-gnu.
I did not run the testsuite.

Ian


2010-10-05  Ian Lance Taylor  <iant@google.com>

	* lto.c (lto_section_with_id): Make s a const pointer.

Patch

Index: lto.c
===================================================================
--- lto.c	(revision 164995)
+++ lto.c	(working copy)
@@ -431,7 +431,7 @@  lto_resolution_read (splay_tree file_ids
 static int 
 lto_section_with_id (const char *name, unsigned *id)
 {
-  char *s;
+  const char *s;
 
   if (strncmp (name, LTO_SECTION_NAME_PREFIX, strlen (LTO_SECTION_NAME_PREFIX)))
     return 0;