[comp.os.os9] inconsistent *** illegal type combination *** error

manning@halley.tmc.edu (Arthur T. Manning) (06/18/91)

cc68 doesn't behave consistently with types.  It will complain about
it in certain cases, but not in others due to nothing other than
THE ORDER OF OPERANDS.  cc68 is not comutative with == .

try this code:
/**************************************************************************/
/* test for bad type combination */

#include <stdio.h>

foo()
{
  FILE *fptr;

  fptr=fopen("badtype.c","r");

  if ( fptr == NULL )		/* no complaint here! */
    printf("couldn't open\n");

  if ( NULL == fptr )		/* cc68 complains about this line */
    printf("couldn't open\n");

}

/* cc68 output:
% cc68 -r badtype.c

'badtype.c'
cpp:
c68:
"badtype.c", line 15: ****  illegal type combination ****
  if ( 0 == fptr )
            ^
errors in compilation : 1
% 
****************************************************************************/



QED.

--
Arthur T. Manning   <manning@halley.est.3m.com>  
3M Center 518-1    St Paul MN  55144-1000        \___/______         
ph. 612 733-4401   fax 612 736-3122             __  / _ _ _  \
Allin1--> <MANNING @MRGATE @EST780>            (_/_/_/ / / /_/      <><

jejones@mcrware.UUCP (James Jones) (06/19/91)

In article <1991Jun18.123455.12845@mmm.serc.3m.com> manning@halley.tmc.edu (Arthur T. Manning) writes:
>cc68 doesn't behave consistently with types.  It will complain about
>it in certain cases, but not in others due to nothing other than
>THE ORDER OF OPERANDS.  cc68 is not comutative with == .
>try this code:

I did, and got no error message.  Information on edition numbers is useful when
reporting problems.  (For cross tools, I believe one can do something like
"strings c68 | grep sysedit".)

	James Jones