Release
Barry Smith
bsmith at mcs.anl.gov
Tue Sep 25 20:52:30 CDT 2007
On Tue, 25 Sep 2007, Lisandro Dalcin wrote:
> On 9/22/07, Matthew Knepley <knepley at gmail.com> wrote:
> > What do you think about 2.4 in October? I really want to get the new
> > install out there.'
>
> I'm experimenting at home about a way to compile petsc with
> '-fstrict-aliasing', in order to follow C99 strict aliasing rules.
> However, If I am right, this requiered a new layout for PetscObect's
> structure (I basically followed the approach being used for Python
> 3.0). As a side effect, some very commonly used struct members (like
> 'comm', 'type_name', and 'prefix') have to be accessed by casting
> derived objecs as PetscObject, i.e.: Vec v; ((PetscObject)v)->comm.
>
Please explain in detail.
> I have also some problems when calling PetscObjectQueryFunction, as
> the compiler complains about strict aliasing rules, and I need to
> define an additional function pointer, get the function, and next cast
> to the a actual func. pointer to do the call. Not suure yet if this
> can be improved, perhaps a macro can help.
Yes this function pointer casting stuff is a royal pain and ugly.
>
> Is there any interest in this be completed? It's a nonsense?
Might be easier to just rewrite everything in C++. :-)
Barry
> In case
> you want me to continue this work, I will need a bit of help in a few
> places related to low-level calls related to sockets and sys calls.
>
>
More information about the petsc-dev
mailing list