Path: utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!MCC.COM!rfg From: rfg@MCC.COM (Ron Guilmette) Newsgroups: gnu.gcc.bug Subject: BUG(s) in GCC 1.35 - invisible parm types Message-ID: <8907031848.AA13157@pink.aca.mcc.com> Date: 3 Jul 89 18:48:55 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 83 In the following code fragment, all of the functions suffer from the same type of error, i.e. that they all declare their parameters in terms of structured types which cannot be used EXCEPT within the functions themselves (or perhaps just within their formal parameter lists). Unfortunately GCC 1.35/sun3 only flags the first three functions with warnings and doesn't even mention the other cases. I believe that all these cases should be considerd errors. At the very least, they should all ellicit warnings from the compiler. A good case can be made for errors, especially for the functions which are absolutely impossible to call (from outside). The ones that are impossible to call are the ones that use prototypes and also declare some parameter to be of a (hidden) struct or union type. ----------------------------------------------------------------------------- void function_1a1 (enum E_1a1 { Evalue_1a } p1) { /* ERROR */ p1 = p1; } void function_1a2 (struct S_1a2 { int Sfield_1a2; } p1) { /* ERROR */ p1 = p1; } void function_1a3 (union U_1a3 { int Ufield_1a3; } p1) { /* ERROR */ p1 = p1; } void function_1b1 (p1) enum E_1b1 { Evalue_1b1 } p1; /* ERROR */ { p1 = p1; } void function_1b2 (p1) struct S_1b2 { int Sfield_1b2; } p1; /* ERROR */ { p1 = p1; } void function_1b3 (p1) union U_1b3 { int Ufield_1b3; } p1; /* ERROR */ { p1 = p1; } void function_2a1 (enum { Evalue_2a1 } p1) { /* ERROR */ p1 = p1; } void function_2a2 (struct { int Sfield_2a2; } p1) { /* ERROR */ p1 = p1; } void function_2a3 (union { int Ufield_2a3; } p1) { /* ERROR */ p1 = p1; } void function_2b1 (p1) enum { Evalue_2b1 } p1; /* ERROR */ { p1 = p1; } void function_2b2 (p1) struct { int Sfield_2b2; } p1; /* ERROR */ { p1 = p1; } void function_2b3 (p1) union { int Ufield_2b3; } p1; /* ERROR */ { p1 = p1; } ----------------------------------------------------------------------------- // Ron Guilmette - MCC - Experimental Systems Kit Project // 3500 West Balcones Center Drive, Austin, TX 78759 - (512)338-3740 // ARPA: rfg@mcc.com // UUCP: {rutgers,uunet,gatech,ames,pyramid}!cs.utexas.edu!pp!rfg