From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3439B3858D38; Wed, 6 Dec 2023 11:03:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3439B3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701860596; bh=dhAbS4o7Uei9sQ/ERa4zgQlCrjiYMCV3WyFgGm/pYKE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ubCyLjpF5hxF8Nfsq+Fj2ALhkoAmkw2O0wSoHMdwN61dlVj8ew5ILnkpnEO6dk5gr IReUB0LbbR5wqBvZagv2ulQ+OVwzgrYX2dmuf3ENM4fN7dACpJ4Ks4PLl+Kc5d7iWj QhOAM9I28wQPfuwGOd6Zze4oGNFXWQVnOLUIZMFk= From: "tschwinge at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgcc/109289] Conflicting types for built-in functions in libgcc/emutls.c Date: Wed, 06 Dec 2023 11:03:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgcc X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: tschwinge at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109289 Thomas Schwinge changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #8 from Thomas Schwinge --- (In reply to myself from comment #2) > [...]/source-gcc/libgcc/emutls.c: In function =E2=80=98__emutls_get_a= ddress=E2=80=99: > [...]/source-gcc/libgcc/emutls.c:172:13: error: implicit declaration = of > function =E2=80=98calloc=E2=80=99 [-Wimplicit-function-declaration] > 172 | arr =3D calloc (size + 1, sizeof (void *)); > | ^~~~~~ > [...]/source-gcc/libgcc/emutls.c:32:1: note: include =E2=80=98=E2=80=99 or > provide a declaration of =E2=80=98calloc=E2=80=99 > 31 | #include "gthr.h" > +++ |+#include > 32 | > [...]/source-gcc/libgcc/emutls.c:172:13: warning: incompatible implic= it > declaration of built-in function =E2=80=98calloc=E2=80=99 [-Wbuiltin-decl= aration-mismatch] > 172 | arr =3D calloc (size + 1, sizeof (void *)); > | ^~~~~~ > [...]/source-gcc/libgcc/emutls.c:172:13: note: include =E2=80=98=E2=80=99 or > provide a declaration of =E2=80=98calloc=E2=80=99 > [...]/source-gcc/libgcc/emutls.c:184:13: error: implicit declaration = of > function =E2=80=98realloc=E2=80=99 [-Wimplicit-function-declaration] > 184 | arr =3D realloc (arr, (size + 1) * sizeof (void *)); > | ^~~~~~~ > [...]/source-gcc/libgcc/emutls.c:184:13: note: include =E2=80=98=E2=80=99 or > provide a declaration of =E2=80=98realloc=E2=80=99 > [...]/source-gcc/libgcc/emutls.c:184:13: warning: incompatible implic= it > declaration of built-in function =E2=80=98realloc=E2=80=99 [-Wbuiltin-dec= laration-mismatch] > [...]/source-gcc/libgcc/emutls.c:184:13: note: include =E2=80=98=E2=80=99 or > provide a declaration of =E2=80=98realloc=E2=80=99 > GCC's suggestion to "include =E2=80=98=E2=80=99" needs to be ca= refully reviewed, > in case this is meant to be buildable in an environment without C library > headers? (In reply to Florian Weimer from comment #3) > Thomas, the safe thing to do would be to use __builtin_calloc and > __builtin_realloc in those spots because it avoids a dependency on an > external header that might not exist at this point. That part got resolved differently, in commit r14-6207-g6e84dafcc72d1cd6d028b42f1801e092a91d3214 "tsystem.h: Declare calloc/realloc #ifdef inhibit_libc".=