This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [gfortran] Problem parsing hexadecimal constants?
- From: Tobias dot Schlueter at Physik dot Uni-Muenchen dot DE
- To: "Ioannis E. Venetis" <iev at hpclab dot ceid dot upatras dot gr>
- Cc: fortran at gcc dot gnu dot org
- Date: Mon, 14 Nov 2005 14:26:52 +0100
- Subject: Re: [gfortran] Problem parsing hexadecimal constants?
- References: <43788EBF.7020906@hpclab.ceid.upatras.gr>
Quoting "Ioannis E. Venetis" <iev@hpclab.ceid.upatras.gr>:
> Firstly, let me say that I don't know that much about Fortran, but I use
> a source-code transformation tool that creates Fortran 77 code, which I
> feed to gfortran.
>
> During this last stage, gfortran seems to have some problems to parse
> hexadecimal constants. I managed to reduce the problem to this very
> simple code:
>
> TEST.f:
>
> PROGRAM HEX_TEST
>
> INTEGER(4) MASK
>
> MASK = 'c0'X
>
> END
>
> ~ $ gfortran -c TEST.f
> In file TEST.f:5
>
>
> MASK = 'c0'X
> 1
> Error: Unclassifiable statement at (1)
>
>
>
> If, however, I make the following change:
>
> MASK = X'c0'
>
> the program compiles correctly. I remember that I used this tool with
> g77 too and that I had no problem. Either form of a hexadecimal constant
> was accepted. The same holds for the Intel compiler.
>
> Is this a bug of gfortran or some kind of extension that is not supported?
The latter. Nevertheless, if g77 supports this, we should support this as well.
Can you please open a bug report?
Hexadecimal constants are only allowed inside DATA statements, even though the
extension of allowing them everywhere is common, and thus your source code
transformation tool should really be fixed.
- Tobi