-malign-double

Jed Brown jed at 59A2.org
Mon Nov 16 16:12:48 CST 2009


Barry Smith wrote:
> 
>    What about have configure look for uintptr_t  if it does not exist
> then have configure check if unsigned long long is large enough, if not
> try size_t otherwise barf?

You're right, the compiler will warn about casting the pointer to an
integer of different size, as in

char *Align(char *ptr) {
  unsigned low = 0xf & (unsigned)ptr;
  return ptr - low + ((low+0xf) & ~0xf);
}

although I think this is actually okay (we are explicitly truncating it
further, and I think it is guaranteed that the truncation preserves the
low byte).

By barf I assume you mean just skip the alignment fix-up.

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/76e6dfe1/attachment.sig>


More information about the petsc-dev mailing list