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

Re: [Libguestfs] Remaining syntax-check errors

Richard W.M. Jones wrote:
> I've pushed 10 commits which just clean up errors found by 'make
> syntax-check'.  The remaining syntax-check errors are attached below.
> I think many of them are false alarms.

Hi Rich,

It's about half and half.

> php/README-PHP:33:    echo ("Error: ".guestfs_last_error ($g)."\n");
> php/README-PHP:44:    echo ("Error: ".guestfs_last_error ($g)."\n");
> php/extension/guestfs_php_002.phpt:15:  echo ("Error: ".guestfs_last_error ($g)."\n");
> php/extension/guestfs_php_002.phpt:19:  echo ("Error: ".guestfs_last_error ($g)."\n");
> php/extension/guestfs_php_002.phpt:24:  echo ("Error: ".guestfs_last_error ($g)."\n");
> php/extension/guestfs_php_003.phpt:29:  die ("Error: ".guestfs_last_error ($g)."\n");
> po-docs/ja.po:1559:"string into an errno, see the function error() in fuse/guestmount.c."
> po-docs/ja.po-25277-"force>)."
> po-docs/libguestfs-docs.pot:1500:"string into an errno, see the function error() in fuse/guestmount.c."
> po-docs/libguestfs-docs.pot-24824-"C<--resize-force>)."
> maint.mk: found error message ending in period
> make: *** [sc_error_message_period] Error 1

These are false positives.
You can disable this test (or any of them) altogether or add each
offending file name (as a regexp) to .x-sc_error_message_period, so
that they'll be exempted from the test.

> Makefile.am:104: 	  -e '/@ACTIONS@/rsrc/guestfs-actions.pod' \
> Makefile.am:105: 	  -e 's/@ACTIONS@//' \
> Makefile.am:106: 	  -e '/@AVAILABILITY@/rsrc/guestfs-availability.pod' \
> Makefile.am:107: 	  -e 's/@AVAILABILITY@//' \
> Makefile.am:108: 	  -e '/@STRUCTS@/rsrc/guestfs-structs.pod' \
> Makefile.am:109: 	  -e 's/@STRUCTS@//' \
> Makefile.am:120: 	  -e '/@ACTIONS@/rfish/guestfish-actions.pod' -e 's/@ACTIONS@//' \
> fish/Makefile.am:712: 	  -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
> po-docs/ja/Makefile.am:1667: 	  -e '/@ACTIONS@/rguestfs-actions.pod' \
> po-docs/ja/Makefile.am:1668: 	  -e 's/@ACTIONS@//' \
> po-docs/ja/Makefile.am:1669: 	  -e '/@AVAILABILITY@/rguestfs-availability.pod' \
> po-docs/ja/Makefile.am:1670: 	  -e 's/@AVAILABILITY@//' \
> po-docs/ja/Makefile.am:1671: 	  -e '/@STRUCTS@/rguestfs-structs.pod' \
> po-docs/ja/Makefile.am:1672: 	  -e 's/@STRUCTS@//' \
> po-docs/ja/Makefile.am:1683: 	  -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
> src/Makefile.am:2086: 	  -e '/@ACTIONS@/rguestfs-actions.pod' \
> src/Makefile.am:2087: 	  -e 's/@ACTIONS@//' \
> src/Makefile.am:2088: 	  -e '/@AVAILABILITY@/rguestfs-availability.pod' \
> src/Makefile.am:2089: 	  -e 's/@AVAILABILITY@//' \
> src/Makefile.am:2090: 	  -e '/@STRUCTS@/rguestfs-structs.pod' \
> src/Makefile.am:2091: 	  -e 's/@STRUCTS@//' \
> maint.mk: use $(...), not @...@
> make: *** [sc_makefile_at_at_check] Error 1

These are false positives, too.
You can obfuscate them so that the test no longer spots the "offense"
by inserting a pair of single quotes, e.g., after the first @:

> src/Makefile.am:2091: 	  -e 's/@''STRUCTS@//' \

> Can't open stat-macros.h: No such file or directory.
> daemon/guestfsd.c:# define O_CLOEXEC 0
> src/generator.ml:#define PRId64 \"lld\"
> src/generator.ml:#define PRIu64 \"llu\"
> maint.mk: define the above via some gnulib .h file
> make: *** [sc_prohibit_always-defined_macros] Error 1

After a change to gnulib just hours ago, O_CLOEXEC is now guaranteed
to be defined.  Just remove that #if..#define block.
Those PRI* symbols are guaranteed to be defined, too.

> prohibit_always_true_header_tests
> src/guestfs.c:41:#ifdef HAVE_ERRNO_H
> src/guestfs.c:53:#ifdef HAVE_SYS_SOCKET_H
> src/launch.c:41:#ifdef HAVE_ERRNO_H
> src/launch.c:53:#ifdef HAVE_SYS_SOCKET_H
> src/proto.c:41:#ifdef HAVE_ERRNO_H
> src/proto.c:53:#ifdef HAVE_SYS_SOCKET_H
> maint.mk: do not test the above HAVE_<header>_H symbol(s);\n  with the corresponding gnulib module, they are always true
> make: *** [sc_prohibit_always_true_header_tests] Error 1

These are obsolescent #ifdef HAVE_... tests.
Gnulib guarantees the presence of those headers, now -- assuming
you are using each associated module.
Just remove the #ifdefs.

> po-docs/ja.po:2456:"might be called indirectly from L<exit(3)>, which can cause unexpected "
> po-docs/libguestfs-docs.pot:2396:"might be called indirectly from L<exit(3)>, which can cause unexpected "
> src/guestfs.pod:1193:L<exit(3)>, which can cause unexpected problems in higher-level
> maint.mk: use EXIT_* values rather than magic number
> make: *** [sc_prohibit_magic_number_exit] Error 1

False positives.  Add regexps to .x-sc_prohibit_magic_number_exit to
exempt those files.

> prohibit_test_minus_ao
> appliance/init:13:if [ ! -L /etc/init.d/udev -a -x /etc/init.d/udev ]; then
> fuse/test-fuse.sh:43:if [ ! -x "$guestfish" -o ! -x "$guestmount" ]; then
> maint.mk: use "test C1 && test C2", not "test C1 -a C2"; use "test C1 || test C2", not "test C1 -o C2"
> make: *** [sc_prohibit_test_minus_ao] Error 1

Those are legitimate, since the -o and -a options have well-known
portability problems.

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