diff options
author | Adriaan de Groot <adridg@FreeBSD.org> | 2018-07-04 10:37:44 +0000 |
---|---|---|
committer | Adriaan de Groot <adridg@FreeBSD.org> | 2018-07-04 10:37:44 +0000 |
commit | 73e95cf6792087d501a1e72fa92b1688a7908be2 (patch) | |
tree | 85710f5ed9a6cf2f6b61daa06aacf0549787740a | |
parent | 3c554def99d86a082babe1980625c8841b5cf489 (diff) |
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
Notes
Notes:
svn path=/head/; revision=473876
-rw-r--r-- | www/srg/files/patch-include_UserReport.h | 13 | ||||
-rw-r--r-- | www/srg/files/patch-src_output.cc | 36 |
2 files changed, 49 insertions, 0 deletions
diff --git a/www/srg/files/patch-include_UserReport.h b/www/srg/files/patch-include_UserReport.h new file mode 100644 index 000000000000..8213a931ebcc --- /dev/null +++ b/www/srg/files/patch-include_UserReport.h @@ -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" diff --git a/www/srg/files/patch-src_output.cc b/www/srg/files/patch-src_output.cc new file mode 100644 index 000000000000..fe07bfaaed7f --- /dev/null +++ b/www/srg/files/patch-src_output.cc @@ -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); |