svn commit: r224721 - head/sys/sys

Dimitry Andric dim at FreeBSD.org
Wed Aug 10 13:19:54 UTC 2011


On 2011-08-10 12:38, Alexander Best wrote:
...
> any reason {TIMEVAL,TIMESPEC}_TO_{TIMESPEC,TIMEVAL}()s code is being executed
> in a
>
> do { ... } while (0)
>
> conditional loop? both macros are also defined in crypto/openssh/defines.h and
> don't seem to need that extra one-time-loop.

It's a very common C idiom.  See:
http://stackoverflow.com/questions/154136/why-are-there-sometimes-meaningless-do-while-and-if-else-statements-in-c-c-macr


More information about the svn-src-head mailing list