From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 87AD5385734D for ; Tue, 5 Dec 2023 09:46:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 87AD5385734D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 87AD5385734D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701769572; cv=none; b=t/GxUkoiT8mM42CPVOjtWFJIEqn3XcqpeEBfk+cWKMLj+wcSpu94Itx59h//tKPs0qDYW97k0KwNnCRNUEQDkagQtjv/bLcilM+Uq1HFug61F4VLzxY3b1KxqLIaomQOjODU5lkWOdmcn7sdFbK6MuPcugP/pN/JVM1c99Z41iY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701769572; c=relaxed/simple; bh=SuB+XLo9UjIxVVkQQiEndHe3w3VmMoMQv1/QmxVEDaI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=TpAnuAbW24iyy6TBhkTCHnILB4rf6pLHskhZdCsuE8kb26oypdN7M5S0DIEtrHst/+tR9hPYBVSULcrGp5iIO/OAXfqffZpX7X663wEqd+bcSFNzJQvTtyBWMvjgki115bFnCLomJ3cKmjukYmkHxKKnbafR6IgTuha6k7sebV0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701769569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OMFu9IhDrpsYEwBlvEt64mIF+6gdroysePPUyvP35/w=; b=AFW4qf1MzNjDJQjwx8s7wmkbsf1U3Bjyx1MOwfju+4y5G8ah/QmqnMSJkj3CJ8NV7jCEED FTPc0f6RiwaX6iGgH+GCJLA++Z7ECK5ub30rpOlGH+J7XpuFqiZb+HA2lyQJJVHxklG/s+ e8uDcoPefdOe0UCsseeT4rQIIQWhx3A= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-7-wWTD-2sINK2pRhS3I4dXCA-1; Tue, 05 Dec 2023 04:46:05 -0500 X-MC-Unique: wWTD-2sINK2pRhS3I4dXCA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7AB073C025D7; Tue, 5 Dec 2023 09:46:05 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.84]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B86E82166B31; Tue, 5 Dec 2023 09:46:04 +0000 (UTC) From: Florian Weimer To: Richard Earnshaw Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH v3 10/11] c: Turn -Wincompatible-pointer-types into a permerror References: <9e40a64880a14cf27d788ecbaf23365b9a5ac069.1700473918.git.fweimer@redhat.com> Date: Tue, 05 Dec 2023 10:46:02 +0100 In-Reply-To: (Richard Earnshaw's message of "Tue, 5 Dec 2023 09:37:02 +0000") Message-ID: <87zfypvv6t.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Richard Earnshaw: > (I think it's this patch, not one of the others in the series). > > This breaks building libgfortran with newlib on arm and aarch64: > > > /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c= :2208:46: > error: pointer type mismatch in conditional expression > [-Wincompatible-pointer-types] > 2208 | dtp->common.iostat : &noiostat; > | ^ > /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c= :2208:27: > note: first expression has type =E2=80=98GFC_INTEGER_4 *=E2=80=99 {aka = =E2=80=98long int *=E2=80=99} > 2208 | dtp->common.iostat : &noiostat; > | ^~~~~~~~~~~~~~~~~~ > /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c= :2208:48: > note: second expression has type =E2=80=98int *=E2=80=99 > 2208 | dtp->common.iostat : &noiostat; > | ^~~~~~~~~ > /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c= :2224:34: > error: passing argument 2 of =E2=80=98dtp->u.p.fdtio_ptr=E2=80=99 from in= compatible > pointer type [-Wincompatible-pointer-types] > 2224 | dtp->u.p.fdtio_ptr (p, &unit, iotype, &vlist, > | ^~~~~ > | | > | int * > /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c= :2224:34: > note: expected =E2=80=98GFC_INTEGER_4 *=E2=80=99 {aka =E2=80=98long int *= =E2=80=99} but argument is of > type =E2=80=98int *=E2=80=99 > /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c= :2225:31: > error: passing argument 5 of =E2=80=98dtp->u.p.fdtio_ptr=E2=80=99 from in= compatible > pointer type [-Wincompatible-pointer-types] > 2225 | child_iostat, child_iomsg, > | ^~~~~~~~~~~~ > | | > | int * > /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c= :2225:31: > note: expected =E2=80=98GFC_INTEGER_4 *=E2=80=99 {aka =E2=80=98long int *= =E2=80=99} but argument is of > type =E2=80=98int *=E2=80=99 Presumably the fixes will look like this? diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index db3330060ce..4fcc77dbf83 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -2987,13 +2987,13 @@ nml_read_obj (st_parameter_dt *dtp, namelist_info *= nl, index_type offset, =09 /* If this object has a User Defined procedure, call it. */ =09 if (nl->dtio_sub !=3D NULL) =09 { -=09=09int unit =3D dtp->u.p.current_unit->unit_number; +=09=09GFC_INTEGER_4 unit =3D dtp->u.p.current_unit->unit_number; =09=09char iotype[] =3D "NAMELIST"; =09=09gfc_charlen_type iotype_len =3D 8; =09=09char tmp_iomsg[IOMSG_LEN] =3D ""; =09=09char *child_iomsg; =09=09gfc_charlen_type child_iomsg_len; -=09=09int noiostat; +=09=09GFC_INTEGER_4 noiostat; =09=09int *child_iostat =3D NULL; =09=09gfc_full_array_i4 vlist; =09=09formatted_dtio dtio_ptr =3D (formatted_dtio)nl->dtio_sub; Apparently the targets I built define GFC_INTEGER_4 as int, so this didn't show up. Thanks, Florian