Question about Hollerith formatting

Feng Wang wf_cs@yahoo.com
Sun Sep 11 10:14:00 GMT 2005


--- Paul Thomas <paulthomas2@wanadoo.fr> wrote:

> Tobi,
> 
> >
> > write (*,c) ! <- invalid
> > write (*,d) ! <- valid
> > write (*,d(1)) ! <- valid
> >and this is intentional, given the comments in the code.  I'm wondering, is
> >this really the way it is in legacy compilers?  Is this the way we want this
> >to be?
> >
> Intel only accepts the second; which seems logical to me.  The code 
> deliberately allows the third, does it not?

Yes. This just what I want. In fact, this is related with another legacy
feature - ASSIGN statement which could assign a format label to a scalar
integer variable. The integer variable can be used as format tag like this:

10 format ("...")
assign 10 to i
write (*, i)

So if the variable is a scalar, we only allow it to be of integer type or
character type and handle it as assinged integer i.e. it is not HOLLERITH
constant assigned.

The variable which is assigned an HOLLERITH constant can also be used as format
tag. We only allow it to be of array or element of array and handle it as
Hollerith constant.

> 
> >(I've never used hollerith formatting, and I didn't plan to learn about this
> >"feature", I came across this, when I had to rewrite the code to correctly
> >give an error for statements of the form
> >  PRINT (I+I)
> >and I tried to figure out what actually should be allowed.  Apart from this
> >minor annoyance, I have PR23420 fixed.)
> >
> I came across the "feature" on seeing the comments in the code; I 
> wondered what it could mean but had no desire to find out about 
> hollerith constants.
> 
> What do you say, Feng Wang?
> 

If you have to compile thousands of f77 legacy codes you will have desire :)


Best Regards,
Feng Wang

--
Creative Compiler Research Group,
National University of Defense Technology, China.


		
__________________________________ 
Meet your soulmate!
Yahoo! Asia presents Meetic - where millions of singles gather
http://asia.yahoo.com/meetic



More information about the Fortran mailing list