[petsc-dev] Forward declarations of types?

Barry Smith bsmith at mcs.anl.gov
Fri Feb 15 17:22:10 CST 2013


On Feb 15, 2013, at 4:39 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> 
> On Fri, Feb 15, 2013 at 4:27 PM, Matthew Knepley <knepley at gmail.com> wrote:
> I think we should just double all include files:
> 
>   petscksp.h
>   petsckspfwd.h
> 
> You don't have to know anything about petsc*fwd.h unless you
> want lightweight includes, and there is no way to misinterpret what it is.
> 
> petsc*fwd.h or petsc*types.h? Is there an established convention here?

  types has already been pushed and types it is.

Barrys-MacBook-Pro:src barrysmith$ ls /usr/include/*type*.h
/usr/include/_types.h            /usr/include/ecpgtype.h          /usr/include/lber_types.h         /usr/include/sqltypes.h
/usr/include/_wctype.h           /usr/include/inttypes.h          /usr/include/nl_types.h           /usr/include/runetype.h          /usr/include/wctype.h
/usr/include/ctype.h             /usr/include/isqltypes.h           /usr/include/sql3types.h
Barrys-MacBook-Pro:src barrysmith$ ls /usr/include/*fwd*.h
ls: /usr/include/*fwd*.h: No such file or directory

:-)

> 
> I agree that this makes the code much more systematic. It will impact users significantly if we apply this to Mat and Vec, but then include-what-you-use would work precisely.




More information about the petsc-dev mailing list