Date: Wed, 4 Jul 2018 10:37:44 +0000 (UTC) From: Adriaan de Groot <adridg@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r473876 - head/www/srg/files Message-ID: <201807041037.w64AbiA0015843@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adridg Date: Wed Jul 4 10:37:44 2018 New Revision: 473876 URL: https://svnweb.freebsd.org/changeset/ports/473876 Log: www/srg Fix build with Clang6 output.cc:101:22: error: cannot initialize an array element of type 'char *' with an rvalue of type 'char' The patches explain the changes. In short, weird types and weird initializations, normal for 2013-ish. Reported by: linimon Added: head/www/srg/files/ head/www/srg/files/patch-include_UserReport.h (contents, props changed) head/www/srg/files/patch-src_output.cc (contents, props changed) Added: head/www/srg/files/patch-include_UserReport.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/srg/files/patch-include_UserReport.h Wed Jul 4 10:37:44 2018 (r473876) @@ -0,0 +1,13 @@ +Fix Clang6 warning, mismatched guard defines + +--- include/UserReport.h.orig 2018-07-04 10:30:57 UTC ++++ include/UserReport.h +@@ -26,7 +26,7 @@ + */ + + #ifndef USERREPORT_H +-#define USREREPORT_H ++#define USERREPORT_H + + #include "srg.h" + #include "Report.h" Added: head/www/srg/files/patch-src_output.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/srg/files/patch-src_output.cc Wed Jul 4 10:37:44 2018 (r473876) @@ -0,0 +1,36 @@ +Fix with Clang6: + + - Weird type for buffer for fread() + - Initialization of base through another buffer + +--- src/output.cc.orig 2018-07-04 10:31:59 UTC ++++ src/output.cc +@@ -98,7 +98,7 @@ void init_file(const char *filename) + + /* Copy data */ + while (!feof(source)) { +- char *buf[4096] = {'\0'}; ++ char buf[4096] = {'\0'}; + int c = fread((void *)&buf[0], 1, 4096, source); + fwrite((void *)&buf[0], 1, c, dest); + } +@@ -118,7 +118,8 @@ void html_header(FILE *outfile, const char *rootpath) + * file will reside in to the top level output directory. This string + * is only used if srg.outputURL is not set + */ +- char *base=""; ++ static char _base[]=""; ++ char *base=_base; + + if (strlen(srg.outputURL)==0 && strlen(rootpath)>0) { + base = strdup(rootpath); +@@ -173,7 +174,8 @@ void html_footer(FILE *outfile, const char *rootpath) + * file will reside in to the top level output directory. This string + * is only used if srg.outputURL is not set + */ +- char *base=""; ++ static char _base[] = ""; ++ char *base=_base; + + if (strlen(srg.outputURL)==0 && strlen(rootpath)>0) + base = strdup(rootpath);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807041037.w64AbiA0015843>