public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Const correctness fixes for darwin-driver.c
@ 2017-01-03  5:37 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2017-01-03  5:37 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 243 bytes --]


The various darwin ports in config-list.mk fail to build with a trunk 
compiler due to two minor const-correctness issues.

With this patch installed all the darwin ports in config-list.mk build 
successfully.

Installed on the trunk.

Jeff


[-- Attachment #2: P --]
[-- Type: text/plain, Size: 1047 bytes --]

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 31aac2b..698277a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-02  Jeff Law  <law@redhat.com>
+
+	* config/darwin-driver.c (darwin_driver_init): Const-correctness
+	fixes for first_period and second_period variables.
+
 2017-01-02  Uros Bizjak  <ubizjak@gmail.com>
 
 	PR target/78967
diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c
index 0c4f0cd..e3ed79d 100644
--- a/gcc/config/darwin-driver.c
+++ b/gcc/config/darwin-driver.c
@@ -299,10 +299,10 @@ darwin_driver_init (unsigned int *decoded_options_count,
   if (vers_string != NULL)
     {
       char *asm_major = NULL;
-      char *first_period = strchr(vers_string, '.');
+      const char *first_period = strchr(vers_string, '.');
       if (first_period != NULL)
 	{
-	  char *second_period = strchr(first_period+1, '.');
+	  const char *second_period = strchr(first_period+1, '.');
 	  if (second_period  != NULL)
 	    asm_major = xstrndup (vers_string, second_period-vers_string);
 	  else

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-01-03  5:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-03  5:37 Const correctness fixes for darwin-driver.c Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).