[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sys_un: New module.
From: |
Collin Funk |
Subject: |
Re: sys_un: New module. |
Date: |
Thu, 25 Jul 2024 20:40:10 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi Bruno,
The warnings say:
> ../gllib/string.h:809:20: error: declaration of 'memchr' has a different
> language linkage
> 809 | _GL_CXXALIASWARN1 (memchr, void *,
> | ^
> /usr/include/string.h:94:1: note: previous definition is here
> 94 | memchr (void *__s, int __c, size_t __n) __THROW
> | ^
Initially looking at glibc's string.h on my system I had suspicions of
the following code in string.h:
/* Tell the caller that we provide correct C++ prototypes. */
#if defined __cplusplus && (__GNUC_PREREQ (4, 4) \
|| __glibc_clang_prereq (3, 5))
# define __CORRECT_ISO_CPP_STRING_H_PROTO
#endif
[...]
#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
extern "C++"
{
extern void *memchr (void *__s, int __c, size_t __n)
__THROW __asm ("memchr") __attribute_pure__ __nonnull ((1));
extern const void *memchr (const void *__s, int __c, size_t __n)
__THROW __asm ("memchr") __attribute_pure__ __nonnull ((1));
[...]
Upon looking further I see that someone else ran into errors like this
using clang++ in 2021 [1]. AFAIK it was never resolved but the archives
split replies by month I think. So maybe I am wrong.
Does this sound reasonable to you? I have attached a patch that should
fix the testdir of all modules while using clang++.
Those _GL_CXXALIASWARN1, etc. macros sort of go over my head so sorry if
I am totally off mark.
Collin
[1] https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00206.html
clang-failure.diff
Description: Text Data