In article <[EMAIL PROTECTED]>, Poul-Henning Kamp <[EMAIL PROTECTED]> wrote: > > 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); > }
It's complaining because of the empty statement (";") in the if clause, I suppose. Does it shut up if you define the macros like this in the disabled case? #define DPRINTF(x) ((void)0) #define DPRINTFN(n,x) ((void)0) John -- John Polstra John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message