bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] maintainer-makefile: add syntax check for useless ';;'


From: Jim Meyering
Subject: Re: [PATCH] maintainer-makefile: add syntax check for useless ';;'
Date: Thu, 4 Sep 2014 15:16:18 -0700

On Thu, Sep 4, 2014 at 12:18 PM, Eric Blake <address@hidden> wrote:
> Most instances of ;; in C code are mistakes, where the second
> semicolon is a no-op.  This rule tries to make it easy to flag
> the typos occuring at the end of a statement.  It intentionally
> does not flag for(;;) loops, and misses grammar problems in
> comments if the problem occurs in the middle of the line.
>
> Shell files (including configure.ac and Makefile.am, which can
> contain shell snippets) are too likely to use case statements
> where ;; is legitimate, so those are not scanned.
>
> * top/maint.mk (sc_prohibit_double_semicolon): New rule.
...
> +# Except for shell files and for loops, double semicolon is probably a 
> mistake
> +sc_prohibit_double_semicolon:
> +       @prohibit='; *;[        {} \]*(/[/*]|$$)'                       \
> +       in_vc_files='\.[chly]$$'                                        \
> +       exclude='for *\(.*\)'                                           \
> +       halt="Double semicolon detected"                                \
> +         $(_sc_search_regexp)

Looks good to me.  Thanks.



reply via email to

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