Path: utzoo!utgpu!news-server.csri.toronto.edu!dgp.toronto.edu!flaps Newsgroups: comp.std.c From: flaps@dgp.toronto.edu (Alan J Rosenthal) Subject: Re: pointer to incomplete type? Message-ID: <1990Jun5.172727.10132@jarvis.csri.toronto.edu> References: <1680@mcrware.UUCP> Date: 5 Jun 90 21:27:27 GMT Lines: 18 jejones@mcrware.UUCP (James Jones) writes: >On computers for which pointers to different types don't have the same format, >how can one safely declare a pointer to an incomplete structure, union, or >enumerated type? I think "struct generic *" will work for structures on all compilers I've heard of. Strictly speaking, it's not legal, but I haven't heard of different kinds of structure pointers having different formats. Same for unions. For enumerated types, I don't think you can do it, although, again, they allocate int space on all compilers I've heard of. Anyway, except in the case of adding kludges to poorly written code, this should not be necessary. Just #include the correct header file, or if the type definition appears in a .c file, move it into a .h file and #include it in both .c files. ajr