Date: Wed, 29 Jan 2003 10:00:18 +0100 From: Poul-Henning Kamp <phk@freebsd.org> To: current@freebsd.org Subject: Please don't define away DEBUGPRINTF and similar... Message-ID: <6474.1043830818@critter.freebsd.dk>
next in thread | raw e-mail | index | archive | help
I am currently letting FlexeLint loose on the kernel again, and I have turned my attention to a new warning from it: _ return (err); ../../../dev/usb/usb_subr.c 604 Warning 548: else expected Initally I ignored these warnings because the couple of them which I looked at were actually ok, but now that I looked through all of them I uncovered a couple of bugs which all follow the same pattern, which I think I can best illustrate by quoting a randomly chosen case: #ifdef USB_DEBUG #define DPRINTF(x) if (usbdebug) logprintf x #define DPRINTFN(n,x) if (usbdebug>(n)) logprintf x extern int usbdebug; #else #define DPRINTF(x) #define DPRINTFN(n,x) #endif [...] if (index == USB_UNCONFIG_INDEX) { /* We are unconfiguring the device, so leave unallocated. */ DPRINTF(("usbd_set_config_index: set config 0\n")); err = usbd_set_config(dev, USB_UNCONFIG_NO); if (err) DPRINTF(("usbd_set_config_index: setting config=0 " "failed, error=%s\n", usbd_errstr(err))); return (err); } Please be more careful. Here are the places this warning occurs in GENERIC: ../../../dev/amr/amr_cam.c 566 Warning 548: else expected ../../../dev/amr/amr_cam.c 629 Warning 548: else expected ../../../dev/amr/amr.c 515 Warning 548: else expected ../../../dev/em/if_em_hw.c 2166 Warning 548: else expected ../../../dev/em/if_em_hw.c 2237 Warning 548: else expected ../../../dev/usb/ums.c 594 Warning 548: else expected ../../../dev/usb/usb_subr.c 604 Warning 548: else expected ../../../dev/usb/usbdi.c 974 Warning 548: else expected ../../../dev/usb/usbdi.c 1034 Warning 548: else expected ../../../kern/kern_switch.c 448 Warning 548: else expected -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6474.1043830818>