warnings when building zaphfc on amd64

Julien BLACHE jblache at debian.org
Sun Mar 2 10:06:27 UTC 2008


Tzafrir Cohen <tzafrir.cohen at xorcom.com> wrote:

Hi,

> I saw the following warnings warnings in the build log. They seem to me
> the result of somewhat sloppy code, but nevertheless harmless:

> /home/tzafrir/Proj/Alioth/pkg-voip/build-area/usr_src/modules/zaptel/kernel/zaphfc.c:806: warning: cast from pointer to integer of different size
> /home/tzafrir/Proj/Alioth/pkg-voip/build-area/usr_src/modules/zaptel/kernel/zaphfc.c:807: warning: cast from pointer to integer of different size
>
> 804                        "zaphfc: %s %s configured at mem %#x fifo %#x(%#x) IR    Q %d HZ %d\n",
> 805                         vendor_name, card_name,
> 806                        (u_int) hfctmp->pci_io,
> 807                        (u_int) hfctmp->fifos,
> 808                        (u_int) virt_to_bus(hfctmp->fifos),

It's not harmless. The address in the printk output will be truncated
to 32bit on a 64bit machines, which may or may not be a problem.

Pointers should be cast to unsigned long, not unsigned int, with a
format of %lx (%#lx here).

There's also the option of using %p as the format and removing the cast.

This type of warning on a 64bit arch is never harmless and must be
fixed.

JB.

-- 
 Julien BLACHE - Debian & GNU/Linux Developer - <jblache at debian.org> 
 
 Public key available on <http://www.jblache.org> - KeyID: F5D6 5169 
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 



More information about the Pkg-voip-maintainers mailing list