-malign-double

Jed Brown jed at 59A2.org
Mon Nov 16 13:55:36 CST 2009


Barry Smith wrote:
> 
>   Jed,
> 
>    Seems ok to me. Feel free to update PETSc. (But I think PETSc style
> would detect that your PETSC_ALIGN() macro would be called
> PetscMemAlign() or something, we only use caps for macros that are fixed
> values, not for macros that like functions.)

Indeed (though there are a few exceptions).

Although stdint.h (which contains uintptr_t) is required by C99, I
suppose it's likely that it's broken somewhere.  On Win64, unsigned long
is not sufficient so we need unsigned long long (also required by C99,
but not in C++).  This is messy enough that we may as well work around
it by truncating the pointer into an unsigned, computing the shift, and
adding the shift through a (char*) cast.  Please speak up if uintptr_t
is actually reliable.  (I just require a C99 compiler and don't tolerate
non-compliance, but PETSc can't do that).

Jed

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20091116/900440f5/attachment.sig>


More information about the petsc-dev mailing list