bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OpenMandriva


From: Bruno Haible
Subject: Re: OpenMandriva
Date: Tue, 27 Aug 2024 21:41:33 +0200

> > >   Fix compilation errors with clang that masquerades as gcc 13.
> > 
> > And here is a patch that fixes the clang warnings that appear to be caused
> > by this version of __GNUC__.
> 
> And here is a patch that avoids a test failure.

Other than that, I'm reviewing the other remaining occurrences of __GNUC__:

lib/_Noreturn.h:37:                && (4 < __GNUC__ + (7 <= __GNUC_MINOR__) \
lib/aligned-malloc.h:67:# if defined aligned_free || __GNUC__ >= 11
lib/aligned-malloc.h:82:#  if defined aligned_malloc || __GNUC__ >= 11
lib/argp.h:47:# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__) \
lib/arpa_inet.in.h:20:#if __GNUC__ >= 3
lib/assert.in.h:20:#if __GNUC__ >= 3
lib/astrxfrm.c:29:#if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4
lib/base32.h:30:#if defined __GNUC__ && 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
lib/base64.h:30:#if defined __GNUC__ && 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
lib/c++defs.h:317:# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
lib/cdefs.h:519:#if (__GNUC__ >= 3) || __glibc_has_builtin (__builtin_expect)
lib/ctype.in.h:27:#if __GNUC__ >= 3
lib/dfa.c:83:# elif ((__GNUC__ >= 7) \
lib/dirent.in.h:155:#  if !@HAVE_OPENDIR@ || __GNUC__ >= 11
lib/dirent.in.h:165:# if @GNULIB_CLOSEDIR@ && !GNULIB_defined_DIR && __GNUC__ 
>= 11 && !defined opendir
lib/dirent.in.h:19:#if __GNUC__ >= 3
lib/dirent.in.h:277:#  if !@HAVE_FDOPENDIR@ || !@HAVE_DECL_FDOPENDIR@ || 
__GNUC__ >= 11
lib/dirent.in.h:286:# if @GNULIB_CLOSEDIR@ && __GNUC__ >= 11 && !defined 
fdopendir
lib/dirent.in.h:81:# if __GNUC__ >= 11
lib/endian.in.h:22:#if __GNUC__ >= 3
lib/errno.in.h:20:#if __GNUC__ >= 3
lib/fcntl.in.h:20:#if __GNUC__ >= 3
lib/fenv-private.h:136:# if __GNUC__ >= 6
lib/fenv-private.h:146:# if __GNUC__ >= 6
lib/fenv.in.h:20:#if __GNUC__ >= 3
lib/float.in.h:20:#if __GNUC__ >= 3
lib/fnmatch.in.h:22:#if __GNUC__ >= 3
lib/getopt.in.h:23:#if __GNUC__ >= 3
lib/gettext.h:55:#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 
3)
lib/glob.in.h:22:#if __GNUC__ >= 3
lib/glob.in.h:54:     || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
lib/hamt.h:66:#if (__GNUC__ + (__GNUC_MINOR__ >= 9) > 4) \
lib/iconv.in.h:20:#if __GNUC__ >= 3
lib/intprops-internal.h:115:#elif 7 <= __GNUC__
lib/intprops-internal.h:139:# define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
lib/intprops-internal.h:164:# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
lib/intprops-internal.h:24:#if defined __GNUC__ && 4 < __GNUC__ + (3 <= 
__GNUC_MINOR__)
lib/intprops-internal.h:80:#if (2 <= __GNUC__ \
lib/inttypes.in.h:23:#if __GNUC__ >= 3
lib/jit/cache.h:170:#elif (__GNUC__ + (__GNUC_MINOR__ >= 3) > 4) \
lib/langinfo.in.h:24:#if __GNUC__ >= 3
lib/libc-config.h:53:#  define __GNUC_PREREQ(maj, min) ((maj) < __GNUC__ + 
((min) <= __GNUC_MINOR__))
lib/limits.in.h:18:#if __GNUC__ >= 3
lib/locale.in.h:17:#if __GNUC__ >= 3
lib/malloc.in.h:151:#   if __GNUC__ >= 11
lib/malloc.in.h:173:# if __GNUC__ >= 11 && !defined memalign
lib/malloc.in.h:17:#if __GNUC__ >= 3
lib/math.in.h:25:#if __GNUC__ >= 3
lib/mcel.h:112:#if defined __GNUC__ && 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
lib/mntent.in.h:18:#if __GNUC__ >= 3
lib/monetary.in.h:19:#if __GNUC__ >= 3
lib/monetary.in.h:62:#elif __GNUC__ >= 3
lib/net_if.in.h:19:#if __GNUC__ >= 3
lib/netdb.in.h:24:#if __GNUC__ >= 3
lib/netinet_in.in.h:19:#if __GNUC__ >= 3
lib/noreturn.h:64:#if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__)) 
\
lib/noreturn.h:97:#if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__)) 
\
lib/omp.in.h:18:#if __GNUC__ >= 3
lib/poll.in.h:23:#if __GNUC__ >= 3
lib/pthread.in.h:20:#if __GNUC__ >= 3
lib/pty.in.h:19:#if __GNUC__ >= 3
lib/readutmp.c:151:#if 8 <= __GNUC__
lib/regex.h:534:#if defined __GNUC__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
lib/regex.h:542:# elif defined __GNUC__ && 10 <= __GNUC__
lib/regex.h:647:     || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
lib/regex.h:665:         || 3 < __GNUC__ + (1 <= __GNUC_MINOR__) \
lib/regex.h:691:#if defined __GNUC__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
lib/sched.in.h:19:#if __GNUC__ >= 3
lib/se-selinux.in.h:17:#if __GNUC__ >= 3
lib/search.in.h:20:#if __GNUC__ >= 3
lib/signal.in.h:18:#if __GNUC__ >= 3
lib/spawn.in.h:18:#if __GNUC__ >= 3
lib/spawn.in.h:76:     || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
lib/spawn.in.h:94:         || 3 < __GNUC__ + (1 <= __GNUC_MINOR__) \
lib/ssfmalloc.h:141:#if __GNUC__ >= 3
lib/stdalign.in.h:25:#if __GNUC__ >= 3
lib/stdarg.in.h:19:#if __GNUC__ >= 3
lib/stdbit.in.h:77:#if ((defined __GNUC__ && 2 <= __GNUC__) \
lib/stddef.in.h:197:#  elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
lib/stddef.in.h:25:#if __GNUC__ >= 3
lib/stdint.in.h:25:#if __GNUC__ >= 3
lib/stdio.in.h:123:# if __GNUC__ >= 11
lib/stdio.in.h:1251:#  if !@HAVE_POPEN@ || __GNUC__ >= 11
lib/stdio.in.h:1261:# if @GNULIB_PCLOSE@ && __GNUC__ >= 11 && !defined popen
lib/stdio.in.h:1670:#  if __GNUC__ >= 11
lib/stdio.in.h:1683:# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined tmpfile
lib/stdio.in.h:18:#if __GNUC__ >= 3
lib/stdio.in.h:395:#  if __GNUC__ >= 11
lib/stdio.in.h:416:# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fdopen
lib/stdio.in.h:545:#  if __GNUC__ >= 11
lib/stdio.in.h:559:# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fopen
lib/stdio.in.h:954:       && 3 < __GNUC__ + (4 <= __GNUC_MINOR__)               
           \
