Is this a bug?

Rob Carriere rob at raksha.eng.ohio-state.edu
Fri Aug 31 16:15:38 AEST 1990


I have found what I suspect is a bug in the C compiler I am using, but I would
like confirmation before I start bad-mouthing.   :-)

I have code that looks like this:

typedef union ut { T1 e1; T2 e2 } ut;
void f( int const p1, ut const p2 );
void foo( void )
{
   int i;   ut u;
   ...
   f( i, u );      /* ERROR: typemismatch in parameter p2 in function f */
   ...
}

Calling it like so _does_ work

   f( i, *(ut const *)&u );

I cannot find anything in The Fine Manual that says I have to do acrobatics
like this.  Do I need to take reading 050, or does the compiler need glasses?
:-) 

The compiler claims ANSI C conformance.

SR
---



More information about the Comp.lang.c mailing list