Jim Meyering [Tue, 16 Aug 2016 22:00:43 +0000 (15:00 -0700)]
dfa: new module, importing grep's DFA matcher
Since grep's DFA matcher is now being used by two gnulib-enabled
projects, grep and sed, it makes sense to version-control its
sources and unit tests in one place: here.
* modules/dfa: New module.
* modules/dfa-tests: New file.
* lib/dfa.c: New file, from grep.
* lib/dfa.h: Likewise.
* lib/localeinfo.c: Likewise.
* lib/localeinfo.h: Likewise.
* tests/dfa-match-aux.c: Likewise.
* tests/dfa-invalid-char-class.sh: Likewise.
* tests/dfa-match.sh: Likewise, with minor changes.
* MODULES.html.sh (Misc): Add "dfa" to this list.
Jim Meyering [Fri, 9 Sep 2016 22:46:53 +0000 (15:46 -0700)]
getprogname-tests: don't depend on assert-h
* modules/getprogname-tests (Depends-on): Remove assert-h.
It was not needed, and in fact would cause build failure for
coreutils on some systems. Reported by Assaf Gordon in https:
//lists.gnu.org/archive/html/coreutils/2016-09/msg00016.html
parse-datetime: restrict debug output to input string
* lib/parse-datetime.y (parse_datetime2): If we parse
all of the input but determine it's invalid, ensure
we don't output the now invalid input pointer.
This issue was seen with `date -d 'now +1'`.
Jim Meyering [Wed, 7 Sep 2016 14:57:47 +0000 (07:57 -0700)]
getprogname: port to systems with __argv (mingw, msvc)
* lib/getprogname.c (getprogname): Include "dirname.h" and use
last_component: more general than open coding it with hard-coded "/".
* lib/getprogname.h (getprogname): Prefer "char const *" consistently.
* modules/getprogname (Depends-on): Add dirname-lgpl.
(configure.ac): Check for __argv in <stdlib.h>.
* modules/getprogname-tests: New file.
* tests/test-getprogname.c: New file.
Suggested by Gisle Vanem in
https://lists.gnu.org/archive/html/bug-gnulib/2016-09/msg00014.html
Paul Eggert [Wed, 7 Sep 2016 09:01:42 +0000 (02:01 -0700)]
flexmember: port better to GCC + valgrind
With a char[] flexible array member in a struct with nontrivial
alignment, GCC-generated code can access past the end of the
array, because GCC assumes there are padding bytes to get the
struct aligned. So the common idiom of malloc (offsetof (struct
s, m), n) does not properly allocate an n-byte trailing member, as
malloc’s argument should be the next multiple of alignof (struct s).
See GCC Bug#66661: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66661
Although C11 apparently permits this GCC optimization (i.e., there
was a bug in Gnulib not in GCC), possibly this is a defect in C11.
See the thread containing:
https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00317.html
* lib/flexmember.h: New file.
* lib/fnmatch.c, lib/fts.c, lib/glob.c, lib/idcache.c:
* lib/localename.c, lib/time_rz.c:
Include flexmember.h.
* lib/fnmatch_loop.c (struct patternlist):
* lib/localename.c (struct hash_node):
Use FLEXIBLE_ARRAY_MEMBER.
* lib/fnmatch_loop.c (EXT):
* lib/fts.c (fts_alloc):
* lib/glob.c (glob_in_dir):
* lib/idcache.c (getuser, getuidbyname, getgroup, getgidbyname):
* lib/localename.c (gl_lock_define_initialized):
* lib/time_rz.c (tzalloc):
Use FLEXSIZEOF instead of offsetof.
* m4/flexmember.m4 (AC_C_FLEXIBLE_ARRAY_MEMBER):
Check that the size of the struct can be taken.
* modules/flexmember (Files): Add lib/flexmember.h.
* modules/fnmatch, modules/glob, modules/localename (Depends-on):
Add flexmember.
Paul Eggert [Wed, 7 Sep 2016 06:56:26 +0000 (23:56 -0700)]
getprogname: port to Solaris 10
* lib/getprogname.c: Include stdlib.h, for getexecname decl.
(getprogname) [HAVE_GETEXECNAME]: Use that, for Solaris 10.
* m4/getprogname.m4 (gl_FUNC_GETPROGNAME): Check for getexecname.
Paul Eggert [Tue, 6 Sep 2016 21:26:05 +0000 (14:26 -0700)]
stdalign: correct mistake in alignof doc
Problem reported by Joseph Myers in:
https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00340.html
* doc/posix-headers/stdalign.texi: Do not imply that C11 prohibits
alignof(S) where S is a structure containing a flexible array
member. The Gnulib substitute does not support this, but C11 does.
Jim Meyering [Tue, 6 Sep 2016 04:40:57 +0000 (21:40 -0700)]
getprogname.h: declare with _GL_ATTRIBUTE_PURE, when required
* lib/getprogname.h (getprogname) [HAVE_DECL_PROGRAM_INVOCATION_NAME]:
Declare with _GL_ATTRIBUTE_PURE, to avoid warning from gcc's
-Wsuggest-attribute=pure
Pino Toscano [Thu, 18 Aug 2016 13:18:25 +0000 (15:18 +0200)]
main.mk: remove sc_program_name
There is no more need to use set_program_name in tools (getprogname
is enough for most of the cases).
* cfg.mk (local-checks-to-skip): Remove sc_program_name.
* top/maint.mk (sc_program_name): Remove.
Pino Toscano [Thu, 18 Aug 2016 13:18:23 +0000 (15:18 +0200)]
Port modules to use getprogname explicitly
... instead of requiring progname to be used (or program_name to be
provided).
* lib/argmatch.c: Do not include progname.h.
[TEST] (program_name): Do not define.
[TEST] (main): Call getprogname instead of using program_name.
* lib/c-stack.c: Do not include progname.h.
(program_name): Do not define.
(die): Call getprogname instead of using program_name.
* lib/chdir-long.c: Do not include progname.h.
[TEST_CHDIR] (main): Do not set program_name.
* lib/error.c [!_LIBC]: Include progname.h.
[!_LIBC] (program_name): Define using getprogname.
* lib/euidaccess.c: Do not include progname.h.
[TEST] (main): Do not set program_name.
* lib/git-merge-changelog.c: Include getprogname.h instead of
progname.h.
(usage): Call getprogname instead of using program_name.
(main): Likewise. Stop calling set_program_name.
* lib/group-member.c: Do not include progname.h.
[TEST] (main): Do not set program_name.
* modules/argmatch (Depends-on): Add getprogname.
* modules/c-stack (Depends-on): Likewise.
* modules/error (Depends-on): Likewise.
* modules/git-merge-changelog (Depends-on): Likewise.
Also remove progname.
Pino Toscano [Thu, 18 Aug 2016 13:18:22 +0000 (15:18 +0200)]
getprogname: new module
This provides a LGPL module for getting the name of the current
program, using the same API found on *BSD systems.
* lib/getprogname.c, lib/getprogname.h, m4/getprogname.m4:
* modules/getprogname: New files.
* MODULES.html.sh (Misc): Add getprogname.
* NEWS: Document the deprecation of the 'progname' module.
Jim Meyering [Fri, 2 Sep 2016 16:16:16 +0000 (09:16 -0700)]
manywarnings: add -fno-common
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -fno-common
to the list. Quoting the manual, "Compiling with -fno-common is
useful on targets for which it provides better performance, or if
you wish to verify that the program will work on other systems that
always treat uninitialized variable declarations this way [putting
it in the data section]." If diffutils had been using this sooner,
it would have prevented this duplicate declaration issue:
http://git.sv.gnu.org/cgit/diffutils.git/commit/?id=v3.4-10-gc2dc91f
Paul Eggert [Tue, 30 Aug 2016 19:29:21 +0000 (12:29 -0700)]
intprops: tune INT_NEGATE_OVERFLOW for GCC 5 and 6
* lib/intprops.h (INT_NEGATE_OVERFLOW): Tune for platforms like
GCC 5 and 6 that have __builtin_sub_overflow but not
__builtin_sub_overflow_p. With the recent changes, these
platforms are a tiny bit faster with the INT_NEGATE_RANGE_OVERFLOW
implementation than with INT_SUBTRACT_OVERFLOW implementation,
since the former needs just one runtime comparison whereas the
latter needs two.
Paul Eggert [Tue, 30 Aug 2016 15:23:44 +0000 (08:23 -0700)]
strverscmp: sync with glibc
Although this doesn't exactly synchronize with glibc
byte-for-byte, it makes the code behave the same as glibc.
* lib/strverscmp.c (S_I, S_F, S_Z): Now masks, not powers of 2.
(ISDIGIT): Remove, as glibc is sticking with isdigit, and the
difference shouldn't matter in practical use. All uses changed
back to isdigit.
(__strverscmp, strverscmp): Use new glibc method for weak aliases.
(next_state): Now unsigned char array; redo elements.
(result_type): Now signed char array; redo elements.
(__strverscmp): Fix glibc bug 9913 by using new states.
* tests/test-strverscmp.c (main): Test glibc bug 9913.
Paul Eggert [Mon, 29 Aug 2016 19:03:51 +0000 (12:03 -0700)]
intprops.h: port recent changes to GCC 6.2.0
* lib/intprops.h (__has_builtin): Move earlier.
(_GL_HAS_BUILTIN_OVERFLOW): Rename from
_GL_HAS_BUILTIN_OVERFLOW_WITH_NULL and don't worry about whether
the last argument can be null. All uses changed.
(_GL_HAS_BUILTIN_OVERFLOW_P): Also test __has_builtin.
(_GL_ADD_OVERFLOW, _GL_SUBTRACT_OVERFLOW, _GL_MULTIPLY_OVERFLOW):
Don't try to use 3rd arg null, as this doesn't work on GCC 6.2.0
and it's not clear which GCC versions it works for.
(_GL_INT_OP_WRAPV): Use _GL_HAS_BUILTIN_OVERFLOW instead of
its definiens.
Paul Eggert [Mon, 29 Aug 2016 17:08:32 +0000 (10:08 -0700)]
intprops.h: use __typeof__ with GCC 7
* lib/intprops.h (_GL_ADD_OVERFLOW, _GL_SUBTRACT_OVERFLOW)
(_GL_MULTIPLY_OVERFLOW): Use __typeof__ as in the GCC manual.
This avoids computing the expression's value (which might overflow!).
Jim Meyering [Mon, 29 Aug 2016 16:45:18 +0000 (09:45 -0700)]
intprops.h, xalloc-oversized.h: work with gcc 7
In gcc 6, __builtin_add_overflow, __builtin_sub_overflow and
__builtin_mul_overflow each accept a NULL pointer as the third
argument. However in gcc 7, that is no longer accepted.
Instead, one must use the "_p"-suffixed names, with which, the
third parameter is no longer a pointer.
* lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW_WITH_NULL): Correct
the definition: not true for gcc 7 and subsequent.
(_GL_HAS_BUILTIN_OVERFLOW_P): Define.
(_GL_ADD_OVERFLOW, _GL_SUBTRACT_OVERFLOW, _GL_MULTIPLY_OVERFLOW):
Provide new definitions for gcc 7 and subsequent.
* lib/xalloc-oversized.h (xalloc_oversized): Provide a definition
that works with gcc-7.
Paul Eggert [Thu, 25 Aug 2016 03:48:32 +0000 (20:48 -0700)]
intprops: port to OpenVMS
Problem reported by John E. Malmberg in: https://bugs.gnu.org/24300
* doc/posix-headers/limits.texi: Document the problem.
* lib/intprops.h (LLONG_MAX, LLONG_MIN) [__INT64_MAX]:
Define if not already defined.
Assaf Gordon [Mon, 15 Aug 2016 01:29:50 +0000 (21:29 -0400)]
parse-datetime: improve debug implementation
Follow-up to commit 12ad79069 ("add optional debug printing").
Improve parse-datetime's debug implementation: remove macros,
replace global debug flag variable with a function parameter,
use nstrftime for formatting.
See: https://lists.gnu.org/archive/html/bug-gnulib/2016-08/msg00021.html
* lib/parse-datetime.h: (parse_datetime_debug): Remove global extern
declaration.
(parse_datetime2): New function, accepts 'flags' parameter, supporting
debug flag. Existing interface 'parse_datetime' left unmodified.
* lib/parse-datetime.c: (parse_datetime_debug): Remove global variable.
(struct parser_control): add 'parse_datetime_debug' member variable.
(parse_datetime): Call new function 'parse_datetime2' without debug.
(parse_datetime2): Adapted from previous 'parse_datetime', initialize
pc.parse_datetime_debug variable as needed.
(to_year): Accept new flags parameter, instead of using global variable.
(debug_print_current_time,debug_print_relative_time,debug_mktime_not_ok):
use struct 'debug' variable instead of global variable.
(DEBUG,DEBUG_PRINT_CURRENT_TIME,DEBUG_PRINT_RELATIVE_TIME,
DEBUG_MKTIME_NOT_OK,PROGRESS,PROGRESS0): Remove macros. Call
correspnding functions directly instead of using macros.
* modules/parse-datetime: Add gnulib's strftime module.
Paul Eggert [Thu, 18 Aug 2016 18:56:07 +0000 (11:56 -0700)]
canonicalize-lgpl: fix errno after malloca fails
This fixes a typo I recently introduced. Suggested by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-08/msg00039.html
* lib/canonicalize-lgpl.c (__realpath):
Don't assume malloca sets errno on failure.
Daniel Richard G [Wed, 17 Aug 2016 23:57:35 +0000 (16:57 -0700)]
maint: port tests to z/OS errno behavior
* tests/test-nonblocking-reader.h:
* tests/test-nonblocking-writer.h:
Accommodate z/OS errno code preferences. (I believe this should
still be within spec; IBM is good at following the letter if not
the spirit of such things.)
Daniel Richard G [Wed, 17 Aug 2016 23:09:38 +0000 (16:09 -0700)]
fclose, strstr-simple, wchar: port to z/OS
* m4/fclose.m4, m4/strstr.m4, m4/wchar_h.m4:
Changes to the Autoconf M4 code to support z/OS. Note that
fclose() is broken in a different way on z/OS than it is on other
systems, thus the special-case in fclose.m4.
Daniel Richard G [Wed, 17 Aug 2016 23:05:02 +0000 (16:05 -0700)]
iconv_open-utf-tests, iconv-tests: port to EBCDIC
* tests/test-iconv-utf.c, tests/test-iconv.c:
Added appropriately conditional #pragmas so that the test strings
in test-iconv-utf.c are correctly interpreted in ASCII instead of
EBCDIC (i.e. 'J' == 0x4A and not 0xD1). This issue could be
addressed in a more portable way by simply rewriting all the ASCII
literal characters as octal escapes, but then you would lose the
partial readability that the strings have now. Also, iconv_open()
on z/OS does not recognize "ISO-8859-1", but "ISO8859-1" works.
Paul Eggert [Wed, 17 Aug 2016 22:33:06 +0000 (15:33 -0700)]
stdbool: don't require _Bool for C++
Problem reported by David Seifert in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-06/msg00005.html
* NEWS, doc/posix-headers/stdbool.texi (stdbool.h): Document this.
* m4/stdbool.m4 (AC_CHECK_HEADER_STDBOOL): Make the check
more-forgiving for C++, in that it requires only 'bool'. Be a bit
stricter about checking that bool and _Bool are compatible in C.
Paul Eggert [Wed, 17 Aug 2016 22:01:50 +0000 (15:01 -0700)]
getdelim: remove dependency on realloc-posix
* lib/canonicalize-lgpl.c (alloc_failed)
[!FUNC_REALPATH_WORKS || defined _LIBC]: New function,
(__realpath) [!FUNC_REALPATH_WORKS || defined _LIBC]: Use it.
Use __set_errno where needed, for consistency.
* lib/getdelim.c (alloc_failed): New function.
(getdelim): Use it.
* modules/getdelim (Depends-on): Remove realloc-posix.
Assaf Gordon [Sun, 7 Aug 2016 00:08:32 +0000 (20:08 -0400)]
parse-datetime: add optional debug printing
Print parsing information, warnings, and errors to stderr.
* lib/parse-datetime.h (parse_datetimte_debug): New global variable.
* lib/parse-datetime.y:
(DEBUG_*): Macros calling debug functions if debugging is enabled.
(PROGRESS*): Same as DEBUG, for progress reporting.
(dbg_printf): Print message to stderr, with 'date' prefix.
(struct parser_control): Add 'debug_*_seen' variables.
(str_days): Converts day ordinal/number to string (e.g. 'last wed').
(debug_print_current_time, debug_print_relateive_time): Prints the
current/relative date/time value of parser_control.
(YACC parser syntax): Print parsed parts with DEBUG_* macros.
(to_year): Warn about 2-digit year parsing.
(yylex): Warn about unrecognized words.
(get_effective_timezone): Returns current timezone in minutes.
(debug_strf{time,date,datetime}): Convert 'struct tm' to string as
clearly and unambigiously as possible.
(debug_mktime_not_ok): Print detailed information about failed
date/time values.
(parse_datetime): Add DEBUG messages for failures, warnings. Add
PROGRESS messages for status messages.
* modules/parse-datetime: Add 'timegm', 'gettext-h' dependencies.
Jim Meyering [Mon, 1 Aug 2016 16:37:15 +0000 (09:37 -0700)]
tests/init.sh: exclude dash with bad "local" semantics
* tests/init.sh (gl_shell_test_script_): Add a function to
eliminate a shell like "dash" (unlike bash, zsh) that has
surprising/risky "local var='...'" semantics. Inspired by
the problem and discussion in https://bugs.gnu.org/24116#11.
Ján Tomko [Tue, 2 Aug 2016 13:41:13 +0000 (15:41 +0200)]
maint.mk: expand the prohibit_doubled_word regex
This check has a static list of words that are checked for
repetitions. Expand it before running the perl script to
avoid using expensive captures. This decreases the cost
for libvirt from 1.66s to 0.66s.
* top/maint.mk (prohibit_doubled_word_expanded_): Define.
(sc_prohibit_doubled_word): Use it.
Ján Tomko [Mon, 1 Aug 2016 17:54:47 +0000 (10:54 -0700)]
useless-if-before-free: skip non-matching lines early
* build-aux/useless-if-before-free: First match each line with the
simple/quick /\bif\b/ and reject if there is no match. This often
saves the cost of the much more involved regular expression.
For libvirt, this decreases the cost from 1.44s to 1.02s.
Ján Tomko [Sat, 30 Jul 2016 05:39:31 +0000 (22:39 -0700)]
maint.mk: speed up sc_po_check
sc_po_check would skip files based on their names, or on the
existence of files with derived names. Rewrite it to use perl
instead of shell to make the check faster.
* top/maint.mk (perl_translatable_files_list_): Define.
(sc_po_check): Use it.
Ján Tomko [Tue, 26 Jul 2016 14:28:16 +0000 (16:28 +0200)]
maint.mk: speed up require_config_h_first
Instead of spawning three processes per file,
rewrite the check in perl and run it once for all the files.
* top/maint.mk (perl_config_h_first_): Define.
(sc_require_config_h_first): Use it in place of shell code.
Ján Tomko [Sat, 30 Jul 2016 05:39:31 +0000 (22:39 -0700)]
maint.mk: speed up sc_po_check
sc_po_check would skip files based on their names, or on the
existence of files with derived names. Rewrite it to use perl
instead of shell to make the check faster.
* top/maint.mk (perl_translatable_files_list_): Define.
(sc_po_check): Use it.
Paul Eggert [Fri, 15 Jul 2016 08:35:22 +0000 (10:35 +0200)]
obstack: pacify GCC 6 with -Wnull-dereference
Problem reported by Assaf Gordon in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-07/msg00028.html
* lib/obstack.c, lib/obstack.h (obstack_alloc_failed_handler):
Declare with __attribute_noreturn__.
* lib/obstack.h (__attribute_noreturn__): New macro.
Commit 54615b95ff238e235e806855efc46a9abad09f2e changed the regular
expression for detecting C symbol prefixes but forgot to qoute square
brackets in the command line arguments for grep. That way when
building with mingw the condition was false although it ought to be
true instead. In particular scenarios this led to the following
compile error:
Cannot export rpl_printf: symbol not found
Cannot export rpl_scanf: symbol not found
collect2: error: ld returned 1 exit status
Pádraig Brady [Wed, 22 Jun 2016 12:49:53 +0000 (13:49 +0100)]
fts: handle readdir() errors
* lib/fts.c (fts_build): readdir(3) returns NULL when finished,
but also upon error when it will also set errno. Therefore
flag the error case from readdir(). We treat the case where
no items are read the same as if the dir can't be accessed,
i.e. by setting fts_errno to FTS_DNR.
The bug was initially reported by Peter Benie
http://bugzilla.opensuse.org/show_bug.cgi?id=984910
where it was mentioned that readdir() may fail
when an NFS server has a poor readdir cookie implementation.
Paul Eggert [Fri, 24 Jun 2016 11:35:12 +0000 (13:35 +0200)]
intprops: port better to GCC 7
GCC 7 __builtin_add_overflow supports a new usage form, where the
last argument is a null pointer, and which merely returns 1 if an
overflow would occur. This is a constant expression if all
arguments are constants, and should generate faster code when code
needs to be generated.
* lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW_WITH_NULL): New macro.
(_GL_ADD_OVERFLOW, _GL_SUBTRACT_OVERFLOW, _GL_MULTIPLY_OVERFLOW):
Use builtin operations if available.
(INT_NEGATE_OVERFLOW): Prefer INT_SUBTRACT_OVERFLOW if builtin
operations are available, as it's almost surely faster.
Paul Eggert [Mon, 13 Jun 2016 18:17:03 +0000 (11:17 -0700)]
xalloc-oversized: port to GCC 7; fewer warnings
GCC 7 will have a better way to deal with integer overflow.
Plus, fix a warnings problem reported by Tim Ruehsen in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-06/msg00022.html
* lib/xalloc-oversized.h (__xalloc_oversized): New macro.
(xalloc_oversized): Use plain __builtin_mul_overflow if GCC 7 or later.
For GCC 5, use __xalloc_oversized if both args are constants,
or if pedantic.
Paul Eggert [Wed, 8 Jun 2016 08:46:35 +0000 (01:46 -0700)]
regex: port to Sun C
Reported by Daiki Ueno.
* lib/regcomp.c (regcomp, regerror): Use _Restrict_, not
__restrict, in prototype. This fixes a problem I introduced in
the 2016-02-19 merge from glibc.
Bruno Haible [Sun, 29 May 2016 10:54:32 +0000 (12:54 +0200)]
secure_getenv: Port to many more platforms.
* m4/secure_getenv.m4 (gl_PREREQ_SECURE_GETENV): Also check for get*id
functions.
* lib/secure_getenv.c (secure_getenv): Add alternate implementations
for non-BSD Unix platforms and for native Windows.
* doc/glibc-functions/secure_getenv.texi: Remove known issue.
Prompted by a request from Nikos Mavrogiannopoulos.
Eric Blake [Thu, 26 May 2016 14:47:27 +0000 (08:47 -0600)]
unsetenv: relax to LGPLv2+
Especially since setenv is also LGPLv2+, and it makes sense for the
two modules to stay in sync, rather than one to be usable only in
LPGLv3+ projects.
* modules/unsetenv (License): Match setenv license.
Paul Eggert [Tue, 17 May 2016 16:08:02 +0000 (09:08 -0700)]
manywarnings: update for GCC 6.1
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC):
Add GCC 6.1 options that apply to C.
* build-aux/gcc-warning.spec: Add GCC 6.1 options that
do not apply to C, are obsolescent, etc.
Paul Eggert [Fri, 13 May 2016 06:08:22 +0000 (23:08 -0700)]
glob: size_t overflow checks
* lib/glob.c (__has_builtin): New macro.
(size_add_wrapv, glob_use_alloca): New static functions.
(glob, glob_in_dir): Check for size_t overflow in several places,
and fix some size_t checks that were not quite right.
Bruno Haible [Mon, 9 May 2016 07:29:35 +0000 (09:29 +0200)]
Fix undefined behaviour in gettext.h.
* lib/gettext.h (dcpgettext_expr, dcnpgettext_expr): Avoid accessing a
pointer's value after the storage it points to has been freed.
Reported by Michael Pyne in https://savannah.gnu.org/bugs/?47847.
Spotted by Coverity.
Paul Eggert [Sun, 8 May 2016 18:38:22 +0000 (11:38 -0700)]
git-version-gen: avoid undefined shift
Problem reported by Mosè Giordano in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-05/msg00012.html
* build-aux/git-version-gen: Avoid undefined behavior if invoked
with --prefix or --fallback but without a later argument. While
we're at it, omit unnecessary quotes.