[libvirt] [PATCH 0/2] syntax check: doubled semicolon

As long as I'm on a syntax-check binge, finish off a task I started several weeks ago. Eric Blake (2): maint: update to latest gnulib maint: syntax check for double semicolons .gnulib | 2 +- cfg.mk | 8 ++++++++ src/xenconfig/xen_common.c | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) -- 1.9.3

The usual portability fixes; and this includes a fix that will avoid a false positive in a future syntax check. * .gnulib: Update to latest. Signed-off-by: Eric Blake <eblake@redhat.com> --- Hmm, I need to test with gcc 4.9 before pushing this patch; it passed on Fedora 20 with gcc 4.8.3, but with new warnings being added, I may need further patches to silence the new power of gcc. * .gnulib 2d28074...4738e5a (33):
error: drop spurious semicolon gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++ manywarnings: add GCC 4.9 warnings vasnprintf: fix bugs in width computation vasnprintf: Avoid signed/unsigned comparison warning. parse-datetime: Avoid signed/unsigned comparison warning qsort_r: new module, for GNU-style qsort_r vla: new module localename: make gl_locale_name_thread really thread-safe on Windows getpass: don't assume struct termios getdtablesize: fall back on sysconf (_SC_OPEN_MAX) vararrays: modernize AC_C_VARARRAYS for C11 relocatable-prog-wrapper: port gettext to OS X 10.8 + GCC 4.8.1 sys_select: fix FD_ZERO problem on Solaris 10 accept: document Solaris 10 type glitch extern-inline: port to FreeBSD, DragonFly autoupdate Use consistent style to check DEBUG macro in regex_internal.c openat-die: use _Noreturn markup test-open: port to cygwin, which lacks Fortify localename: Enforce declarations before statements. test-userspec: don't look up numeric user names localcharset, localename: MS-Windows support for non-default locales announce-gen: avoid failure when Digest::SHA is installed gettext: revert "update macros to version 0.19" regex: don't deref NULL upon heap allocation failure maint.mk: give projects more flexibilty in set_prog_name arguments regex: fix memory leak in compiler announce-gen: avoid perl warnings localename: avoid -Wsuggest-attribute={const,pure} warnings nl_langinfo: Fix last change. Define macros for glibc Sync up error.c with glibc
.gnulib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gnulib b/.gnulib index 2d28074..4738e5a 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit 2d280742a9e30088aa169f53353765d5daafe4c0 +Subproject commit 4738e5acde5e5b239605fd561ac4401f9b432ba6 -- 1.9.3

Commit 28de556 fixed some doubled semicolons, but failed to add a syntax check, and thereby missed another instance. This finishes the job (and also found an instance in gnulib, prior to the previous patch's submodule update). * cfg.mk (sc_prohibit_double_semicolon): New rule. * src/xenconfig/xen_common.c (xenFormatConfigCommon): Fix offender. Signed-off-by: Eric Blake <eblake@redhat.com> --- cfg.mk | 8 ++++++++ src/xenconfig/xen_common.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cfg.mk b/cfg.mk index 77f1868..0a4395b 100644 --- a/cfg.mk +++ b/cfg.mk @@ -803,6 +803,14 @@ sc_prohibit_semicolon_at_eol_in_python: halt="Don't use semicolon at eol in python files" \ $(_sc_search_regexp) +# Except for shell files and for loops, double semicolon is probably a mistake +sc_prohibit_double_semicolon: + @prohibit=';;' \ + in_files='\.[chx]$$' \ + exclude='for \(.*\)' \ + halt="Double semicolon detected" \ + $(_sc_search_regexp) + # mymain() in test files should use return, not exit, for nicer output sc_prohibit_exit_in_tests: @prohibit='\<exit *\(' \ diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c index accd25f..bab67de 100644 --- a/src/xenconfig/xen_common.c +++ b/src/xenconfig/xen_common.c @@ -2034,7 +2034,7 @@ xenFormatConfigCommon(virConfPtr conf, return -1; if (xenFormatCPUFeatures(conf, def, xendConfigVersion) < 0) - return -1;; + return -1; if (xenFormatCDROM(conf, def, xendConfigVersion) < 0) return -1; -- 1.9.3

On Thu, Sep 4, 2014 at 8:32 PM, Eric Blake <eblake@redhat.com> wrote:
Commit 28de556 fixed some doubled semicolons, but failed to add a syntax check, and thereby missed another instance. This finishes the job (and also found an instance in gnulib, prior to the previous patch's submodule update).
* cfg.mk (sc_prohibit_double_semicolon): New rule. * src/xenconfig/xen_common.c (xenFormatConfigCommon): Fix offender.
Signed-off-by: Eric Blake <eblake@redhat.com> --- cfg.mk | 8 ++++++++ src/xenconfig/xen_common.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/cfg.mk b/cfg.mk index 77f1868..0a4395b 100644 --- a/cfg.mk +++ b/cfg.mk @@ -803,6 +803,14 @@ sc_prohibit_semicolon_at_eol_in_python: halt="Don't use semicolon at eol in python files" \ $(_sc_search_regexp)
+# Except for shell files and for loops, double semicolon is probably a mistake +sc_prohibit_double_semicolon: + @prohibit=';;' \ + in_files='\.[chx]$$' \ + exclude='for \(.*\)' \ + halt="Double semicolon detected" \ + $(_sc_search_regexp) + # mymain() in test files should use return, not exit, for nicer output sc_prohibit_exit_in_tests: @prohibit='\<exit *\(' \ diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c index accd25f..bab67de 100644 --- a/src/xenconfig/xen_common.c +++ b/src/xenconfig/xen_common.c @@ -2034,7 +2034,7 @@ xenFormatConfigCommon(virConfPtr conf, return -1;
if (xenFormatCPUFeatures(conf, def, xendConfigVersion) < 0) - return -1;; + return -1;
if (xenFormatCDROM(conf, def, xendConfigVersion) < 0) return -1; -- 1.9.3
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
ACK -- Nehal J Wani

On 09/04/2014 09:55 AM, Nehal J Wani wrote:
On Thu, Sep 4, 2014 at 8:32 PM, Eric Blake <eblake@redhat.com> wrote:
Commit 28de556 fixed some doubled semicolons, but failed to add a syntax check, and thereby missed another instance. This finishes the job (and also found an instance in gnulib, prior to the previous patch's submodule update).
* cfg.mk (sc_prohibit_double_semicolon): New rule. * src/xenconfig/xen_common.c (xenFormatConfigCommon): Fix offender.
ACK
Actually, I'm going to post a v2 once the dust settles upstream; the gnulib folks liked my idea so much they asked for it to be included upstream into gnulib, with some slight changes: https://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00024.html which means I should just get it from gnulib instead of duplicating it into our cfg.mk. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Nehal J Wani