Open sudipm-mukherjee opened 1 month ago
I have added the following change, not sure if that is correct.
diff --git a/src/parser/snprintf.c b/src/parser/snprintf.c
index 0e5283947..68e93ba78 100644
--- a/src/parser/snprintf.c
+++ b/src/parser/snprintf.c
@@ -43,9 +43,11 @@
#include <string.h>
#include <ctype.h>
#include <errno.h>
+#include <math.h>
#include "pool_parser.h"
#include "stringinfo.h"
#include "utils/palloc.h"
+#include "postgresql/16/server/postgres_fe.h"
/*
* We used to use the platform's NL_ARGMAX here, but that's a bad idea,
and building with make CFLAGS='-DHAVE_STRCHRNUL'
the previous errors are fixed. But now it fails with:
wd_json_data.c: In function 'get_watchdog_node_from_json':
wd_json_data.c:540:66: error: passing argument 3 of 'json_get_long_value_for_key' from incompatible pointer type [-Wincompatible-pointer-types]
540 | if (json_get_long_value_for_key(root, "StartupTimeSecs", &wdNode->startup_time.tv_sec))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| __time64_t * {aka long long int *}
In file included from wd_json_data.c:28:
../../src/include/utils/json.h:316:97: note: expected 'long int *' but argument is of type '__time64_t *' {aka 'long long int *'}
316 | int json_get_long_value_for_key(json_value * source, const char *key, long *value);
|
I must mention this is with gcc-14.
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/arm-linux-gnueabihf/14/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 14.2.0-1ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-14/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2,rust --prefix=/usr --with-gcc-major-version-only --program-suffix=-14 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv7-a+fp --with-float=hard --with-mode=thumb --disable-werror --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.2.0 (Ubuntu 14.2.0-1ubuntu1)
I tried to build v4.5.2 on an armhf system. Its trying to build the replacement snprintf and failing.
This are the build errors:
This is the output from
./configure
.I will be happy to provide more logs or test any patch if needed.