bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] test-exclude.c: remove unmatched #endif


From: Jim Meyering
Subject: [PATCH] test-exclude.c: remove unmatched #endif
Date: Sun, 20 Feb 2011 20:24:22 +0100

I was surprised to find that a test did not compile.

This one was interesting in that it arose (I suspect)
due to the fact that code upon which the offending change
was based had misleadingly-indented cpp directives.
This is a good argument for requiring that all of gnulib,
even the tests, be checked for this issue (using GNU cppi, of course).
Back when coreutils used cvs, I enforced that policy with a commit hook.
I could do that now with git, if folks would like, though
it's probably better to just add a "make check" rule to start with.

Along those lines, I'm looking at making gnulib's cpp indentation
consistent, at least in parts I own.  Easiest would be to convert
all files, regardless of owner; would anyone prefer I *not* do that?
(exempting the usual files that are nominally sync'd from elsewhere)

To make all .c files consistent, we'd have to adjust 169 of them.
I ran this command to count offenders:

    git ls-files|grep '\.c$'|xargs cppi -l|wc -l

The list (minus 3 I've just adjusted) is included below.

The .h files are less important, IMHO.

cppi is here: http://git.savannah.gnu.org/cgit/cppi.git

Oh, and here's the patch for the compilation failure:

>From 52357e723c251f4a4d8d5ce93790d7c88885cde6 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 20 Feb 2011 20:02:10 +0100
Subject: [PATCH] test-exclude.c: remove unmatched #endif

* tests/test-exclude.c: Remove stray #endif, left over from
the change of a week ago.
---
 ChangeLog            |    6 ++++++
 tests/test-exclude.c |    1 -
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a52102c..289730a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,13 @@
+2011-02-20  Jim Meyering  <address@hidden>
+
+       test-exclude.c: remove unmatched #endif
+       * tests/test-exclude.c: Remove stray #endif, left over from
+       the change of a week ago.
+
 2011-02-19  Jim Meyering  <address@hidden>

        git-version-gen: skip "-dirty" check when appropriate
        * build-aux/git-version-gen: Don't run any git commands when the
        version string comes from .tarball-version.  Prior to this, we
        would run git update-index --refresh even from a just-unpacked
        tarball directory, and that could affect a .git/ directory in a
diff --git a/tests/test-exclude.c b/tests/test-exclude.c
index f0fb321..75d3b89 100644
--- a/tests/test-exclude.c
+++ b/tests/test-exclude.c
@@ -64,15 +64,14 @@ ARGMATCH_VERIFY (exclude_keywords, exclude_flags);
    thus must link with a definition of that function.  Provide it here.  */
 #ifdef ARGMATCH_DIE_DECL
 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
 #  define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
 # else
 #  define _GL_ATTRIBUTE_NORETURN /* empty */
 # endif
-#endif

 ARGMATCH_DIE_DECL _GL_ATTRIBUTE_NORETURN;
 ARGMATCH_DIE_DECL { exit (1); }
 #endif

 int
 main (int argc, char **argv)
--
1.7.4.1.16.g759e8

Here are gnulib's .c files for which cppi -c reports improper cpp indentation:

lib/alloca.c
lib/argp-fmtstream.c
lib/argp-fs-xinl.c
lib/argp-help.c
lib/argp-parse.c
lib/c-ctype.c
lib/canonicalize-lgpl.c
lib/csharpexec.c
lib/dup3.c
lib/execute.c
lib/fbufmode.c
lib/fchownat.c
lib/findprog.c
lib/flock.c
lib/fopen.c
lib/fpurge.c
lib/freadable.c
lib/freadahead.c
lib/freading.c
lib/freadptr.c
lib/freadseek.c
lib/fseeko.c
lib/fseterr.c
lib/fsync.c
lib/fts.c
lib/fwritable.c
lib/fwriteerror.c
lib/fwriting.c
lib/gc-gnulib.c
lib/get-rusage-as.c
lib/get-rusage-data.c
lib/getaddrinfo.c
lib/getdtablesize.c
lib/gethostname.c
lib/getloadavg.c
lib/getopt1.c
lib/getpass.c
lib/gettimeofday.c
lib/git-merge-changelog.c
lib/glob.c
lib/glthread/cond.c
lib/glthread/lock.c
lib/glthread/thread.c
lib/localename.c
lib/malloca.c
lib/mbrtowc.c
lib/openat-die.c
lib/parse-duration.c
lib/pipe-filter-gi.c
lib/pipe-filter-ii.c
lib/poll.c
lib/progreloc.c
lib/regcomp.c
lib/regex_internal.c
lib/regexec.c
lib/relocatable.c
lib/select.c
lib/setenv.c
lib/sigaction.c
lib/sigprocmask.c
lib/sleep.c
lib/spawn-pipe.c
lib/spawni.c
lib/stdio-write.c
lib/striconv.c
lib/striconveh.c
lib/strtod.c
lib/tsearch.c
lib/uname.c
lib/unicase/cased.c
lib/unicase/ignorable.c
lib/unicase/u8-casefold.c
lib/unicase/u8-tolower.c
lib/unicase/u8-totitle.c
lib/unicase/u8-toupper.c
lib/uniconv/u16-conv-to-enc.c
lib/unictype/pr_bidi_arabic_digit.c
lib/unictype/pr_bidi_arabic_right_to_left.c
lib/unictype/pr_bidi_block_separator.c
lib/unictype/pr_bidi_boundary_neutral.c
lib/unictype/pr_bidi_common_separator.c
lib/unictype/pr_bidi_embedding_or_override.c
lib/unictype/pr_bidi_eur_num_separator.c
lib/unictype/pr_bidi_eur_num_terminator.c
lib/unictype/pr_bidi_european_digit.c
lib/unictype/pr_bidi_hebrew_right_to_left.c
lib/unictype/pr_bidi_left_to_right.c
lib/unictype/pr_bidi_non_spacing_mark.c
lib/unictype/pr_bidi_other_neutral.c
lib/unictype/pr_bidi_pdf.c
lib/unictype/pr_bidi_segment_separator.c
lib/unictype/pr_bidi_whitespace.c
lib/unictype/pr_currency_symbol.c
lib/unictype/pr_decimal_digit.c
lib/unictype/pr_iso_control.c
lib/unictype/pr_join_control.c
lib/unictype/pr_line_separator.c
lib/unictype/pr_paragraph_separator.c
lib/unictype/pr_private_use.c
lib/unictype/pr_punctuation.c
lib/unictype/pr_space.c
lib/unictype/pr_titlecase.c
lib/unilbrk/u8-possible-linebreaks.c
lib/unilbrk/u8-width-linebreaks.c
lib/unilbrk/ulc-possible-linebreaks.c
lib/unilbrk/ulc-width-linebreaks.c
lib/uninorm/uninorm-filter.c
lib/unistr/u16-mbtouc-unsafe-aux.c
lib/unistr/u16-mbtouc-unsafe.c
lib/unistr/u32-mbtouc-unsafe.c
lib/unistr/u8-mblen.c
lib/unistr/u8-mbtouc-aux.c
lib/unistr/u8-mbtouc-unsafe-aux.c
lib/unistr/u8-mbtouc-unsafe.c
lib/unistr/u8-mbtouc.c
lib/unistr/u8-strmblen.c
lib/unistr/u8-strmbtouc.c
lib/unistr/u8-uctomb.c
lib/uniwbrk/u8-wordbreaks.c
lib/uniwbrk/ulc-wordbreaks.c
lib/unsetenv.c
lib/userspec.c
lib/vasnprintf.c
lib/vma-iter.c
lib/wait-process.c
lib/write.c
tests/test-cond.c
tests/test-duplocale.c
tests/test-fprintf-posix2.c
tests/test-iconv.c
tests/test-isfinite.c
tests/test-isinf.c
tests/test-isnan.c
tests/test-lock.c
tests/test-mbsnrtowcs.c
tests/test-mbsrtowcs.c
tests/test-parse-datetime.c
tests/test-poll.c
tests/test-posix_spawn3.c
tests/test-printf-posix2.c
tests/test-signbit.c
tests/test-stdint.c
tests/test-tls.c
tests/test-tsearch.c
tests/test-wcsnrtombs.c
tests/test-wcsrtombs.c
tests/uninorm/test-u16-nfc.c
tests/uninorm/test-u16-nfd.c
tests/uninorm/test-u16-nfkc.c
tests/uninorm/test-u16-nfkd.c
tests/uninorm/test-u32-nfc-big.c
tests/uninorm/test-u32-nfc.c
tests/uninorm/test-u32-nfd-big.c
tests/uninorm/test-u32-nfd.c
tests/uninorm/test-u32-nfkc-big.c
tests/uninorm/test-u32-nfkc.c
tests/uninorm/test-u32-nfkd-big.c
tests/uninorm/test-u32-nfkd.c
tests/uninorm/test-u32-normalize-big.c
tests/uninorm/test-u8-nfc.c
tests/uninorm/test-u8-nfd.c
tests/uninorm/test-u8-nfkc.c
tests/uninorm/test-u8-nfkd.c
tests/uniwidth/test-u16-width.c
tests/uniwidth/test-u32-width.c
tests/uniwidth/test-u8-width.c



reply via email to

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