Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!cs.utexas.edu!usc!jarthur!uci-ics!gateway From: rfg@paris.ics.uci.edu (Ronald Guilmette) Newsgroups: comp.lang.c++ Subject: Compatibility of pointer-to-array types. Message-ID: <26067C8E.24412@paris.ics.uci.edu> Date: 20 Mar 90 18:55:11 GMT Organization: UC Irvine Department of ICS Lines: 32 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.