This is the mail archive of the
mailing list for the GCC project.
Re: RFC: patch to add ISO_FORTRAN_ENV intrinsic module
- From: Brooks Moses <bmoses at stanford dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: fortran at gcc dot gnu dot org
- Date: Thu, 26 Oct 2006 12:06:00 -0700
- Subject: Re: RFC: patch to add ISO_FORTRAN_ENV intrinsic module
- References: <firstname.lastname@example.org>
François-Xavier Coudert wrote:
-- I think CHARACTER_STORAGE_SIZE and FILE_STORAGE_SIZE have value 8
on all the systems we currently support. For NUMERIC_STORAGE_SIZE,
however, I'm not sure what to do. The standard says "The value of the
default integer scalar constant NUMERIC STORAGE SIZE is the size
expressed in bits of the numeric storage unit (188.8.131.52)." Then
184.108.40.206 says "A nonpointer scalar object of type default integer,
default real, or default logical occupies a single numeric storage
unit". Now the question is:
When the compiler is used with -fdefault-real-8 or -fdefault-integer-8
(but not both), what the heck should the value of NUMERIC_STORAGE_SIZE
Well, when the compiler is used with one or the other (but not both) of
those options, it's not a standard-comforming Fortran compiler, so the
standard is quite silent on the matter. The proper behavior is left up
to us as a matter of opinion.
Personally, since in that case NUMERIC_STORAGE_SIZE does not have any
consistent meaning, I'd prefer for any references to it to throw an
error. I imagine that throwing a specific descriptive error would be
difficult, but would it be possible to simply leave it undefined in that
case? If so, that would be my recommendation.
Alternately, I'd be tempted to give it some sort of obviously erroneous
value like -HUGE(1). I'm not convinced of the wisdom of that, though.
In any case, no matter what we do, any user code that uses it in that
sort of situation has at least a 50% chance of getting a wrong answer.
I think it's better to make the wrongness obvious, even at the expense
of losing the 50% of times that it happens by luck to do the right thing.