[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-xorg-devel
Subject: Remove declaration-after-statement C warning (was: [Xcb] Patch for compiler warnings in util-image)
From: Arnaud Fontaine <arnaud () andesi ! org>
Date: 2013-08-29 2:21:03
Message-ID: 871u5djkz4.fsf_-_ () duckcorp ! org
[Download RAW message or body]
Hello,
Cc'ing xorg-devel as -Wdeclaration-after-statement is actually defined
in xorg/util/macros.
Alan Coopersmith <alan.coopersmith@oracle.com> 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/
[Attachment #3 (text/x-diff)]
From 4b33b3ce5c1db33ebbf0cabb7f4e358d62d02cbf Mon Sep 17 00:00:00 2001
From: Arnaud Fontaine <arnau@debian.org>
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 <arnau@debian.org>
---
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
_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic