public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "paul.laidler at ntlworld dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/56149] 64 bit gFortran-C interop hidden character argument length passed as 32 bit value Date: Wed, 30 Jan 2013 19:58:00 -0000 [thread overview] Message-ID: <bug-56149-4-pb0bAgkMUz@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-56149-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56149 --- Comment #2 from Paul Laidler <paul.laidler at ntlworld dot com> 2013-01-30 19:58:27 UTC --- Hi Many thanks for your reply and interest. The ClearWin+ function winio@ (winio$ in gFortran) emulates the C function printf that takes a format string then a variable number of arguments depending on the content of the format. The function can be programmed in C on the basis that all arguments are passed as 64 bit addresses until you get to the length of the format string which has a size well below the minimum possible address value. Any arguments after that will also be string lengths. The format string cannot be processed to find out what arguments are supplied until we know its length. The 32 bit length values are passed correctly by gFortran but occupy 64 bits on the stack. However, the HIDWORD is not currently set and will contain whatever is left from its previous use. Nor do we have a null terminator to calculate the length of the format string directly unless the programmer supplies one. Large amounts of code has been written by our users, some of whom are looking to port to gFortran in the absence of 64 bit FTN95 (the Silverfrost Fortran compiler). Hence the interest is porting the ClearWin+ library to a 64 bit DLL that is accessible from gFortran code. Any help or insight that you have would be greatly appreciated. Paul Laidler On 30 January 2013 16:22, kargl at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org > wrote: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56149 > > kargl at gcc dot gnu.org changed: > > What |Removed |Added > > ---------------------------------------------------------------------------- > Priority|P3 |P5 > CC| |kargl at gcc dot gnu.org > > --- Comment #1 from kargl at gcc dot gnu.org 2013-01-30 16:22:57 UTC --- > Do you have a small self-contained example and > the command lines you use to compile the code? > > The hidden string length is a 32-bit integer. > It will always be a 32-bit integer, so I do > not see how it can be confused for a 64-bit > address. > > -- > Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email > ------- You are receiving this mail because: ------- > You reported the bug. >
next prev parent reply other threads:[~2013-01-30 19:58 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-01-30 14:04 [Bug fortran/56149] New: " paul.laidler at ntlworld dot com 2013-01-30 16:23 ` [Bug fortran/56149] " kargl at gcc dot gnu.org 2013-01-30 19:58 ` paul.laidler at ntlworld dot com [this message] 2013-01-30 22:06 ` burnus at gcc dot gnu.org 2013-01-31 8:32 ` paul.laidler at ntlworld dot com 2013-01-31 15:55 ` sgk at troutmask dot apl.washington.edu 2013-01-31 16:30 ` paul.laidler at ntlworld dot com 2013-02-01 5:22 ` sgk at troutmask dot apl.washington.edu 2013-11-25 1:00 ` kargl at gcc dot gnu.org 2015-10-09 13:34 ` dominiq at lps dot ens.fr
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-56149-4-pb0bAgkMUz@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: linkBe 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).