Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Oct 2002 20:26:27 -0400 (EDT)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        freebsd-arch@freebsd.org
Subject:   lp64 vs lp32 printf
Message-ID:  <15779.30643.68675.577669@grasshopper.cs.duke.edu>

next in thread | raw e-mail | index | archive | help

What's the accepted way to printf something (like sizeof()) which
boils down to "unsigned int" on x86 and "unsigned long" on the LP64
platforms?  

I'm trying to fix alpha LINT, which so far is mosly stuff like:

cc1: warnings being treated as errors
../../../dev/aic7xxx/aic79xx.c: In function `ahd_alloc':
../../../dev/aic7xxx/aic79xx.c:4208: warning: unsigned int format, different type arg (arg 3)
../../../dev/aic7xxx/aic79xx.c:4208: warning: unsigned int format, different type arg (arg 4)

        if ((ahd_debug & AHD_SHOW_MEMORY) != 0) {
                printf("%s: scb size = 0x%x, hscb size - 0x%x\n",
                       ahd_name(ahd), sizeof(struct scb),
                       sizeof(struct hardware_scb));
        }

I'm tempted to change the formats to 0x%lx and cast the args
to (unsigned long) and be done with it.  Is that correct?
%j and uintmax_t?


Thanks,

Drew

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15779.30643.68675.577669>