From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id B8D8C3858D28 for ; Tue, 5 Dec 2023 10:11:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B8D8C3858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=foss.arm.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=foss.arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B8D8C3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701771105; cv=none; b=cPOQWjf0d8I9g9I3jZLadY7y+gUezwMICao41j4XbNklaxSkpW9xWyfriJhvhwtZj5z7PmrDG1L3n3HMBjhq3guL8HCSTFjOsyfumtuyP0DuWxcdBDU1fralEC2LZAAHsRdNQ4QYHWPG6K/rIbYbj64hfjwU75TyqodXTbgKNqo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701771105; c=relaxed/simple; bh=9xOyuPe6Dxxe2edXewVEeSV1aPIacOkfV6834NYiYts=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=UhF6DDkveiTn2MmSq2aRID6FL7By9kKZMZ63l/0FxaaXHc1jYGpXT6f/PPNPE4Y3eaZOTwi2b1YB99P5+YWG8ehvJLuakD2UZDIPLqHj8SXQ/aaQHuFT0d1qTU5QKaJMe/cJGAyuLsJ338KkTBR7ewSF5mfB8dTb47Uv9ubdRlU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0F123FEC; Tue, 5 Dec 2023 02:12:30 -0800 (PST) Received: from [10.57.5.1] (unknown [10.57.5.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BBEAE3F5A1; Tue, 5 Dec 2023 02:11:42 -0800 (PST) Message-ID: <26503180-6b5a-47a2-ba6f-01c3fda30cd9@foss.arm.com> Date: Tue, 5 Dec 2023 10:11:41 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 10/11] c: Turn -Wincompatible-pointer-types into a permerror Content-Language: en-GB To: Florian Weimer , tobias@codesourcery.com Cc: gcc-patches@gcc.gnu.org References: <9e40a64880a14cf27d788ecbaf23365b9a5ac069.1700473918.git.fweimer@redhat.com> <87zfypvv6t.fsf@oldenburg.str.redhat.com> From: Richard Earnshaw In-Reply-To: <87zfypvv6t.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3495.2 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,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: On 05/12/2023 09:46, Florian Weimer wrote: > * 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 ‘GFC_INTEGER_4 *’ {aka ‘long int *’} >> 2208 | dtp->common.iostat : &noiostat; >> | ^~~~~~~~~~~~~~~~~~ >> /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c:2208:48: >> note: second expression has type ‘int *’ >> 2208 | dtp->common.iostat : &noiostat; >> | ^~~~~~~~~ >> /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c:2224:34: >> error: passing argument 2 of ‘dtp->u.p.fdtio_ptr’ from incompatible >> 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 ‘GFC_INTEGER_4 *’ {aka ‘long int *’} but argument is of >> type ‘int *’ >> /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c:2225:31: >> error: passing argument 5 of ‘dtp->u.p.fdtio_ptr’ from incompatible >> 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 ‘GFC_INTEGER_4 *’ {aka ‘long int *’} but argument is of >> type ‘int *’ > > 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, > /* If this object has a User Defined procedure, call it. */ > if (nl->dtio_sub != NULL) > { > - int unit = dtp->u.p.current_unit->unit_number; > + GFC_INTEGER_4 unit = dtp->u.p.current_unit->unit_number; > char iotype[] = "NAMELIST"; > gfc_charlen_type iotype_len = 8; > char tmp_iomsg[IOMSG_LEN] = ""; > char *child_iomsg; > gfc_charlen_type child_iomsg_len; > - int noiostat; > + GFC_INTEGER_4 noiostat; > int *child_iostat = NULL; > gfc_full_array_i4 vlist; > formatted_dtio dtio_ptr = (formatted_dtio)nl->dtio_sub; > > > Apparently the targets I built define GFC_INTEGER_4 as int, so this > didn't show up. It looks reasonable to me, but I'm not a real user of libgfortran, so there's possibly something more subtle that I've missed (I can't even guarantee I copied all of the errors from the build log). I've copied Tobias as a fortran maintainer, but I don't know if this is his forte either, though perhaps he might know who's it is. R. > > Thanks, > Florian >