[petsc-dev] Forward declarations of types?

Barry Smith bsmith at mcs.anl.gov
Fri Feb 15 15:59:48 CST 2013


  Ok, I did an implementation with petscdrawtypes.h included by petscdraw.h, petscksp.h and petscsnes.h   not ideal (I hate having lots of little includes around) but it does keep the PetscDrawLG typedef out of petscys.h

   People ok with me pushing? 

   Barry

Currently only PetscDrawLG is in there, since that is the only one needed but others or all could be put there if desired.

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

> On Fri, Feb 15, 2013 at 3:38 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> 
> Heh, I thought I remembered that duplicate typedefs were invalid in C, but gcc happily compiled it without a warning. In fact, they _are_ allowed in C11, but not in our old, crusty version of C.
> 
> From the looks of it, the C forum never explicitly intended for it to be invalid, but as a consequence of the classification of typedef in C (typedef is classified differently in C++), it would have needed to be explicitly allowed. C11 added that clause.
> 
> http://stackoverflow.com/a/8595191/33208
> 




More information about the petsc-dev mailing list