public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sgk at troutmask dot apl.washington.edu" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-109322-4-arrdrCbhlL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109322-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109322

--- Comment #7 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
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=109322
> 
> --- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> 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.
> 

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, const
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, const
char *sym_name,
               gfc_typename (ts));
       return;
     }
-  fputs (type_name, dumpfile);
+
+#if 1
+  bp = &buf[0];
+  strncpy(bp, type_name, 80);
+  for (; *bp != '\0'; bp++)
+    if (*bp == '_') *bp = ' ';
+#endif
+
+  fputs (buf, dumpfile);
   fputs (pre, dumpfile);
   if (asterisk)
     fputs ("*", dumpfile);

  parent reply	other threads:[~2023-03-29 21:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-28 21:20 [Bug fortran/109322] New: " emr-gnu at hev dot psu.edu
2023-03-29 17:13 ` [Bug fortran/109322] " kargl at gcc dot gnu.org
2023-03-29 17:50 ` emr-gnu at hev dot psu.edu
2023-03-29 19:42 ` sgk at troutmask dot apl.washington.edu
2023-03-29 21:24 ` pinskia at gcc dot gnu.org
2023-03-29 21:28 ` pinskia at gcc dot gnu.org
2023-03-29 21:30 ` pinskia at gcc dot gnu.org
2023-03-29 21:45 ` sgk at troutmask dot apl.washington.edu [this message]
2023-03-29 21:47 ` pinskia at gcc dot gnu.org
2023-03-30 19:02 ` sgk at troutmask dot apl.washington.edu
2023-03-30 19:21 ` pinskia at gcc dot gnu.org
2023-03-30 20:10 ` sgk at troutmask dot apl.washington.edu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-109322-4-arrdrCbhlL@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).