Bruno Haible wrote:
...
>> Also, regarding the cpp indentation in stdio-read.c and stdio-write.c,
>> would you prefer to exempt those two files or to indent the offending
>> #undef directives?
>
> Code like
>
> char *
> gets (char *s)
> #undef gets
> {
> ...
> }
>
> has pretty much become an idiom in gnulib. I'd like to keep it as-is.
> Therefore, can you please exempt these two files as well?
I've exempted them:
>From 29757e0e9014e2b1ed26fac4228e849c3728bc32 Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email protected]>
Date: Tue, 5 Jul 2011 10:32:30 +0200
Subject: [PATCH] maint: exempt stdio-read.c and stdio-write.c from the cppi
check
* Makefile (sc_cpp_indent_check): Exempt stdio-read.c and stdio-write.c
per Bruno's request, to accommodate this idiom (no space after "#")
even when the function is inside an #if block:
char *
gets (char *s)
#undef gets
{
...
}
---
ChangeLog | 13 +++++++++++++
Makefile | 2 +-
2 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 88eca79..e56cd80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2011-07-05 Jim Meyering <[email protected]>
+
+ maint: exempt stdio-read.c and stdio-write.c from the cppi check
+ * Makefile (sc_cpp_indent_check): Exempt stdio-read.c and stdio-write.c
+ per Bruno's request, to accommodate this idiom (no space after "#")
+ even when the function is inside an #if block:
+ char *
+ gets (char *s)
+ #undef gets
+ {
+ ...
+ }
+
2011-07-04 Jim Meyering <[email protected]>
maint: indent with spaces, not TABs, and add a rule to check this
diff --git a/Makefile b/Makefile
index fcc73f6..4722647 100644
--- a/Makefile
+++ b/Makefile
@@ -105,7 +105,7 @@ sc_cpp_indent_check:
$$(cd ./modules; grep -ilrE '(meyering|blake)' .) \
| sort -u \
| grep '\.c$$' \
- | grep -v '/getloadavg\.c$$' \
+ | grep -vE '/(stdio-(read|write)|getloadavg)\.c$$' \
| xargs cppi -c
# Ensure that the list of symbols checked for by the
--
1.7.6.370.gfeac5