lib/stdlib.in.h:135:# if __GNUC__ >= 11
lib/stdlib.in.h:1463:#  if __GNUC__ >= 11
lib/stdlib.in.h:1482:# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined 
realloc
lib/stdlib.in.h:18:#if __GNUC__ >= 3
lib/stdlib.in.h:303:#   if __GNUC__ >= 11
lib/stdlib.in.h:325:# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined 
aligned_alloc
lib/stdlib.in.h:379:#  if __GNUC__ >= 11
lib/stdlib.in.h:400:# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined 
calloc
lib/stdlib.in.h:433:#  if !@HAVE_CANONICALIZE_FILE_NAME@ || __GNUC__ >= 11
lib/stdlib.in.h:457:# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined 
canonicalize_file_name
lib/stdlib.in.h:692:#  if __GNUC__ >= 11
lib/stdlib.in.h:713:# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined 
malloc
lib/strftime.c:324:#if __GNUC__ >= 7 && !__OPTIMIZE__
lib/string.in.h:18:#if __GNUC__ >= 3
lib/string.in.h:624:#  if (!@HAVE_DECL_STRDUP@ || __GNUC__ >= 11) && !defined 
strdup
lib/string.in.h:642:# if __GNUC__ >= 11 && !defined strdup
lib/string.in.h:723:#  if !@HAVE_DECL_STRNDUP@ || (__GNUC__ >= 11 && !defined 
strndup)
lib/string.in.h:741:# if __GNUC__ >= 11 && !defined strndup
lib/string.in.h:82:# if __GNUC__ >= 11
lib/strings.in.h:20:#if __GNUC__ >= 3
lib/strptime.c:45:#if defined _LIBC && defined __GNUC__ && __GNUC__ >= 2
lib/sys_file.in.h:22:#if __GNUC__ >= 3
lib/sys_ioctl.in.h:19:#if __GNUC__ >= 3
lib/sys_msg.in.h:18:#if __GNUC__ >= 3
lib/sys_random.in.h:17:# if __GNUC__ >= 3
lib/sys_resource.in.h:17:# if __GNUC__ >= 3
lib/sys_select.in.h:17:# if __GNUC__ >= 3
lib/sys_sem.in.h:18:#if __GNUC__ >= 3
lib/sys_shm.in.h:18:#if __GNUC__ >= 3
lib/sys_socket.in.h:25:#if __GNUC__ >= 3
lib/sys_stat.in.h:23:#if __GNUC__ >= 3
lib/sys_time.in.h:22:#if __GNUC__ >= 3
lib/sys_times.in.h:24:# if __GNUC__ >= 3
lib/sys_types.in.h:18:#if __GNUC__ >= 3
lib/sys_uio.in.h:17:# if __GNUC__ >= 3
lib/sys_un.in.h:22:#if __GNUC__ >= 3
lib/sys_utsname.in.h:19:#if __GNUC__ >= 3
lib/sys_wait.in.h:20:#if __GNUC__ >= 3
lib/sysexits.in.h:21:#if __GNUC__ >= 3
lib/termios.in.h:19:#if __GNUC__ >= 3
lib/threads.in.h:18:#if __GNUC__ >= 3
lib/time.in.h:18:#if __GNUC__ >= 3
lib/uchar.in.h:25:#if __GNUC__ >= 3
lib/unistd.in.h:19:#if __GNUC__ >= 3
lib/unitypes.in.h:56:     || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
lib/utime.in.h:19:#if __GNUC__ >= 3
lib/utmp.in.h:18:#if __GNUC__ >= 3
lib/verify.h:218:# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
lib/verify.h:297:#elif 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= 
__GNUC_PATCHLEVEL__))
lib/verify.h:308:# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
lib/verify.h:41:      || (!defined __STRICT_ANSI__ && 9 <= __GNUC__))
lib/warn-on-use.h:101:# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
lib/warn-on-use.h:134:#  elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
lib/wchar.in.h:1329:#  if !@HAVE_WCSDUP@ || (defined __sun && defined 
__cplusplus) || __GNUC__ >= 11
lib/wchar.in.h:1345:# if __GNUC__ >= 11 && !defined wcsdup
lib/wchar.in.h:28:#if __GNUC__ >= 3
lib/wchar.in.h:98:# if __GNUC__ >= 11
lib/wctype.in.h:28:#if __GNUC__ >= 3
lib/xalloc-oversized.h:50:#elif 5 <= __GNUC__ && !defined __ICC && PTRDIFF_MAX 
< SIZE_MAX
m4/extern-inline.m4:94:#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined 
__STRICT_ANSI__ \
m4/gnulib-common.m4:1383:      #if __GNUC__ + (__GNUC_MINOR__ >= 5) > 4
m4/stdalign.m4:108:       || (defined __GNUC__ && __GNUC__ < 4 + 
(__GNUC_MINOR__ < 9) \
m4/stdalign.m4:167:              ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
m4/stdalign.m4:48:                     ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
m4/stdint.m4:156:    && (!defined __GNUC__ || 4 < __GNUC__ + (9 <= 
__GNUC_MINOR__) \
modules/unitypes:22:     || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
tests/from-glibc/tst-stdbit.h:52:#elif ((defined __GNUC__ && 2 <= __GNUC__) \
tests/test-asyncsafe-linked_list-strong.c:47:#if 4 < __GNUC__ + (3 <= 
__GNUC_MINOR__)
tests/test-asyncsafe-linked_list-weak.c:47:#if 4 < __GNUC__ + (3 <= 
__GNUC_MINOR__)
tests/test-c-strtod-mt.c:22:#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
tests/test-c-strtof-mt.c:22:#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
tests/test-c-strtold-mt.c:22:#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
tests/test-gmtime_r-mt.c:22:#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
tests/test-intprops.c:21:#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
tests/test-limits-h.c:23:#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
tests/test-localtime_r-mt.c:22:#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
tests/test-memrchr.c:31:#if 4 < __GNUC__ + (7 <= __GNUC_MINOR__) && __GNUC__ < 
12
tests/test-nl_langinfo-mt.c:22:#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
tests/test-setlocale_null-mt-all.c:22:#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
tests/test-setlocale_null-mt-one.c:22:#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
tests/test-statat.c:21:#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
tests/test-xvasprintf.c:20:#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < 
__GNUC__

