Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Aug 2006 11:41:34 +0500 (AZST)
From:      "Tofig Suleymanov" <tofik@oxygen.az>
To:        "Hans Petter Selasky" <hselasky@c2i.net>
Cc:        tofik@oxygen.az, freebsd-usb@freebsd.org
Subject:   Re: USB_ATTACH_SETUP macros question
Message-ID:  <38370.85.132.32.38.1155883316.squirrel@85.132.32.38>
In-Reply-To: <200608171534.53213.hselasky@c2i.net>
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> <200608171534.53213.hselasky@c2i.net>

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
> _______________________________________________
> freebsd-usb@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-usb
> To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org"
>
>

Thank you for usefull example.
Now it is clear to me.

Thank you,
Tofig Suleymanov




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?38370.85.132.32.38.1155883316.squirrel>