Path: utzoo!telly!ddsw1!mcdchg!rutgers!tut.cis.ohio-state.edu!UUNET.UU.NET!mcvax!litp!jdf From: mcvax!litp!jdf@UUNET.UU.NET (Jean-Daniel FEKETE) Newsgroups: gnu.gcc.bug Subject: gcc typecheck bug Message-ID: <8811210727.AA23168@litp.unip6-7.fr> Date: 21 Nov 88 07:27:43 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 56 The following code outputs a warning in gcc 1.30 : gcc -O -W -S foo.c ---------------------------------------------------------------------- typedef int func_typed(struct _object *); struct _object { func_typed *fn; }; typedef struct _object object; object o; int doit_on(obj) object *obj; { int b; b = (* o.fn)(obj); /* it says : warning: argument passing between incompatible pointer types */ bar(b); /* this is to avoid optimization maybe */ return b; } ---------------------------------------------------------------------- whereas the following does not: ---------------------------------------------------------------------- struct _object { int (* fn)(struct _object *); }; typedef struct _object object; object o; int doit_on(obj) object *obj; { int b; b = (* o.fn)(obj); bar(b); /* this is to avoid optimization maybe */ return b; } ---------------------------------------------------------------------- strange isn't it ? Jean-Daniel.