Specifying type of literal integer constants

From: André Janz (ALDUBOFMWIGO_at_spammotel.com)
Date: 02/11/04


Date: Wed, 11 Feb 2004 18:25:15 +0100

Hi,

I'm just trying to figure out if there is a way to specify the type of a
literal integer constant. I couldn't find anything definite on the web
nor in the Usenet archive.

The problem is the following:
An existing program accesses files through constant unit numbers
eg.
open(unit=9998,file='local',status='unknown')

When I try to compile the program on an Itanium 2 machine (64 bit) with
the 7.1 Intel Fortran compiler I get error messages about the use of flush:

---
       call flush(9994)
            ^
Error 260 at (489:userprog.f) : This subroutine has the wrong number of 
arguments or arguments with the wrong name, type or rank
---
(This only happens when I 'USE IFLPORT' which is probably 
Intel-specific. I'd like to keep this since it already provided some 
very useful diagnostics.)
What I would like to do is something similar to specifying a double 
precision constant as 1.d0. The compiler expects an INTEGER*4 value here.
Admittedly it would be good practice to use an integer variable for this 
purpose but I also get this problem when I write rand(0) and this is 
just ridiculous. (eg. integer*4 zero / zero=0 / dummy=rand(zero))
André


Relevant Pages

  • Re: Sweeney presentation "The Next Mainstream Language"
    ... Specify int to be more specific than real. ... possibly helped by programmer annotations or checks. ... test just before the access to make the compiler see that the index is ... he included compiler-checked manual region allocation in Cyclone. ...
    (comp.lang.functional)
  • Bounds checked arrays
    ... As everybody knows, the C language lacks ... When the state of this toggle is ON, the compiler ... Important is to know that the array updates ... We have just to allow him/her to specify what to do ...
    (comp.lang.c)
  • Re: Boolean Buyers Beware ... AIX compiler bug --- PMR 26241,756
    ... But the compiler does have other options for updating byte fields, ... I didn't bring the C++ standard into the discussion, ... C++ doesn't specify anything here, and still one needs multithreading. ...
    (comp.programming.threads)
  • Re: Bounds checked arrays
    ... > more at each array access will not make any ... > this problem in the C language to do their dirty ... > When the state of this toggle is ON, the compiler ... > We have just to allow him/her to specify what to do ...
    (comp.lang.c)
  • Re: In-Out Parameters for functions
    ... Ada, but you who didn't specify it. ... exemptions Ada leaves that to the compiler. ...
    (comp.lang.ada)