[MOAB-dev] Incomplete types versus void * in ITAPS interfaces

Tim Tautges tautges at mcs.anl.gov
Sun Sep 7 10:42:28 CDT 2008


Interesting question, which I'm forwarding to the rest of the ITAPS 
interface group.  One question, would that require you to actually 
define the private structure, or just reference it?  The extra type 
checking would be very useful (and would be useful inside MOAB as well...).

- tim

Jed Brown wrote:
> Sorry if this is the wrong list for this, but why are all the opaque
> handles typedef'd to void * instead of incomplete types.  That is, why
> not something like
> 
>   typedef struct iBase_EntityHandle_Private *iBase_EntityHandle;
> 
> in order to get some extra type checking?  Correct existing code should
> not see any difference.  With this change, a possible logic error (using
> EntitySetHandle for an EntitySet) in the VisIt plugin would be caught by
> the compiler.
> 
> Jed

-- 
================================================================
"You will keep in perfect peace him whose mind is
   steadfast, because he trusts in you."               Isaiah 26:3

              Tim Tautges            Argonne National Laboratory
          (tautges at mcs.anl.gov)      (telecommuting from UW-Madison)
          phone: (608) 263-8485      1500 Engineering Dr.
            fax: (608) 263-4499      Madison, WI 53706




More information about the moab-dev mailing list