2009-01-17 18:40:10

by Siarhei Siamashka

[permalink] [raw]
Subject: [PATCH] Coding style fixes

Hi,

This should make those who are pedantic about coding style a bit more happy ;)

And seriously, having "do { } while(0)" for a multiline macro is a must.


Best regards,
Siarhei Siamashka


Attachments:
(No filename) (192.00 B)
0001-Coding-style-fixes.patch (2.92 kB)
Download all attachments

2009-01-19 10:00:44

by Siarhei Siamashka

[permalink] [raw]
Subject: Re: [PATCH] Coding style fixes

On Sunday 18 January 2009 17:11:22 ext Luiz Augusto von Dentz wrote:
> Hi
>
> > And seriously, having "do { } while(0)" for a multiline macro is a must.
>
> Interesting, what does it do that { } doesn't?

By searching in the Internet it is possible to find some rationale for this:
http://vivekkutal.blogspot.com/2006/03/do-while0.html

Anyway, it is part of linux kernel CodingStyle

--
Best regards,
Siarhei Siamashka

2009-01-18 15:11:22

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH] Coding style fixes

Hi

> And seriously, having "do { } while(0)" for a multiline macro is a must.
Interesting, what does it do that { } doesn't?

--
Luiz Augusto von Dentz
Engenheiro de Computa??o

2009-01-18 15:09:54

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] Coding style fixes

Hi Siarhei,

> This should make those who are pedantic about coding style a bit more happy ;)
>
> And seriously, having "do { } while(0)" for a multiline macro is a must.

applied the patch. Thanks.

Regards

Marcel