From nobody Sun Mar 10 08:43:55 2024 X-Original-To: freebsd-questions@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 4Tstk170cFz5DcLg for ; Sun, 10 Mar 2024 08:44:09 +0000 (UTC) (envelope-from pprocacci@gmail.com) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tstk15476z4LQC for ; Sun, 10 Mar 2024 08:44:09 +0000 (UTC) (envelope-from pprocacci@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5684f95cc9bso505700a12.1 for ; Sun, 10 Mar 2024 00:44:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710060246; x=1710665046; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bLyxG0JjFZ+AWpL7BIRdLJWUoYYt2043vD2O8smnPPc=; b=C/5QM6G5S3a2eJk1GoMGG0ZJ1G7QaW4nX8peF3pm5M/RJnudl/NZ8YYaktmHnYchat Re7xy23RZ5+1gqgHUTKW92IwnJuIl42+m352c6L9DDJNmEuhsU6FhFXiBMAlpFXnPtDS Ab6tEVbj3mCxekRBF4pchlaHM7UsHFl6YKB/64CKpUfgMOTSEGCBmm+DZD5Avop3Pdqb SlJMFkqbbPWanz6q8snXIKXtjMatcC6KlTybCIYHQuUtDde595HzA/weC7R6DIREoc0s fC/NrpfhB79nrG1zRr8PdJJ6CfWKCaG5tglUgmeVzrIC/21tPmAPJhOXKLx6+uWjhB/2 gt6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710060246; x=1710665046; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bLyxG0JjFZ+AWpL7BIRdLJWUoYYt2043vD2O8smnPPc=; b=nZiNFX5m/TtwHQhteZ84ccPChhiWSR3xK7kBCtjt5X7UyGEpVtm5NxFrSfoubsGOkr 8kJF41CnDP0/gvSb1JiF3eDKH3haOeDF6Y3i0tUbEig5HEfgdXZpcwTyMD4P4NGq7Xdu WhJZfODUHx4HXirHl1Z8svTXGQGWVAOmOU+uaoNRNkWgtvNiXTDQ+OPVs5TvmE0O0KsR 5aZO/GHgA51ucb2sVA7x3x9BBsLmrbjIrB3PigE5tT1UbezXPJBThNg6z7bE7kkUhI2D UmdAn7eZC97TRkP7q29Dpw4G74QY+OTgkOfecvWhlgIMdxrPvjjGGJDp2jpc26Iy55Ju pOGw== X-Gm-Message-State: AOJu0Yzg6aocsY+ku3dUA+f7HUnX9GsijfhtHX3phHiKvRFTZj7zf7Hg ZpB6Lf/r64YKTW0yeM8m/1vmahWH1sEBnpJzGJ7smCUxgQYG+gINk40G48OM98HBRzDJelhpRip vH2bUXcmVgb0KPagoHNpYdgPb1CFuSOJnSg== X-Google-Smtp-Source: AGHT+IE5w2kB+zuAfejEPWqVx9QEjc96Kz15cVQ5XGw28HyVgfOkPUNFfXsxaacsp6m5+oSUTJEu6k6f9qn3R8CEUiY= X-Received: by 2002:a50:8e5a:0:b0:565:6b76:3140 with SMTP id 26-20020a508e5a000000b005656b763140mr3271555edx.18.1710060245751; Sun, 10 Mar 2024 00:44:05 -0800 (PST) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 References: <4d6edaa6-237d-4207-9047-ddee78ee4b90@gmail.com> In-Reply-To: <4d6edaa6-237d-4207-9047-ddee78ee4b90@gmail.com> From: Paul Procacci Date: Sun, 10 Mar 2024 04:43:55 -0400 Message-ID: Subject: Re: weird compiler error in 13.3-R To: "Jin Guojun[VFF]" Cc: freebsd-questions Content-Type: multipart/alternative; boundary="0000000000007e292306134a6df5" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4Tstk15476z4LQC --0000000000007e292306134a6df5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable https://reviews.llvm.org/D129881 The author of the change can explain it better than anyone else here. ~Paul On Sun, Mar 10, 2024 at 4:24=E2=80=AFAM Jin Guojun[VFF] = wrote: > Updated 13.2 to 13.3 and get a weird compiling failure. The code > compiled since FreeBSD release 4 till release 13.2. > > Both ap (line 119) and vap (line 126) are declared as va_list, somehow > clang version 17.0.6 thinks va_list at line 119 is uint, > > where va_list in line 126 is 'struct __va_list_tag *'. > > Checked /usr/include and va_list is declared in > /usr/include/sys/_stdarg.h:39: typedef __va_list va_list; > included by /usr/include/stdarg.h via x86/stdarg.h > > Does anyone have ideas on what could cause such compiling failure? > > -Jin > > 10 #include > 11 #include > > 118 struct a_build_ctrl_t { > 119 va_list ap; /* what is different from vap > at line 126? */ > 120 argu_type last_arg_t; > 121 }; > 124 > 125 arg_fmt_lists* > 126 build_arg_fmt_list(arg_fmt_list_string* fmt, va_list vap) > 127 { > 128 int na=3D1; > 129 > 130 arg_fmt_lists* aflp; > 131 arg_fmt_lists* aflp_top; > 132 > 133 struct a_build_ctrl_t abc =3D {.ap=3Dvap, > last_arg_t=3DARGU_NONE}; > > ... > > } > > test.c:133:34: error: incompatible pointer to integer conversion > initializing 'unsigned int' with an expression of type 'struct > __va_list_tag *' [-Wint-conversion] > 133 | struct a_build_ctrl_t abc =3D {.ap=3Dvap, .last_arg_t=3DARGU_N= ONE}; > > > --=20 __________________ :(){ :|:& };: --0000000000007e292306134a6df5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The author of the change can= explain it better than anyone else here.

~Paul

<= div class=3D"gmail_quote">
On Sun, Mar= 10, 2024 at 4:24=E2=80=AFAM Jin Guojun[VFF] <jguojun@gmail.com> wrote:
Updated 13.2 to 13.3 and get a weird compiling = failure. The code
compiled since FreeBSD release 4 till release 13.2.

Both ap (line 119) and vap (line 126) are declared as va_list, somehow
clang version 17.0.6 thinks va_list at line 119 is uint,

where va_list in line 126 is 'struct __va_list_tag *'.

Checked /usr/include and va_list is declared in
/usr/include/sys/_stdarg.h:39:=C2=A0 typedef __va_list=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 va_list;
included by /usr/include/stdarg.h via x86/stdarg.h

=C2=A0=C2=A0Does anyone have ideas on what could cause such compiling failu= re?

-Jin

=C2=A0=C2=A0=C2=A0=C2=A0 10 #include <stdarg.h>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 11 #include <stdio.h>

=C2=A0=C2=A0=C2=A0=C2=A0 118 struct=C2=A0 a_build_ctrl_t=C2=A0 {
=C2=A0=C2=A0=C2=A0=C2=A0 119 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 va_= list=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ap;=C2=A0=C2=A0=C2=A0= =C2=A0 /* what is different from vap
at line 126? =C2=A0=C2=A0 */
=C2=A0=C2=A0=C2=A0=C2=A0 120 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 arg= u_type=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 last_arg_t;
=C2=A0=C2=A0=C2=A0=C2=A0 121 };
=C2=A0=C2=A0=C2=A0=C2=A0 124
=C2=A0=C2=A0=C2=A0=C2=A0 125 arg_fmt_lists*
=C2=A0=C2=A0=C2=A0=C2=A0 126 build_arg_fmt_list(arg_fmt_list_string* fmt, v= a_list vap)
=C2=A0=C2=A0=C2=A0=C2=A0 127 {
=C2=A0=C2=A0=C2=A0=C2=A0 128=C2=A0=C2=A0 =C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0= na=3D1;
=C2=A0=C2=A0=C2=A0=C2=A0 129
=C2=A0=C2=A0=C2=A0=C2=A0 130 =C2=A0=C2=A0 =C2=A0 arg_fmt_lists* aflp;
=C2=A0=C2=A0=C2=A0=C2=A0 131=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 arg_fmt_lists* a= flp_top;
=C2=A0=C2=A0=C2=A0=C2=A0 132
=C2=A0=C2=A0=C2=A0=C2=A0 133 =C2=A0=C2=A0=C2=A0 struct a_build_ctrl_t=C2=A0= =C2=A0 abc =3D {.ap=3Dvap,
last_arg_t=3DARGU_NONE};

=C2=A0=C2=A0...

=C2=A0=C2=A0 =C2=A0 =C2=A0 }

test.c:133:34: error: incompatible pointer to integer conversion
initializing 'unsigned int' with an expression of type 'struct =
__va_list_tag *' [-Wint-conversion]
=C2=A0=C2=A0 133 | struct a_build_ctrl_t=C2=A0=C2=A0 abc =3D {.ap=3Dvap, .l= ast_arg_t=3DARGU_NONE};




--
_____________= _____

:(){ :|:& };:
--0000000000007e292306134a6df5--