Date: Thu, 17 Aug 2006 15:34:51 +0200 From: Hans Petter Selasky <hselasky@c2i.net> To: freebsd-usb@freebsd.org, tofik@oxygen.az Subject: Re: USB_ATTACH_SETUP macros question Message-ID: <200608171534.53213.hselasky@c2i.net> In-Reply-To: <35146.85.132.32.38.1155817977.squirrel@85.132.32.38> References: <35069.85.132.32.38.1155816624.squirrel@85.132.32.38> <20060817121307.GA804@gremlin.foo.is> <35146.85.132.32.38.1155817977.squirrel@85.132.32.38>
next in thread | previous in thread | raw e-mail | index | archive | help
> > Made a little test which shows that this code is going to be executed only > once.How did i miss that :) Now the other question comes next: > Why don not we use just: > #define USB_ATTACH_SETUP \ > sc->sc_dev = self; \ > device_set_desc_copy(self, devinfo); \ > device_printf(self, "%s\n", devinfo); Because that is dangerous. Consider the following: if (1) USB_ATTACH_SETUP; What is the meaning of the statement above? What is going to get executed? --HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608171534.53213.hselasky>