Changeset: dd786555f32b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/dd786555f32b
Modified Files:
        clients/mapiclient/mclient.c
        clients/mapilib/mapi.c
        configure.ag
        gdk/gdk.h
        gdk/gdk_aggr.c
        sql/server/Makefile.ag
Branch: Nov2019
Log Message:

Get this to compile on Fedora 36.


diffs (162 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -916,7 +916,7 @@ EXPANDEDrenderer(MapiHdl hdl)
                                data = nullstring;
                        do {
                                edata = utf8skip(data, ~(size_t)0);
-                               mnstr_printf(toConsole, "%-*s | %.*s\n", 
fieldw, name, (int) (edata - data), data);
+                               mnstr_printf(toConsole, "%-*s | %.*s\n", 
fieldw, name, (int) (edata - data), data ? data : "");
                                name = "";
                                data = edata;
                                if (*data)
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -961,15 +961,15 @@ static ATOMIC_FLAG mapi_initialized = AT
                        return (e);                                     \
                }                                                       \
        } while (0)
-#define REALLOC(p, c)                                          \
-       do {                                                    \
-               if (p) {                                        \
-                       void *tmp = (p);                        \
-                       (p) = realloc((p), (c) * sizeof(*(p))); \
-                       if ((p) == NULL)                        \
-                               free(tmp);                      \
-               } else                                          \
-                       (p) = malloc((c) * sizeof(*(p)));       \
+#define REALLOC(p, c)                                                  \
+       do {                                                            \
+               if (p) {                                                \
+                       void *tmp = realloc((p), (c) * sizeof(*(p)));   \
+                       if (tmp == NULL)                                \
+                               free(p);                                \
+                       (p) = tmp;                                      \
+               } else                                                  \
+                       (p) = malloc((c) * sizeof(*(p)));               \
        } while (0)
 
 /*
@@ -3324,11 +3324,11 @@ mapi_prepare(Mapi mid, const char *cmd)
        do {                                                    \
                /* note: k==strlen(hdl->query) */               \
                if (k+len >= lim) {                             \
-                       char *q = hdl->query;                   \
                        lim = k + len + MAPIBLKSIZE;            \
-                       hdl->query = realloc(hdl->query, lim);  \
-                       if (hdl->query == NULL) {               \
-                               free(q);                        \
+                       char *q = realloc(hdl->query, lim);     \
+                       if (q == NULL) {                        \
+                               free(hdl->query);               \
+                               hdl->query = NULL;              \
                                return;                         \
                        }                                       \
                        hdl->query = q;                         \
@@ -3465,11 +3465,11 @@ mapi_param_store(MapiHdl hdl)
                                val = mapi_quote(buf, 1);
                                /* note: k==strlen(hdl->query) */
                                if (k + strlen(val) + 3 >= lim) {
-                                       char *q = hdl->query;
                                        lim = k + strlen(val) + 3 + MAPIBLKSIZE;
-                                       hdl->query = realloc(hdl->query, lim);
-                                       if (hdl->query == NULL) {
-                                               free(q);
+                                       char *q = realloc(hdl->query, lim);
+                                       if (q == NULL) {
+                                               free(hdl->query);
+                                               hdl->query = NULL;
                                                free(val);
                                                return;
                                        }
@@ -3482,11 +3482,11 @@ mapi_param_store(MapiHdl hdl)
                                val = mapi_quote((char *) src, 
hdl->params[i].sizeptr ? *hdl->params[i].sizeptr : -1);
                                /* note: k==strlen(hdl->query) */
                                if (k + strlen(val) + 3 >= lim) {
-                                       char *q = hdl->query;
                                        lim = k + strlen(val) + 3 + MAPIBLKSIZE;
-                                       hdl->query = realloc(hdl->query, lim);
-                                       if (hdl->query == NULL) {
-                                               free(q);
+                                       char *q = realloc(hdl->query, lim);
+                                       if (q == NULL) {
+                                               free(hdl->query);
+                                               hdl->query = NULL;
                                                free(val);
                                                return;
                                        }
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2629,6 +2629,7 @@ AH_TOP([
 @%:@define _SEEN_MONETDB_CONFIG_H 1
 ])
 AH_BOTTOM([
+@%:@define OPENSSL_SUPPRESS_DEPRECATED
 @%:@ifdef INTEL_MATH_H_HACK
 /* see https://software.intel.com/en-us/forums/intel-c-compiler/topic/760979 */
 typedef enum {
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1953,12 +1953,14 @@ gdk_export str GDKstrndup(const char *s,
        ({                                                      \
                void *_ptr = (p);                               \
                size_t _size = (s);                             \
+               char _buf[12];                                  \
+               snprintf(_buf, sizeof(_buf), "%p", _ptr);       \
                void *_res = GDKrealloc(_ptr, _size);           \
                ALLOCDEBUG                                      \
                        fprintf(stderr,                         \
-                               "#GDKrealloc(%p,%zu) -> %p"     \
+                               "#GDKrealloc(%s,%zu) -> %p"     \
                                " %s[%s:%d]\n",                 \
-                               _ptr, _size, _res,              \
+                               _buf, _size, _res,              \
                                __func__, __FILE__, __LINE__);  \
                _res;                                           \
         })
@@ -2045,12 +2047,14 @@ gdk_export str GDKstrndup(const char *s,
        ({                                                      \
                void *_ptr = (p);                               \
                size_t _size = (s);                             \
+               char _buf[12];                                  \
+               snprintf(_buf, sizeof(_buf), "%p", _ptr);       \
                void *_res = realloc(_ptr, _size);              \
                ALLOCDEBUG                                      \
                        fprintf(stderr,                         \
-                               "#realloc(%p,%zu) -> %p"        \
+                               "#realloc(%s,%zu) -> %p"        \
                                " %s[%s:%d]\n",                 \
-                               _ptr, _size, _res,              \
+                               _buf, _size, _res,              \
                                __func__, __FILE__, __LINE__);  \
                _res;                                           \
         })
diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -2748,8 +2748,8 @@ BATmax_skipnil(BAT *b, void *aggr, bit s
 
 #define DO_QUANTILE_AVG(TPE)                                           \
        do {                                                            \
-               TPE low = *(TPE*) BUNtail(bi, r + (BUN) hi);            \
-               TPE high = *(TPE*) BUNtail(bi, r + (BUN) lo);           \
+               TPE low = *(TPE*) BUNtloc(bi, r + (BUN) hi);            \
+               TPE high = *(TPE*) BUNtloc(bi, r + (BUN) lo);           \
                if (is_##TPE##_nil(low) || is_##TPE##_nil(high)) {      \
                        val = dbl_nil;                                  \
                        nils++;                                         \
diff --git a/sql/server/Makefile.ag b/sql/server/Makefile.ag
--- a/sql/server/Makefile.ag
+++ b/sql/server/Makefile.ag
@@ -16,7 +16,7 @@ INCLUDES = ../include ../common ../stora
                   ../../common/utils \
                   ../../gdk
 
-AM_YFLAGS = -d -p sql -r all
+AM_YFLAGS = -d -p sql
 sql_parser.tab_CFLAGS = `case "$(CFLAGS)" in *unreachable-code*) echo ' 
-Wno-unreachable-code';; esac`
 
 lib_sqlserver = {
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to