rrdtool1: fix compilation with GCC14
authorRosen Penev <rosenp@gmail.com>
Mon, 13 May 2024 03:21:01 +0000 (20:21 -0700)
committerRosen Penev <rosenp@gmail.com>
Tue, 14 May 2024 23:36:28 +0000 (16:36 -0700)
gnu standard is needed. Easier to remove the CFLAG.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
utils/rrdtool1/Makefile
utils/rrdtool1/patches/200-gcc14.patch [new file with mode: 0644]

index a3e4f6510f30595fd60abdfadaf94fef50a09a2f..5b9885633ba4ff1492177b6c03180f533d234e3f 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rrdtool1
 PKG_VERSION:=1.0.50
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/rrdtool-$(PKG_VERSION)
 PKG_SOURCE:=rrdtool-$(PKG_VERSION).tar.gz
@@ -86,7 +86,7 @@ $(call Package/rrdtool1/description/Default)
  This package contains command line tools used to manage RRDs.
 endef
 
-TARGET_CFLAGS += $(FPIC) --std=c99
+TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
        $(DISABLE_NLS) \
diff --git a/utils/rrdtool1/patches/200-gcc14.patch b/utils/rrdtool1/patches/200-gcc14.patch
new file mode 100644 (file)
index 0000000..ed60933
--- /dev/null
@@ -0,0 +1,57 @@
+--- a/src/rrd_cgi.c
++++ b/src/rrd_cgi.c
+@@ -4,8 +4,14 @@
+  * rrd_cgi.c  RRD Web Page Generator
+  *****************************************************************************/
++#ifndef _GNU_SOURCE
++#define _GNU_SOURCE
++#endif
++
+ #include "rrd_tool.h"
+ #include <cgi.h>
++#include <stdlib.h>
++#include <strings.h>
+ #include <time.h>
+@@ -345,7 +351,7 @@ int main(int argc, char *argv[]) {
+       if (!filter) {
+               printf ("Content-Type: text/html\n" 
+-                              "Content-Length: %d\n", 
++                              "Content-Length: %zd\n", 
+                               strlen(buffer));
+               if (labs(goodfor) > 0) {
+--- a/src/rrd_graph.c
++++ b/src/rrd_graph.c
+@@ -5,6 +5,10 @@
+  * rrd__graph.c  make creates ne rrds
+  ****************************************************************************/
++#ifndef _GNU_SOURCE
++#define _GNU_SOURCE
++#endif
++
+ #include "rrd_tool.h"
+ #ifdef WIN32
+@@ -2475,7 +2479,7 @@ copyImage(gdImagePtr gif, char *image, i
+       }
+       gdImageDestroy(img); 
+      }
+-     close(fi); 
++     fclose(fi); 
+    } else {
+      rrd_set_error("Error Opeing %s: %s",image,  strerror(errno));
+    }
+@@ -3308,7 +3312,7 @@ im.unit = 0; /* do not display unit if n
+       case GF_VRULE:
+           if(sscanf(
+               &argv[i][argstart],
+-              "%lu#%2x%2x%2x:%n",
++              "%ld#%2x%2x%2x:%n",
+               &im.gdes[im.gdes_c-1].xrule,
+               &col_red,
+               &col_green,