Date: Sun, 13 Dec 1998 21:16:43 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: committers@FreeBSD.ORG Subject: best way to fix function mismatch warning Message-ID: <199812140516.VAA25033@apollo.backplane.com>
next in thread | raw e-mail | index | archive | help
This warning occurs because the vxintr function does not match the
function type expected by pci_map_int. That is, because pci_map_int
expects a void func(void *) function and vxintr is a
void func(struct softc *).
So, to get rid of the warning do we (a) cast the function pointer
in the pci_map_int() call to the correct type or (b) make the function
(in dev/vx/*) take a void * and then reassign the variable to a pointer
of the right type inside it? Or (c) some other choice that I haven't
thought of ?
-Matt
Matthew Dillon Engineering, HiWay Technologies, Inc. & BEST Internet
Communications & God knows what else.
<dillon@backplane.com> (Please include original email in any response)
ialized -Wformat -fformat-extensions -ansi -nostdinc -I- -I. -I../.. -I../../../include -DKERNEL -include opt_global.h -aout ../../pci/if_vx_pci.c
../../pci/if_vx_pci.c: In function `vx_pci_attach':
../../pci/if_vx_pci.c:127: warning: passing arg 2 of `pci_map_int' from incompatible pointer type
:
:This is a bug in CVS
:under some circumstances it is impossible to get CVS to generate a correct
:DIFF
:
:you'll probably find a truncated line in the diff with the next line
:appended to the end of it, somewhere in that vicinity..
:
:
:
:On Sun, 13 Dec 1998, Gary Palmer wrote:
:
:> Matthew Dillon wrote in message ID
:> <199812122259.OAA03354@apollo.backplane.com>:
:> > While looking at PR bin/8962, I found that
:> > /usr/src/lib/libalias/alias_nbt.c is completely broken - it does no
:> > bounds checking whatsoever. None. Zilch.
:> >
:> > Below is a proposed diff, and after that is the complete file. I would
:> > appreciate it if someone looked over it. I cannot easily test it because
:> > I don't run NAT.
:> >
:> > Also: the formatting of the original source is phenominally aweful. I
:> > did not try to fix it completely, so don't post followups about the bad
:> > formatting please!
:>
:> Tried using the patch, but got:
:>
:> |Index: alias_nbt.c
:> |===================================================================
:> |RCS file: /home/ncvs/src/lib/libalias/alias_nbt.c,v
:> |retrieving revision 1.1
:> |diff -c -r1.1 alias_nbt.c
:> |*** alias_nbt.c 1998/05/24 03:03:10 1.1
:> |--- alias_nbt.c 1998/12/12 22:54:58
:> --------------------------
:> Patching file alias_nbt.c using Plan A...
:> Hunk #1 succeeded at 132.
:> Hunk #2 succeeded at 158.
:> Hunk #3 succeeded at 188.
:> Hunk #4 succeeded at 207.
:> Hunk #5 succeeded at 282.
:> Hunk #6 succeeded at 332.
:> Hunk #7 succeeded at 350.
:> Hunk #8 succeeded at 385.
:> Hunk #9 succeeded at 397.
:> Hunk #10 succeeded at 417.
:> Hunk #11 succeeded at 441.
:> Hunk #12 succeeded at 450.
:> Hunk #13 succeeded at 466.
:> Hunk #14 succeeded at 494.
:> Hunk #15 succeeded at 541.
:> Hunk #16 succeeded at 565.
:> Hunk #17 succeeded at 575.
:> patch: **** Premature "---" at line 739--check line numbers at line 693
:>
:>
:> The full version of the file seemed to compile though. Since I was the
:> originator, I'll test it out, but it doesn't core regularly enough for me to
:> say if it worked or not (i.e. I have no way of knowing if the patch fixed
:> anything or not). So you may want to go ahead and just commit it.
:>
:> Gary
:> --
:> Gary Palmer FreeBSD Core Team Member
:> FreeBSD: Turning PC's into workstations. See http://www.FreeBSD.ORG/ for info
:>
:>
:>
:
:
:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812140516.VAA25033>
