PATCH COMMITTED: Add const qualifier

Message ID
State New
Headers show

Commit Message

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.


2010-10-05  Ian Lance Taylor  <>

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


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;