On Tue, 3 Apr 2007 21:32:39 +0200
Stefan Seyfried <[EMAIL PROTECTED]> wrote:

>  #define suspend_error(msg, args...) \
>  do { \
> -     fprintf(stderr, "suspend: " msg " Reason: %m\n", ## args); \
> +     fprintf(stderr, "%s: " msg " Reason: %m\n", my_name, ## args); \
>  } while (0); 

> > > > What is this do { } while (0); thing good for?  
> > > 
> > > gcc magic, there is a good reason for it (something about breaking build
> > > instead of misbehaving at runtime), but i always foreget it.  
> > 
> > http://kernelnewbies.org/FAQ/DoWhile0
> > 
> > BTW, the ending semicolon is not necessary.  
> 
> Yes. AFAICS it is even harmful, so i'll remove it in an extra commit.

If I read the FAQ above correctly the `do {} while (0);' thing is only
necessary if you want have more than one statement in your macro. It is
used to logically group stuff together. In this case it is unnecessary.

grts Tim

Attachment: signature.asc
Description: PGP signature

-------------------------------------------------------------------------
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
_______________________________________________
Suspend-devel mailing list
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to