cast to pointer from integer of different size

Peter Bergner bergner@vnet.ibm.com
Fri Sep 22 04:52:00 GMT 2006


On Thu, 2006-09-21 at 23:54 -0400, Jack Howarth wrote:
> Peter,
>     Wouldn't we want something like...

> 
> +#ifdef __powerpc64__
> +unsigned long FindTopOfStack(unsigned long stack_start) {
> +#else
>  unsigned long FindTopOfStack(unsigned int stack_start) {
> +#endif

Why have the #ifdef?  Why not just define it as:

unsigned long FindTopOfStack(unsigned long stack_start) {

for both 32-bit and 64-bit compiles?  It's not like you're
changing the size of stack_start for the 32-bit case, since
unsigned long and unsigned int are both 4 bytes for -m32.

Peter





More information about the Gcc mailing list