From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5D23F3858D1E; Wed, 29 Mar 2023 21:45:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D23F3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680126313; bh=jmf5Vs4EnuKCh15iIKqiLCHlf4Hdhtil+TvMIidU13E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kL682f4Dl7sDpIKO2Shp+SXoX+iPcwjHNgYYV5CnTU6L35ffoKLZZbXbDHqx1BWtB r/SG1DLVw1Yf1GU88zqFJKavg+8l8JyKhkQrln2bqFL/HbLewFA8w/8oNPIn59cM9w ZWgoqq1HCNJKkFgBX97Bbclig3iyV1YF88jgOktY= From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/109322] -fc-prototypes does not correctly translate INTEGER(KIND=C_SIZE_T), and other sizes Date: Wed, 29 Mar 2023 21:45:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P5 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109322 --- Comment #7 from Steve Kargl -= -- On Wed, Mar 29, 2023 at 09:28:38PM +0000, pinskia at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109322 >=20 > --- Comment #5 from Andrew Pinski --- > There is a bug with -m32 and fc-prototypes though, it should be long long > rather than long long. Let me provide a patch for that. >=20 This replaces '_' by ' ', but would certainly break if int_t is in type_name. diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc index 3b24bdc1a6c..3921adfbe01 100644 --- a/gcc/fortran/dump-parse-tree.cc +++ b/gcc/fortran/dump-parse-tree.cc @@ -3807,6 +3807,7 @@ write_decl (gfc_typespec *ts, gfc_array_spec *as, con= st char *sym_name, bool func_ret, locus *where, bool bind_c) { const char *pre, *type_name, *post; + char *bp, buf[81]; bool asterisk; enum type_return rok; @@ -3819,7 +3820,15 @@ write_decl (gfc_typespec *ts, gfc_array_spec *as, co= nst char *sym_name, gfc_typename (ts)); return; } - fputs (type_name, dumpfile); + +#if 1 + bp =3D &buf[0]; + strncpy(bp, type_name, 80); + for (; *bp !=3D '\0'; bp++) + if (*bp =3D=3D '_') *bp =3D ' '; +#endif + + fputs (buf, dumpfile); fputs (pre, dumpfile); if (asterisk) fputs ("*", dumpfile);=