did old compilers give warning on &struct?

Henry Spencer henry at utzoo.uucp
Tue Nov 14 06:35:48 AEST 1989


In article <112 at bohra.cpg.oz> ejp at bohra.cpg.oz (Esmond Pitt) writes:
>Before structure name arguments => pass by reference was supported,
>structure name arguments were passed _by_value_...

Uh, I think you have this backward.  Passing a struct to a function is
done by value in modern C.  Back before this feature was introduced,
some compilers would implicitly turn a struct name into a pointer to
that struct, as still happens for arrays.  Some such compilers did
grumble about &array, and may well have done the same about &struct
(I don't remember for sure).
-- 
A bit of tolerance is worth a  |     Henry Spencer at U of Toronto Zoology
megabyte of flaming.           | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list