qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/5] CODING_STYLE: add preprocessor rules


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH 1/5] CODING_STYLE: add preprocessor rules
Date: Sat, 14 Aug 2010 16:27:22 +0200

Am 13.08.2010 um 18:56 schrieb Blue Swirl:

+Use parenthesis when checking if a macro is defined, and use
+indentation to track nesting:
+
+#if defined(HAVE_POSIX_FALLOCATE) && !defined(HAVE_FALLOCATE)
+# define fallocate(a,ignored,b,c) posix_fallocate(a,b,c)
+#endif

This one is new, current code doesn't use indentation. Maybe it's
better to drop it.

Yes, please. While indentation is nice to read, it is patch-unfriendly.

Consider:

#ifdef SOMETHINGNEW
yay
#else // previous stuff follows

#if defined(OLDONE)
#  define one
#endif
foo
bar
#if defined(OLDTWO)
#  define two
#endif

#endif

Here, adding four lines would require to reindent six lines otherwise not changed, making merging and review harder.

Andreas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]