Re: No enumeration data type in Fortran?



Richard E Maine wrote:

glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx> wrote:

I tried to find that in K&R2, but didn't see it. My guess is that a
compiler that makes one [enum] other than int won't work with a F2003
interop, though.

I don't know why. A lot of trouble was put into making f2003 so that it
would work with such. Some people think it was too much trouble for the
benefit (particularly when considering the observed paucity of C
compilers that don't make all enums int). I'm no fan of the feature, but
people who worked on it certainly were intending it to work with such
compilers, and they knew more about the subject than I did or do.

Well, the cases I was thinking of involve pass by reference, especially between Fortran and C. If you don't allow that, then I suppose there is no problem. C doesn't allow passing the address of a constant, so you
can't pass one by reference. Otherwise, having a constant a different
size than the corresponding variable gets things very confused.

-- glen
problem.

.



Relevant Pages

  • Re: GCC Hwoto tell the objects are not aligned
    ... alignment trap on IA64. ... Some compilers have extensions to support unknown alignment. ... and it costs no more than twice as much as a naturally-aligned reference. ... int get32; ...
    (comp.os.linux.development.apps)
  • Re: Why no/limited checking on enum values ?
    ... but compilers are always allowed to ... >An enum type is a symbolic name for an int. ... C89 standard appears to me to allow even "enum C" to use an unsigned ... standards do allow it, would not survive in the marketplace....) ...
    (comp.lang.c)
  • Re: No enumeration data type in Fortran?
    ... compiler that makes one [enum] other than int won't work with a F2003 ... A lot of trouble was put into making f2003 so that it ... compilers that don't make all enums int). ... compilers, and they knew more about the subject than I did or do. ...
    (comp.lang.fortran)
  • Re: a little mistake
    ... Also the use of "inline" for that function is redundant. ... compilers will do it anyways and it isn't portable across all compilers ... int main ... Calling function would be part of the users code. ...
    (comp.lang.c)
  • Re: It works without stdio.h !!
    ... most C compilers will assume that a function that has no prototype is an ... extern int, and since you only specify functions that live in the C library, an unresolved ... never declare a variable of type char unless you well and truly believe you need to be ... strcpy, strcat, sprintf etc. with it. ...
    (microsoft.public.vc.mfc)