<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - piglit-util.h:308:8: error: cannot initialize a variable of type 'char *' with an rvalue of type 'const char *'"
href="https://bugs.freedesktop.org/show_bug.cgi?id=103248#c4">Comment # 4</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - piglit-util.h:308:8: error: cannot initialize a variable of type 'char *' with an rvalue of type 'const char *'"
href="https://bugs.freedesktop.org/show_bug.cgi?id=103248">bug 103248</a>
from <span class="vcard"><a class="email" href="mailto:vlee@freedesktop.org" title="Vinson Lee <vlee@freedesktop.org>"> <span class="fn">Vinson Lee</span></a>
</span></b>
<pre>(In reply to Brian Paul from <a href="show_bug.cgi?id=103248#c3">comment #3</a>)
<span class="quote">> How about this?
>
> return (t == NULL) ? ((char *) s + strlen(s)) : (char *) t;</span >
Yes, the combined two changes fixes the build error for me.
diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index c4e7818088a7..3d2fd7e0c575 100644
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -305,9 +305,9 @@ strtol_hex(const char *nptr, char **endptr)
static inline char *
strchrnul(const char *s, int c)
{
- char *t = strchr(s, c);
+ const char *t = strchr(s, c);
- return (t == NULL) ? ((char *) s + strlen(s)) : t;
+ return (t == NULL) ? ((char *) s + strlen(s)) : (char *) t;
}
#endif</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>