This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR 78534 Change character length from int to size_t
- From: Bob Deen <Bob dot Deen at jpl dot nasa dot gov>
- To: Janne Blomqvist <blomqvist dot janne at gmail dot com>, fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 3 Jan 2018 10:34:38 -0800
- Subject: Re: [PATCH] PR 78534 Change character length from int to size_t
- Authentication-results: sourceware.org; auth=none
- References: <1514554310-27231-1-git-send-email-blomqvist.janne@gmail.com>
On 12/29/17 5:31 AM, Janne Blomqvist wrote:
In order to handle large character lengths on (L)LP64 targets, switch
the GFortran character length from an int to a size_t.
This is an ABI change, as procedures with character arguments take
hidden arguments with the character length.
Did this change not make it into gcc 7 then? I am one of those who
still use these hidden arguments for Fortran <-> C interfaces. Based on
discussions a year ago, I added this to my code:
#if defined(__GNUC__) && (__GNUC__ > 6)
#include <stddef.h>
#define FORSTR_STDARG_TYPE size_t
#else
#define FORSTR_STDARG_TYPE int
#endif
I infer from this thread that I should change this to __GNUC__ > 7 now.
Is this still the correct/best way to determine the hidden argument size?
(note that we're still using 4.x... ugh, don't ask... so the >6 check
hasn't actually been used yet, I just want to future-proof things as
much as possible without having to rewrite the entire Fortran <-> C
interface.)
Thanks...
-Bob
Bob Deen @ NASA-JPL Multmission Image Processing Lab
Bob.Deen@jpl.nasa.gov