and committing these two patches:


2024-08-27  Bruno Haible  <bruno@clisp.org>

        Improve support for clang on Windows.
        * lib/c++defs.h (_GL_CXXALIASWARN_2): Treat clang like gcc 4.2.
        * lib/stdio.in.h (fwrite, fwrite_unlocked): Likewise.
        * lib/warn-on-use.h (_GL_WARN_ON_USE, _GL_WARN_ON_USE_CXX): Likewise.
        * lib/libc-config.h (__GNUC_PREREQ): Override glibc's definition to
        handle clang in disguise.

2024-08-27  Bruno Haible  <bruno@clisp.org>

        Explicitly exclude clang when we test for a GCC version >= 4.3.
        Rationale: clang can disguise as any possible GCC version.
        * m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): When testing __GNUC__,
        exclude clang.
        * lib/_Noreturn.h (_Noreturn): Likewise.
        * lib/aligned-malloc.h (aligned_free, aligned_malloc): Likewise.
        * lib/base32.h: Likewise.
        * lib/base64.h: Likewise.
        * lib/dfa.c (FALLTHROUGH): Likewise.
        * lib/dirent.in.h (_GL_ATTRIBUTE_DEALLOC, opendir, fdopendir): Likewise.
        * lib/intprops-internal.h: Likewise.
        * lib/jit/cache.h (clear_cache): Likewise.
        * lib/malloc.in.h (memalign): Likewise.
        * lib/mcel.h: Likewise.
        * lib/regex.h: Likewise.
        * lib/stddef.in.h (_GL_HAS_BUILTIN_UNREACHABLE): Likewise.
        * lib/stdio.in.h (_GL_ATTRIBUTE_DEALLOC, fdopen, fopen, popen, tmpfile):
        Likewise.
        * lib/stdlib.in.h (_GL_ATTRIBUTE_DEALLOC, aligned_alloc, calloc,
        canonicalize_file_name, malloc, realloc): Likewise.
        * lib/string.in.h (_GL_ATTRIBUTE_DEALLOC, strdup, strndup): Likewise.
        * lib/verify.h: Likewise.
        * lib/wchar.in.h (_GL_ATTRIBUTE_DEALLOC, wcsdup): Likewise.
        * lib/xalloc-oversized.h (xalloc_oversized): Likewise.
        * lib/fenv-private.h (_FPU_GETCW, _FPU_SETCW, _FPU_GETFPSR,
        _FPU_SETFPSR): When testing __GNUC__, exclude clang. Use different
        builtins for clang.
        * lib/hamt.h (GL_HAMT_THREAD_SAFE): When testing __GNUC__, exclude
        clang. Enable for clang >= 4.
        * lib/astrxfrm.c: Use _GL_GNUC_PREREQ.
        * lib/readutmp.c: Likewise.
        * lib/strftime.c: Likewise.
        * tests/test-asyncsafe-linked_list-strong.c: Likewise.
        * tests/test-asyncsafe-linked_list-weak.c: Likewise.
        * tests/test-c-strtod-mt.c: Likewise.
        * tests/test-c-strtof-mt.c: Likewise.
        * tests/test-c-strtold-mt.c: Likewise.
        * tests/test-gmtime_r-mt.c: Likewise.
        * tests/test-intprops.c: Likewise.
        * tests/test-limits-h.c: Likewise.
        * tests/test-localtime_r-mt.c: Likewise.
        * tests/test-memrchr.c: Likewise.
        * tests/test-nl_langinfo-mt.c: Likewise.
        * tests/test-setlocale_null-mt-all.c: Likewise.
        * tests/test-setlocale_null-mt-one.c: Likewise.
        * tests/test-statat.c: Likewise.
        * tests/test-xvasprintf.c: Likewise.

Attachment: 0001-Explicitly-exclude-clang-when-we-test-for-a-GCC-vers.patch
Description: Text Data

Attachment: 0002-Improve-support-for-clang-on-Windows.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]