\"Vectorizing C compiler for the Cray\"
Mark Purtill
Purtill at MIT-MULTICS.ARPA
Sat Apr 13 09:47:41 AEST 1985
<Fnord>
>> A committee ... is implementing the full C language with one minor
>> modification. In order to have compatibility with Fortran all subroutine
>> parameters will be passed by address.
>(I just can't see how people can get so steamed
>up over such a slight modification)
People get upset about it because it's /NOT/ a slight modification.
The following sort of thing is very common in C
int
foo( arg)
int arg ;
{
for( ; arg <= 0 ; arg--){
/* do something */
}
}
main()
{
int arg ;
arg = 5 ;
foo( arg) ;
printf( "%d\n", arg) ;
}
In real C, this will print 5, because arg is passed by value. If you
instead pass arg by address, it will print 0, which is WRONG.
The main think, tho, is that this is a pointless change. You can either
add the "fortran" key-word (which some but not all C compilers have) to
the declaration, OR you can just use pointers where appropriate.
Mark
^.-.^ Purtill at MIT-MULTICS
((")) 2-032 MIT Cambrige MA 02139
More information about the Comp.lang.c
mailing list