Skip to content

Commit f998e23

Browse files
committed
Fix build with PostgreSQL 18
PostgreSQL 18 added -Wmissing-variable-declarations to the default compilation flags. When combined with -Werror, this requires variables that are only used within a single C file to be marked as `static`. Without this change, builds fail due to missing variable declaration warnings being treated as errors. Also, update format specifiers for int64 to ensure successful compilation across all supported platforms.
1 parent 21c9900 commit f998e23

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/hll.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ enum {
127127
static Oid hllAggregateArray[HLL_AGGREGATE_COUNT];
128128
static bool aggregateValuesInitialized = false;
129129

130-
bool ForceGroupAgg = false;
130+
static bool ForceGroupAgg = false;
131131

132132
static create_upper_paths_hook_type previous_upper_path_hook;
133133
static void RegisterConfigVariables(void);
@@ -2053,7 +2053,7 @@ check_modifiers(int32 log2m, int32 regwidth, int64 expthresh, int32 sparseon)
20532053
if (expthresh < -1 || expthresh > expthresh_max)
20542054
ereport(ERROR,
20552055
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2056-
errmsg("expthresh modifier must be between -1 and %ld", expthresh_max)));
2056+
errmsg("expthresh modifier must be between -1 and "INT64_FORMAT, expthresh_max)));
20572057

20582058
if (expthresh > 0 && (1LL << integer_log2(expthresh)) != expthresh)
20592059
ereport(ERROR,

0 commit comments

Comments
 (0)