Hello,

Cc'ing xorg-devel as -Wdeclaration-after-statement is actually defined
in xorg/util/macros.

Alan Coopersmith <[email protected]> writes:

> On 08/23/13 01:04 AM, Arnaud Fontaine wrote:
>> Good to know, thanks! Does this mean -Wdeclaration-after-statement can
>> be removed from util/macros/xorg-macros.m4.in then? From my
>> understanding, AC_PROG_CC_C99 is already the default, so this should not
>> be an issue to remove this flag, right?
>
> If Xorg decides to update the common coding style to allow these, then
> yes - it's just a style guideline now, no longer a portability issue.

At least X server specifies some mandatory C extensions[0] (from [1]),
including interleaved code and declarations.

I guess this warning can be removed (feel free to correct me if I'm
wrong), so I have attached a patch for util/macros.

Cheers,
-- 
Arnaud Fontaine

[0] http://cgit.freedesktop.org/xorg/xserver/tree/doc/c-extensions
[1] http://www.x.org/wiki/CodingStyle/

>From 4b33b3ce5c1db33ebbf0cabb7f4e358d62d02cbf Mon Sep 17 00:00:00 2001
From: Arnaud Fontaine <[email protected]>
Date: Thu, 29 Aug 2013 11:06:14 +0900
Subject: [PATCH] Interleaved C code and declarations is no longer a
 portability issue.

This was only supported from GCC 3.0 and OpenBSD was still using GCC 2.95
until recently.

Signed-off-by: Arnaud Fontaine <[email protected]>
---
 xorg-macros.m4.in | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
index cd76fca..73be7c5 100644
--- a/xorg-macros.m4.in
+++ b/xorg-macros.m4.in
@@ -1622,7 +1622,6 @@ AC_LANG_CASE(
 		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
 		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
 		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
-		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
 	]
 )
 
-- 
1.8.3.1

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to