The attached patch makes gl_VISIBILITY to reject unsupported configurations with newer gcc: In its current form, mingw gcc-4.5.4 rejects the attributes but gcc-7.5 does not, apparently because the attributes are applied to func prototypes without their definitions. Attaching a hidden visibility attrib to dummyfunc() makes gcc-7.5 to reject it properly.
-- O.S.
From 1c7e9ca1f5ad6f2b7dcd65f0bdfefec16ff6ad06 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer <seze...@gmail.com> Date: Tue, 25 May 2021 18:47:14 +0300 Subject: [PATCH] m4/visibility.m4 (gl_VISIBILITY): properly reject unsupported configurations with newer gcc --- m4/visibility.m4 | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/m4/visibility.m4 b/m4/visibility.m4 index 8f27a12..91970a9 100644 --- a/m4/visibility.m4 +++ b/m4/visibility.m4 @@ -1,4 +1,4 @@ -# visibility.m4 serial 7 +# visibility.m4 serial 8 dnl Copyright (C) 2005, 2008, 2010-2021 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -58,7 +58,7 @@ AC_DEFUN([gl_VISIBILITY], extern __attribute__((__visibility__("default"))) int exportedvar; extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); extern __attribute__((__visibility__("default"))) int exportedfunc (void); - void dummyfunc (void); + extern __attribute__((__visibility__("hidden"))) void dummyfunc (void); void dummyfunc (void) {} ]], [[]])], -- 1.7.1