4.2 C bugs?

herndon at umn-cs.UUCP herndon at umn-cs.UUCP
Sun Mar 3 06:54:00 AEST 1985


  Does anyone know of a solution for the following problems?

   1)  The C compiler (4.2bsd) barfs on the following:
	void foo() {...}

	void blort() {...}

	void (*f[]) () = {
		foo,			/* Operands of = have incompat. types*/
		blort,			/* Ditto. */
		0
	}

     though it accepts:
        int foo() {...}

	int blort() {...}

	int (*f[])() = {
		foo,
		blort,
		0
	};
    This doesn't seem rational to me.  If I declare foo and blort
  in the first example to be integer, then it only gives me warnings.

   2) When I try to pass a union as an argument to a function
  (again, 4.2bsd), the C compiler usually works.  Unfortunately,
  it often doesn't work.  It frequently dies with no error
  message at all, or else a mysterious message to the effect
  of "Op STASHG missing from op-code table".  The unions in
  question all fit into one word.

  Are these really bugs, or am I missing something?



More information about the Comp.lang.c mailing list