Removal of non-standard LONG() intrinsic

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Removal of non-standard LONG() intrinsic

Steve Kargl
As the rewriting of handling BOZ has commenced, I came
across this little issue.

9.1811 LONG' -- Convert to integer type
=======================================

_Description_:
     Convert to a 'KIND=4' integer type, which is the same size as a C
     'long' integer.  This is equivalent to the standard 'INT' intrinsic
     with an optional argument of 'KIND=4', and is only included for
     backwards compatibility.

Consider

#include <stdio.h>
int
main(void)
{
   int i;
   long j;
   printf("sizeof(int)  = %d\n", (int)sizeof(i));
   printf("sizeof(long) = %d\n", (int)sizeof(j));
   return 0;
}

On i585-*-freebsd,
% cc -o z a.c && ./z
./z
sizeof(int)  = 4
sizeof(long) = 4

On x86_64-*-freebsd,
% cc -o z a.c && ./z
./z
sizeof(int)  = 4
sizeof(long) = 8

I would like to remove this extension.  To do this, gfc_simplify_long(),
would be updated to issue an error that points to INT().

Is anyone going to heartburn over this?  If the answer is 'yes',
then please fix LONG().  If LONG() isn't fixed by the time my
WIP BOX patch is submitted, LONG() is gone.  

--
Steve