compile error with Clang 3.9
Brought to you by:
brama
Building mp3blaster 3.2.5 with Clang 3.9 fails with:
global.cc:374:8: error: cannot initialize a variable of type 'char *' with an rvalue of type 'const char *'
char *ext = strrchr(filename, '.');
^ ~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Suggested fix:
--- src/global.cc.orig 2016-09-12 14:29:38.335706000 -0400
+++ src/global.cc 2016-09-12 14:26:46.344490000 -0400
@@ -371,7 +371,7 @@
is_sid(const char *filename)
{
#ifdef HAVE_SIDPLAYER
- char *ext = strrchr(filename, '.');
+ const char *ext = strrchr(filename, '.');
if (ext) {
if (!strcasecmp(ext, ".psid")) return 1;
if (!strcasecmp(ext, ".sid")) return 1;
As an aside Clang 3.9 also produces many warnings of the form:
fileplayer.cc:188:16: warning: if statement has empty body [-Wempty-body]
if (init_args); //prevent warning
^
fileplayer.cc:188:16: note: put the semicolon on a separate line to silence this warning
This change is now committed to FreeBSD at https://svnweb.freebsd.org/changeset/ports/422453