rfg@paris.ics.uci.edu (Ronald Guilmette) (03/21/90)
Could someone please tell me where in the cfront manual it says that the
following code should get 4 errors (one on each assignment statement)?
I'm perfectly willing to accept that the "compatibility" rules that cfront
(2.0) is enforcing here are "good" and "proper", but I'd like to see these
rules clearly documented (if they are not already).
Also, the compatibility rules which are begin enforced in such cases
should probably be listed also as additional *incompatibilities* with
the C language. (I think that C compilers allow at least the first
two assignment statements shown below, and probably all four.)
(Note that g++ 1.37.1 doesn't flag *any* of these statements as errors.)
int (*ptr_to_array_of_ints) [];
int (*ptr_to_array_of_3_ints) [3];
int (*ptr_to_array_of_5_ints) [5];
void function_0 ()
{
ptr_to_array_of_ints = ptr_to_array_of_3_ints; // gets cfront error
ptr_to_array_of_3_ints = ptr_to_array_of_ints; // gets cfront error
ptr_to_array_of_3_ints = ptr_to_array_of_5_ints; // gets cfront error
ptr_to_array_of_5_ints = ptr_to_array_of_3_ints; // gets cfront error
}
// Ron Guilmette (rfg@ics.uci.edu)
// C++ Entomologist
// Motto: If it sticks, force it. If it breaks, it needed replacing anyway.