Re: [Linux-ia64] correct seg fault address on ia-64??

Andreas Schwab
2001-11-14T16:45:27Z

"Pereira, D LailaX E" <d.lailax.e.pereira@intel.com> writes:

|> /* Align to a multiple of page_size, assumed to be a power of two */
|> x = (int *)((long)(((int) (long)x + page_size-1) & ~(page_size-1)));

Never ever cast pointers to int! Modern C gives you all you need:
uintptr_t.

Andreas.

--
Andreas Schwab "And now for something
Andreas.Schwab@suse.de completely different."
SuSE Labs, SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5