[PATCH] PR 78534 Change character length from int to size_t

Bob Deen Bob.Deen@jpl.nasa.gov
Wed Jan 3 18:34:00 GMT 2018


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



More information about the Gcc-patches mailing list