From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12538 invoked by alias); 30 Jan 2013 14:04:51 -0000 Received: (qmail 12454 invoked by uid 48); 30 Jan 2013 14:04:32 -0000 From: "paul.laidler at ntlworld dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/56149] New: 64 bit gFortran-C interop hidden character argument length passed as 32 bit value Date: Wed, 30 Jan 2013 14:04:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: paul.laidler at ntlworld dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg02750.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56149 Bug #: 56149 Summary: 64 bit gFortran-C interop hidden character argument length passed as 32 bit value Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: paul.laidler@ntlworld.com This is not so much a bug but a significant gFortran limitation in my project to port ClearWin+ to gFortran. Users will not want to edit all their "printf" calls so that format strings become null terminated. This could be avoided if the format string length where passed as a 64 bit integer. At the moment gFortran passes a 32 bit value and allows garbage to remain in the HIDWORD so the argument cannot safely be distinguished from a 64 bit address. It would appear that there is no advantage in passing a 32 bit value in this context. As an aside, I would also suggest that interop programming would be much simpler if literal character strings were stored in memory as null-terminated strings.