From 56863e8f0b5815d9bb9d7adc549071e57f87f25c Mon Sep 17 00:00:00 2001 From: Jelte Fennema Date: Fri, 20 Mar 2020 11:53:28 +0100 Subject: [PATCH] Really ignore -Wgnu-variable-sized-type-not-at-end (#3627) --- src/backend/distributed/planner/shard_pruning.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/backend/distributed/planner/shard_pruning.c b/src/backend/distributed/planner/shard_pruning.c index a6087342e..5995562ba 100644 --- a/src/backend/distributed/planner/shard_pruning.c +++ b/src/backend/distributed/planner/shard_pruning.c @@ -194,6 +194,23 @@ typedef union \ typedef FunctionCallInfoData FunctionCall2InfoData; #endif +/* + * We also ignore this warning in ./configure, but that's not always enough. + * The flags that are used during compilation by ./configure are determined by + * the compiler support it detects. This is usually GCC. This warning is only + * present in clang. So it would normally be fine to not use it with GCC. The + * problem is that clang is used to compile the JIT bitcode when postgres is + * compiled with -with-llvm. So in the end both clang and GCC are used to + * compile the project. + * + * So the flag is not provided on the command line, because ./configure notices + * that GCC doesn't support it. But this warning persists when compiling the + * bitcode. So that's why we ignore it here explicitly. + */ +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wgnu-variable-sized-type-not-at-end" +#endif /* __clang__ */ + /* * Data necessary to perform a single PruneShards(). */