On Tue, 20 Mar 2007, Oliver Neukum wrote:

> Hi,
> 
> from urb.c::usb_kill_urb():
> 
>       if (!(urb && urb->dev && urb->dev->bus))
>               return;
> 
> Is this safe from a compiler point of view?

Of course it is.

> Might a compiler actually evaluate the inner expression and then invert
> the result?

You mean, evaluate "(urb && urb->dev && urb->dev->bus)"?  Yes indeed, it
might.  But in the course of evaluating that inner expression, the
execution would stop as soon as it found that urb was NULL.  That's
guaranteed by the C language.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to