From nobody Wed Jan 08 08:10:41 2025 X-Original-To: standards@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSgb55mNKz5jvpq for ; Wed, 08 Jan 2025 08:10:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSgb53Vdqz47pw for ; Wed, 8 Jan 2025 08:10:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736323841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V8sQ7nJtDuHI5WyCaS2L/T2vtbLGs7j0CvBh60CgvxQ=; b=MJkWmMPtJH78aGN+J6c7FdOLJae2WihWc56c7h+LCW5b39uhCLOMyXd3KwUIz5bJM+qeTM pvzxgUfUqkGVawVcfA6yKSyPV74w8khpo2UcV7SzD38VV9qMUcpdXxXHa+M524tYwjEFDt k9ANVyJUm6PGJZGNkAMRUGkLK7fnvxE39rcN/9ZnenO1xNfOT1V01ycYcpvNCqj+2sbMCr 9orUNp/6QunrVEQSBLhW7vY3HT25cgHFzPG2+FJM99D6hdfiBg68yCstl5j8plMXSkbWA5 d8dPPFQVt0hGcdfbt/IFUmCPh5l7uONZ8wQ0jSL4ib1Anw6ZtHbwYohzkYp8rA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736323841; a=rsa-sha256; cv=none; b=IZrbMouSshb8OiypJRmXRG3hxt1S0OwPEjIxr8W0jtyXKmehdBexDfwOe8VsKS9FQziMh+ yZQfJcjmuiIQ5aAp5e8s5oSUAl4qj5xldHJQ9BaM+AkdZp2TvOMtGbgVuwMpR2GaO8hP1d 9DEKrWf/Kxc/6b27ssLVOjZ/rryWbSFDZN0UZds+GlBF/pzlQ6rIONzZ9d0EBrSrtWnbLj htRR/fTlQ0MBki6heHwO8077XzUhe4Xy9TGIwySK8vKCGWWD8Pval1ZQqCWCtDP6EDQrhy N7RV2b2i1S7YFUL+gKScxdf9VgXBoN4u5YbiE1DYhAlf5dboHa472aW0O8ON+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSgb52dQKznqp for ; Wed, 08 Jan 2025 08:10:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 5088Afho067075 for ; Wed, 8 Jan 2025 08:10:41 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 5088AfOC067074 for standards@FreeBSD.org; Wed, 8 Jan 2025 08:10:41 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: standards@FreeBSD.org Subject: [Bug 283917] libc failes to include stdint.h with clang>16 and -ffreestanding Date: Wed, 08 Jan 2025 08:10:41 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: standards X-Bugzilla-Version: 14.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: keve@keve.hu X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: standards@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Standards compliance List-Archive: https://lists.freebsd.org/archives/freebsd-standards List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-standards@freebsd.org Sender: owner-freebsd-standards@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D283917 Bug ID: 283917 Summary: libc failes to include stdint.h with clang>16 and -ffreestanding Product: Base System Version: 14.2-STABLE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: standards Assignee: standards@FreeBSD.org Reporter: keve@keve.hu The trivial code ``` #include #include #include int main(const int argc, const char *argv[]) { uint32_t answer =3D 42; printf("%" PRId32 "\n", answer); return 0; } ``` fails to compile with clang17, clang18, clang19, when -ffreestanding is set ``` # env CC=3Dclang19 CFLAGS=3D-ffreestanding make hello clang19 -ffreestanding hello.c -o hello In file included from hello.c:2: /usr/local/llvm19/lib/clang/19/include/stdint.h:261:25: error: typedef redefinition with different types ('int16_t' (aka 'short') vs '__int_fast16= _t' (aka 'int')) 261 | typedef __int_least16_t int_fast16_t; | ^ /usr/include/sys/stdint.h:51:25: note: previous definition is here 51 | typedef __int_fast16_t int_fast16_t; | ^ In file included from hello.c:2: /usr/local/llvm19/lib/clang/19/include/stdint.h:262:26: error: typedef redefinition with different types ('uint16_t' (aka 'unsigned short') vs '__uint_fast16_t' (aka 'unsigned int')) 262 | typedef __uint_least16_t uint_fast16_t; | ^ /usr/include/sys/stdint.h:56:26: note: previous definition is here 56 | typedef __uint_fast16_t uint_fast16_t; | ^ In file included from hello.c:2: /usr/local/llvm19/lib/clang/19/include/stdint.h:280:24: error: typedef redefinition with different types ('int8_t' (aka 'signed char') vs '__int_fast8_t' (aka 'int')) 280 | typedef __int_least8_t int_fast8_t; | ^ /usr/include/sys/stdint.h:50:24: note: previous definition is here 50 | typedef __int_fast8_t int_fast8_t; | ^ In file included from hello.c:2: /usr/local/llvm19/lib/clang/19/include/stdint.h:281:25: error: typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs '__uint_fast8_t' (aka 'unsigned int')) 281 | typedef __uint_least8_t uint_fast8_t; | ^ /usr/include/sys/stdint.h:55:25: note: previous definition is here 55 | typedef __uint_fast8_t uint_fast8_t; | ^ 4 errors generated. *** Error code 1 ``` Other environments (e.g. Linux, Darwin) compile this code just fine with -ffreestanding. A real life project affected by this is e.g. libecc (https://github.com/libecc/libecc) --=20 You are receiving this mail because: You are the assignee for the bug.=