From nobody Tue Mar 12 10:22:32 2024 X-Original-To: toolchain@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 4Tv8pc4lLWz5DYlQ for ; Tue, 12 Mar 2024 10:22:32 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tv8pc2J7Yz4LJG for ; Tue, 12 Mar 2024 10:22:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1710238952; a=rsa-sha256; cv=none; b=DGhD6dEjqnk9MCXOs4ugFO8ru2fEkPvusLFblzuBB13OhICWTeL2VOFG5hWv2h+YIyKvRG 4s8d6YLJ/lsAUnNQvRaOnai+ash7DXSms0v99UJ13Zgb5UqitJL/BN/H2RtW+VC3TtF+aB 0nU7QBW2tO3wg3FPPTsvaENe508kR4fLY8eplDSSQOvt1jDg8n67RLddqmbU5XSjFsDVzt 9TS/VhO7wmlID05jSw6blgWNYrIo7IfW+dfK5W2x7QoxZYKoyQyUdyyLODMogNSYutz6fX W/kjrE67kHkIBcIgRVK/UJGbXiyxuiAIMxCXNogMLOpY1nfskKZI8bIgczToCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710238952; 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: in-reply-to:in-reply-to:references:references; bh=jBn4FSQoBvv9kiya7cnck7xk7DuD46IK/hnrbcqxMzk=; b=hgiKvCcsxct6006fTfcd7zNJmKQm8OSHntK5yHtlc89i9+fj+qrjqH8gKKSQGeoZqBIGzm 57a+mmsrAPj9MdH8V92gtRGiOOrNQgB2CC2e28gyM8XK3slwm4aaZFVuBqHs7V1svXrVsN 8P9jVc2MEjZP76IaIxYeys6ZYy7FEZpg9DYEdcYfqZ9woguxVRv6x67BAPLUfw7Ixyj2Rl NQI9AiFV+VAKJx7CfPFmveKYQqBYJ7ee0xUtmooANvHM0HgJRDbnESDIuqhntT6ix45Gw0 FSiVax8QcWETb1BDV/xXnCHuqm1YJJdZjMQIF88CFsmai3pCiagrlorhlzcisA== 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 4Tv8pc1w50z18v3 for ; Tue, 12 Mar 2024 10:22:32 +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 42CAMW3j075824 for ; Tue, 12 Mar 2024 10:22:32 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 42CAMWdI075823 for toolchain@FreeBSD.org; Tue, 12 Mar 2024 10:22:32 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: toolchain@FreeBSD.org Subject: [Bug 277649] clang version 17.0.6 compiles va_list to both integer and structure pointer Date: Tue, 12 Mar 2024 10:22:32 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: dim@FreeBSD.org X-Bugzilla-Status: Closed X-Bugzilla-Resolution: Not A Bug X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: toolchain@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution bug_status cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Maintenance of FreeBSD s integrated toolchain List-Archive: https://lists.freebsd.org/archives/freebsd-toolchain List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277649 Dimitry Andric changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |Not A Bug Status|New |Closed CC| |dim@FreeBSD.org --- Comment #1 from Dimitry Andric --- Unfortunately va_list is not a regular type, and you cannot just copy it by assignment, it requires va_copy(3). So assigning it in the way you are doin= g is not possible. Note that gcc also warns, in the same way: % gcc -c parsargu.c parsargu.c: In function 'build_arg_fmt_list': parsargu.c:19:32: warning: initialization of 'unsigned int' from '__va_list= _tag *' makes integer from pointer without a cast [-Wint-conversion] 19 | struct a_build_ctrl_t abc =3D {ap, 0}; | ^~ parsargu.c:19:32: note: (near initialization for 'abc.ap[0].gp_offset') What can work is to initialize the struct as completely empty, then va_copy= the incoming va_list into it, e.g.: void* build_arg_fmt_list(void* fmt, va_list ap) { int tBE, na=3D1, Nv; register int n, ne; char *cp, *cpr, *fmtp; struct a_build_ctrl_t abc =3D {}; va_copy(abc.ap, ap); #define nv ne // ... va_end(abc.ap); // each va_copy() must be matched with a va_end() } --=20 You are receiving this mail because: You are the assignee for the bug.=