public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/63853] [5.0 Regression] The use of strchrnul breaks bootstrap on x86_64-apple-darwin14.
Date: Thu, 13 Nov 2014 18:22:00 -0000	[thread overview]
Message-ID: <bug-63853-4-GxtuD3Bgr8@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-63853-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63853

--- Comment #9 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
I just completed a clean bootstrap of r217511 with the following patch

--- ../_clean/gcc/gcc.c    2014-11-13 15:29:00.000000000 +0100
+++ gcc/gcc.c    2014-11-13 17:59:47.000000000 +0100
@@ -3375,12 +3375,16 @@ handle_foffload_option (const char *arg)
   if (arg[0] == '-')
     return;

-  end = strchrnul (arg, '=');
+  end = strchr (arg, '=');
+  if (end == NULL)
+    end = strchr (arg, '\0');
   cur = arg;

   while (cur < end)
     {
-      next = strchrnul (cur, ',');
+      next = strchr (cur, ',');
+      if (next == NULL)
+    next = strchr (cur, '\0');
       next = (next > end) ? end : next;

       target = XNEWVEC (char, next - cur + 1);
@@ -3400,7 +3404,9 @@ handle_foffload_option (const char *arg)
       c = OFFLOAD_TARGETS;
       while (c)
     {
-      n = strchrnul (c, ',');
+      n = strchr (c, ',');
+      if (n == NULL)
+        n = strchr (c, '\0');

       if (strlen (target) == (size_t) (n - c)
           && strncmp (target, c, n - c) == 0)
@@ -3421,7 +3427,9 @@ handle_foffload_option (const char *arg)
       c = offload_targets;
       do
         {
-          n = strchrnul (c, ':');
+          n = strchr (c, ':');
+          if (n == NULL)
+        n = strchr (c, '\0');

           if (strlen (target) == (size_t) (n - c)
           && strncmp (c, target, n - c) == 0)
--- ../_clean/gcc/lto-wrapper.c    2014-11-13 15:29:00.000000000 +0100
+++ gcc/lto-wrapper.c    2014-11-13 17:54:48.000000000 +0100
@@ -424,7 +424,9 @@ parse_env_var (const char *str, char ***

   values = (char**) xmalloc (num * sizeof (char*));
   curval = str;
-  nextval = strchrnul (curval, ':');
+  nextval = strchr (curval, ':');
+  if (nextval == NULL)
+    nextval = strchr (curval, '\0');

   int append_len = append ? strlen (append) : 0;
   for (i = 0; i < num; i++)
@@ -436,7 +438,9 @@ parse_env_var (const char *str, char ***
       if (append)
     strcat (values[i], append);
       curval = nextval + 1;
-      nextval = strchrnul (curval, ':');
+      nextval = strchr (curval, ':');
+      if (nextval == NULL)
+    nextval = strchr (curval, '\0');
     }
   *pvalues = values;
   return num;
@@ -581,7 +585,9 @@ append_offload_options (obstack *argv_ob

       while (cur < opts)
         {
-          next = strchrnul (cur, ',');
+          next = strchr (cur, ',');
+          if (next == NULL)
+        next = strchr (cur, '\0');
           next = (next > opts) ? opts : next;

           if (strlen (target) == (size_t) (next - cur)


  parent reply	other threads:[~2014-11-13 18:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-63853-4@http.gcc.gnu.org/bugzilla/>
2014-11-13 17:04 ` iverbin at gmail dot com
2014-11-13 17:05 ` iains at gcc dot gnu.org
2014-11-13 17:07 ` iains at gcc dot gnu.org
2014-11-13 17:21 ` iverbin at gmail dot com
2014-11-13 17:47 ` dje at gcc dot gnu.org
2014-11-13 18:11 ` jakub at gcc dot gnu.org
2014-11-13 18:12 ` iains at gcc dot gnu.org
2014-11-13 18:22 ` dominiq at lps dot ens.fr [this message]
2014-11-13 18:42 ` schwab@linux-m68k.org
2014-11-13 18:57 ` jakub at gcc dot gnu.org
2014-11-13 22:07 ` iverbin at gcc dot gnu.org
2014-11-14 11:25 ` rguenth at gcc dot gnu.org
2014-11-14 11:42 ` dominiq at lps dot ens.fr
2014-11-14 11:49 ` iverbin at gmail dot com
2014-11-25 13:58 ` tocarip.intel at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-63853-4-GxtuD3Bgr8@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).