Paul Eggert [Sat, 7 Feb 2015 23:09:00 +0000 (15:09 -0800)]
crypto/gc: fix a -Wswitch warning
Reported by Bruce Korb in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-02/msg00046.html
* lib/gc-gnulib.c (gc_hash_open): Fail faster if MODE is nonzero.
The way how gen_tempname() creates files is not always sufficient. For example,
it may make sense to create directories when creating the temporary file or
directory fails with errno set to ENOENT. Add a try_tempname() variant of
gen_tempname() that allows that. Implement gen_tempname() on top of it.
* lib/tempname.c (try_tempname): New function and backend of gen_tempname().
(try_file, try_dir, try_nocreate): Callbacks to use for the different kinds
that gen_tempname supports (GT_FILE, GT_DIR, GT_NOCREATE).
* lib/tempname.h (try_tempname): Declare here.
* modules/tempname: Mention try_tempname.
Pádraig Brady [Tue, 3 Feb 2015 03:55:48 +0000 (03:55 +0000)]
bootstrap: exit immediately upon gnulib-tool failure
* build-aux/bootstrap: Exit immediately if gnulib-tool fails.
This was noticed when gnulib-tool exited early due to failure
to apply a patch in coreutils at http://hydra.nixos.org/eval/1172233,
but various confusing errors were then given as the build proceeded.
Following on from commit 032bd151, include header files required
on OS X 10.10 (Yosemite) at least.
* lib/symlinkat.c (HAVE_SYMLINK_AT): Add <sys/stat.h> for fstatat(),
and string.h for strlen().
Reported at https://savannah.gnu.org/bugs/index.php?44151
and by Jack Howarth.
Pádraig Brady [Thu, 29 Jan 2015 16:44:48 +0000 (16:44 +0000)]
localename: support Solaris 12 and illumos
* lib/localename.c (gl_locale_name_thread_unsafe): call
getlocalename_l() on newer __sun platforms.
Reported by Alexander Pyhalov.
Fix suggested by Rich Burridge.
Daiki Ueno [Sat, 24 Jan 2015 02:11:34 +0000 (11:11 +0900)]
unictype: avoid undefined left-shift behavior
* lib/unictype/bidi_of.c (uc_bidi_class): Building libunistring with
gcc's -fsanitize=shift and running its tests triggered:
unictype/bidi_of.c:43:60: runtime error: left shift of 40167 by 16 \
places cannot be represented in type 'int'
Cast LHS to 'unsigned int' after integer promotion.
* lib/unictype/categ_of.c (lookup_withtable): Likewise.
* lib/unictype/joininggroup_of.c (uc_joining_group): Likewise.
Daiki Ueno [Tue, 20 Jan 2015 09:09:03 +0000 (18:09 +0900)]
libunistring: bump version of unitypes dependants
Due to the header file search order, all the headers which depend
on unitypes.h need to be generated, when the preinstalled
libunistring is older.
* modules/unicase/base (configure.ac): Bump minimum version to
0.9.4.
* modules/uniconv/base (configure.ac): Likewise.
* modules/unilbrk/base (configure.ac): Likewise.
* modules/uninorm/base (configure.ac): Likewise.
* modules/unistdio/base (configure.ac): Likewise.
* modules/unistr/base (configure.ac): Likewise.
* modules/uniwbrk/base (configure.ac): Likewise.
* modules/uniwidth/base (configure.ac): Likewise.
Daiki Ueno [Tue, 20 Jan 2015 06:46:54 +0000 (15:46 +0900)]
unictype/category-none: fix link with libunistring
Since _UC_CATEGORY_NONE is not a public symbol, it will be
prefixed with "libstring_" when compiled as part of libunistring.
To avoid undefined symbol at link time, increase the minimum
version when the dependant modules are updated.
* modules/unictype/category-none (configure.ac): Bump minimum
version to 0.9.5.
Daiki Ueno [Tue, 20 Jan 2015 06:34:36 +0000 (15:34 +0900)]
unitypes: fix build with installed libunistring
The minimum version was not bumped after _UC_ATTRIBUTE_CONST and
_UC_ATTRIBUTE_PURE were added to unitypes.in.h.
* modules/unitypes (configure.ac): Bump minimum version to 0.9.4.
Paul Eggert [Fri, 16 Jan 2015 01:37:14 +0000 (17:37 -0800)]
time: port to MinGW32 3.21
Problem reported by Eli Zaretskii in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-01/msg00042.html
* lib/time.in.h:
* m4/time_h.m4 (gl_CHECK_TYPE_STRUCT_TIMESPEC):
* modules/time (Depends-on):
Fall back on unistd.h if the other include files don't define
struct timespec.
Daiki Ueno [Thu, 15 Jan 2015 03:14:14 +0000 (12:14 +0900)]
libunistring: update to Unicode 6.2.0
* lib/unilbrk/lbrktables.h (LBP_RI): New enumeration value.
(unilbrk_table): Adjust table size.
* lib/unilbrk/lbrktables.c (unilbrk_table): Add a row and column
for LBP_RI.
* lib/uniwbrk.in.h (WBP_RI): New enumeration value.
* lib/uniwbrk/u-wordbreaks.h (FUNC): Support rule WB13c.
Normalize table index skipping ignored properties.
* lib/uniwbrk/wbrktable.c (uniwbrk_table): Support WBP_RI. Remove
WBP_EXTEND and WBP_FORMAT, which are now computed without using
the table.
* lib/uniwbrk/wbrktable.h: Adjust table size.
* lib/unigbrk.in.h (GBP_RI): New enumeration value.
* lib/unigbrk/uc-is-grapheme-break.c (UC_IS_GRAPHEME_BREAK):
Support rule GB8a.
(UC_GRAPHEME_BREAKS_FOR, gb_table): Support GBP_RI.
* tests/unigbrk/test-uc-is-grapheme-break.c
(graphemebreakproperty_to_string): Support GBP_RI.
* lib/gen-uni-tables.c (LBP_RI): New enumeration value.
(get_lbp, debug_output_lbp, fill_org_lbp, debug_output_org_lbp)
(output_lbp): Support LBP_RI. Adjust some characters changed from
LBP_AL to LBP_ID.
(output_lbp): Support LBP_RI.
(WBP_RI): New enumeration value.
(debug_output_wbp, fill_org_wbp, debug_output_org_wbp)
(output_wbp): Support WBP_RI.
(GBP_RI): New enumeration value.
(output_gbp_test, fill_org_gbp): Support GBP_RI.
* all generated files under lib/uni* and tests/uni*: Regenerate.
Daiki Ueno [Thu, 15 Jan 2015 03:08:17 +0000 (12:08 +0900)]
libunistring: update to Unicode 6.1.0
* lib/gen-uni-tables.c (output_joining_group): Switch to
3-level table to accommodate joining groups defined with higher
codepoint value. Since there are only 88 groups defined in
Unicode 7.0.0, use 7-bit packed format for level3 entries.
(get_lbp): Update for Unicode 6.1.0.
* lib/unictype/joininggroup_of.c (uc_joining_group): Adjust to use
3-level table.
* lib/unictype/joininggroup_byname.gperf: Add Rohingya Yeh
joining group name.
* lib/unictype/joininggroup_name.h: Likewise.
* lib/unilbrk/lbrktables.h (LBP_HL): New enumeration value.
(unilbrk_table): Adjust table size.
* lib/unilbrk/lbrktables.c (unilbrk_table): Add a row and column
for LBP_HL.
* lib/uniwidth/width.c (nonspacing_table_data): Add U+0604,
U+08E4..U+08FE, U+1BAB, U+1CF4, U+A674..U+A67B, U+A69F,
U+AAEC..U+AAED, U+AAF6, U+11100..U+11102, U+11127..U+1112B,
U+1112D..U+11134, U+11180..U+11181, U+111B6..U+111BE, U+116AB,
U+116AD, U+116B0..U+116B5, U+116B7, U+16F8F..U+16F92. Remove
U+302E..U+302F.
* tests/uniwidth/test-uc_width2.sh: Same updates as in
lib/uniwidth/width.c.
* all generated files under lib/uni* and tests/uni*: Regenerate.
* modules/uni*/* (configure.ac): Bump minimum version to 0.9.5.
Daiki Ueno [Thu, 15 Jan 2015 03:06:30 +0000 (12:06 +0900)]
uniwbrk/u32-wordbreaks-tests: add conformance test
* modules/uniwbrk/u32-wordbreaks-tests (Files): Add
tests/uniwbrk/test-uc-wordbreaks.c,
tests/uniwbrk/test-uc-wordbreaks.sh, and
tests/uniwbrk/WordBreakTest.txt.
(Makefile.am): Add uniwbrk/test-uc-wordbreaks.sh to $(TESTS), add
test-uc-wordbreaks to $(check_PROGRAMS), and define
test_uc_wordbreaks_SOURCES and test_uc_wordbreaks_LDADD.
* tests/uniwbrk/test-uc-wordbreaks.sh: New file.
* tests/uniwbrk/test-uc-wordbreaks.c: New file.
Pádraig Brady [Thu, 8 Jan 2015 12:18:54 +0000 (12:18 +0000)]
maint.mk: fix compatibility with OS X nm
* top/maint.mk (_gl_tight_scope): Use the -g option to
show exported items rather than the -e option which is
ignored on all platforms except OS X where it gives an error.
Reported by Assaf Gordon.
KO Myung-Hun [Wed, 7 Jan 2015 05:36:52 +0000 (14:36 +0900)]
localcharset: improve charset detection on OS/2
Use system codepage when appropriate. Map OS/2 codepages to
GNU canonical charset names if possible.
* lib/config.charset: Don't output aliases if "$os" is os2*.
* lib/localcharset.c (get_charset_aliases) [OS2]: Hardcode the
result for OS/2.
(locale_charset) [OS2]: Use system codepage if codeset is omitted
from the locale name which is neither "C" nor "POSIX".
Paul Eggert [Tue, 6 Jan 2015 17:05:22 +0000 (09:05 -0800)]
count-leading-zeros: use 64-bit intrinsics on 32-bit Windows
This reverts the last patch but one, as it shouldn't be needed now
that the typo is fixed.
* lib/count-leading-zeros.h (count_leading_zeros_ll):
* lib/count-trailing-zeros.h:
* lib/count-one-bits.h:
Go back to using 64-bit intrinsics.
Pádraig Brady [Tue, 6 Jan 2015 02:27:16 +0000 (02:27 +0000)]
count-leading-zeros: avoid 64-bit intrinsics on 32-bit Windows
* lib/count-leading-zeros.h (count_leading_zeros_ll): Use 32 bit
intrinsics in this case.
* lib/count-trailing-zeros.h: Likewise.
* lib/count-one-bits.h: Likewise.
Daiki Ueno [Tue, 6 Jan 2015 09:53:40 +0000 (18:53 +0900)]
uniname/uniname: update to Unicode 7.0.0
To accommodate new characters added since Unicode 5.1.0, this
changes the internal representation of codepoint ranges.
Previously, we grouped codepoint ranges by manually assigned 4-bit
tag, which only allowed 16 groups. This removes the limitation by
switching to binary search on a table. For the detail rationale and the
benchmark results, see:
https://lists.gnu.org/archive/html/bug-libunistring/2014-06/msg00001.html
* lib/uniname/gen-uninames.lisp (unicode-char): Rename CODE member
to INDEX, as it no longer represents a codepoint.
(range): New struct.
(main): Switch to intervals list from a bit-pattern based
classification.
* lib/uniname/uninames.h: Regenerate.
* tests/uniname/UnicodeDataNames.txt: Update to Unicode 7.0.0.
* modules/uniname/base (configure.ac): Bump minimum version to
0.9.5.
* modules/uniname/uniname (configure.ac): Bump minimum version to
0.9.5.
Eric Blake [Mon, 5 Jan 2015 21:08:27 +0000 (14:08 -0700)]
stdio: fix use of PRIdMAX on modern mingw
Commit cf88e56ab broke the use of PRIdMAX and friends on modern
mingw64 installations. Basically, when requesting
_USE_MINGW_ANSI_STDIO, not only does mingw turn on support for %lld,
it also rewrites <inttypes.h> to provide PRIdMAX as "lld" instead of
"I64d" (but only when <stdio.h> is also included). But if a user is
NOT using the gnulib printf module, gnulib's <stdio.h> was still
giving printf() the system printf attribute, which causes the
compiler to then complain about an unknown %lld specifier, even though
we know we don't need to use the non-standard %I64d. So this patch
adds a configure-time probe that should work with older gcc (which
does not differentiate between printf flavors) and older mingw (where
_USE_MINGW_ANSI_STDIO has no impact on behavior), while fixing the
mismatch in flavors on modern systems.
* m4/stdio_h.m4 (gl_STDIO_H): Probe for printf flavor via inttypes.
* lib/stdio.in.h (_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM): Use result
to work with modern mingw.
pthread: work around winpthread header pollution on mingw
It activated its workaround based on existance of the strtok_r
wrapper in pthreads.h. As luck would have it, latest Mingw64
headers removed the strtok_r wrapper from pthreads.h, but left
all the others. So the gnulib workaround was not activated.
Change the configure check to look for several of the broken
wrappers, instead of just strtok_r
Paul Eggert [Sat, 3 Jan 2015 23:21:54 +0000 (15:21 -0800)]
lib-symbol-versions: cache script check
* m4/ld-version-script.m4 (gl_LD_VERSION_SCRIPT):
Cache the check for linker version scripts.
From a suggestion by Christophe Curis in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-01/msg00011.html
Eric Blake [Mon, 22 Dec 2014 18:46:41 +0000 (11:46 -0700)]
docs: mention why libgen.h is bad
I just debugged a failure in sharutils-4.14.2-1 for using basename()
without including <libgen.h>. In the process, I realized that we
aren't doing a good job of explaining why we don't offer a libgen.h
replacement (it is useless because the only two functions it
provides are also useless).
* doc/posix-headers/libgen.texi (libgen.h): Refer to dirname module.
Paul Eggert [Sat, 20 Dec 2014 21:00:21 +0000 (13:00 -0800)]
assure: new module
This works better than 'assert' when compiling with -DNDEBUG,
as it avoids some compiler diagnostics in that case.
Reported by Norihiro Tanaka in:
http://lists.gnu.org/archive/html/bug-gnulib/2014-12/msg00215.html
* MODULES.html.sh (func_all_modules): Add 'assure'.
* lib/assure.h, modules/assure: New files.
* lib/chdir-long.c, lib/cycle-check.c, lib/fchdir.c, lib/fts.c:
* lib/poll.c, lib/savewd.c, lib/utimens.c, lib/xstrtol.c:
Prefer 'assure' to 'assert'.
* modules/chdir-long, modules/cycle-check, modules/fchdir:
* modules/poll, modules/savewd, modules/utimens, modules/xstrtol:
Depend on 'assure'.
Paul Eggert [Wed, 17 Dec 2014 01:29:33 +0000 (17:29 -0800)]
stdalign: work around Apple GCC 4.0 bug
Reported by David Fang in:
http://lists.gnu.org/archive/html/bug-gnulib/2014-12/msg00194.html
* lib/stdalign.in.h (_Alignas):
* m4/stdalign.m4 (gl_STDALIGN_H):
Do not use aligned attribute with GCC 4.0 on Apple.
Pádraig Brady [Tue, 16 Dec 2014 02:35:19 +0000 (02:35 +0000)]
getcwd: fix test failure on OS X 10.9
* m4/getcwd-path-max.m4: Avoid the replacement if it
won't be effective due to the PATH_MAX limitation of lstat().
(gl_cv_func_getcwd_path_max): Adjust to indicate this case.
* m4/getcwd.m4 (gl_FUNC_GETCWD): Define HAVE_GETCWD_SHORTER
for this case for use in tests, and also exclude this
case when setting REPLACE_GETCWD.
* tests/test-getcwd.c (test_long_name): Restrict the
tested path length so that lstat() will not be passed
a path greater than PATH_MAX.
Also key a test condition on HAVE_OPENAT_SUPPORT rather
than AT_FDCWD, since the latter is set unconditionally
since Sep 2009 in commit 52c658e9.
Tim Rühsen [Sun, 14 Dec 2014 20:32:54 +0000 (20:32 +0000)]
parse-datetime: avoid a compiler warning with byacc
* lib/parse-datetime.y (yylex): Use the same prototype in the
function definition as the declaration, to avoid a -Wstrict-prototypes
warning seen when using byacc.
Daiki Ueno [Fri, 12 Dec 2014 00:20:59 +0000 (09:20 +0900)]
unicase/locale-language-tests: fix LOCALE_FR test
* tests/unicase/test-locale-language.sh: Really use $LOCALE_FR for
a French locale with traditional encoding.
Reported by umerqayam in:
http://lists.gnu.org/archive/html/bug-libunistring/2014-12/msg00000.html
Paul Eggert [Fri, 12 Dec 2014 19:27:45 +0000 (11:27 -0800)]
stddef: support C11's max_align_t
* doc/posix-headers/stddef.texi (stddef.h): Document max_align_t.
* lib/stddef.in.h (_@GUARD_PREFIX@_STDDEF_H) [__need_wint_t]:
Do not undef, as that might cause max_align_t to be defined twice.
Instead, change use to check for _GL_STDDEF_WINT_T too.
(max_align_t) [!HAVE_MAX_ALIGN_T]: New decl.
* m4/stddef_h.m4 (gl_STDDEF_H, gl_STDDEF_H_DEFAULTS):
Check for max_align_t.
* modules/stddef (stddef.h): Substitute HAVE_MAX_ALIGN_T.
* modules/stddef-tests (Depends-on): Add stdalign.
* tests/test-stddef.c: Test max_align_t.
Daiki Ueno [Thu, 11 Dec 2014 07:07:31 +0000 (16:07 +0900)]
unistd: fix iOS check conditional
On Mac OS X 10.8, the TARGET_* macros are unconditonally defined
as 0 or 1 in <TargetConditionals.h>, and the previous check always
yielded true on non-iOS environment.
* lib/unistd.in.h (environ) [__APPLE__]: Check the values of
TARGET_OS_IPHONE and TARGET_IPHONE_SIMULATOR, instead of whether
they are defined.
Paul Eggert [Wed, 10 Dec 2014 02:11:46 +0000 (18:11 -0800)]
posixtm: avoid compiler warning in a better way
* lib/posixtm.c (IF_LINT): Remove.
(year, posix_time_parse):
Return true (not 0) if successful. All callers changed.
(posix_time_parse): Simplify to pacify GCC without need for IF_LINT.
KO Myung-Hun [Wed, 3 Dec 2014 06:46:17 +0000 (15:46 +0900)]
get_shared_library_fullname: port to EMX
* lib/relocatable.c: Define strcmp and strncmp to stricmp and strnicmp
on EMX, respectively.
(_DLL_InitTerm): New on EMX.
(get_shared_library_fullname): Implement on EMX.
With this patch it is possible to put e.g. "perl::XML:XPath -" in
$buildreq in bootstrap.conf which will cause a check for perl module
XML::XPath using:
perl -m"XML::XPath" -e 'exit 0' >/dev/null 2>&1
If this fails due to any other error than XML::XPath missing, it is left
on the user to fix up his/her bootstrap.conf. One of the examples
might be perl itself missing, which should be in $buildreq and precede
any perl::Module specifications. Versioning of perl modules is not
supported.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Pádraig Brady [Fri, 5 Dec 2014 12:32:49 +0000 (12:32 +0000)]
filevercmp, posixtm: avoid compiler warnings with -O3
* lib/filevercmp.h (filevercmp): Tag with _GL_ATTRIBUTE_PURE
* lib/posixtm.c: (IF_LINT): Define.
(posix_time_parse): Use it to void a "may be used uninitialized"
warning, seen only with -O3.
argp: avoid extraneous translation and mem leak with empty pre doc
* lib/argp-help.c (argp_doc): Never translate the empty string,
when "\v" is the first or last character of the string, as that
has a reserved meaning to return the header info from a po file.
This also fixes a small memory leak in the !post case.
The issue can be seen with this command for example:
LC_MESSAGES=en_US grub2-mknetdir --help
Daiki Ueno [Tue, 18 Nov 2014 12:11:09 +0000 (21:11 +0900)]
pipe-filter-gi, pipe-filter-ii: port to AIX
On AIX 7.1, 'select' is defined as static and cannot be referred
to from inline function.
* lib/pipe-filter-aux.h (nointr_select): Remove, manually expand
the definition...
* lib/pipe-filter-gi.c (filter_loop): ...here, and...
* lib/pipe-filter-ii.c (pipe_filter_ii_execute): ...here.
Paul Eggert [Mon, 10 Nov 2014 23:43:22 +0000 (15:43 -0800)]
fts: port to C89
Problem reported for MSVC 16 by Gisle Vanem in:
http://lists.gnu.org/archive/html/bug-gnulib/2014-11/msg00027.html
* lib/fts.c (fts_build): Avoid declaration before statement.
Paul Eggert [Fri, 7 Nov 2014 04:33:02 +0000 (20:33 -0800)]
unistd: port to iOS
Problem reported by André Klitzing in:
http://lists.gnu.org/archive/html/bug-gnulib/2014-11/msg00013.html
* lib/unistd.in.h (environ): Do not include crt_externs.h on iOS.
Paul Eggert [Wed, 5 Nov 2014 19:41:57 +0000 (11:41 -0800)]
obstack: do not reject malloc-style obstack_chunkfun, obstack_freefun
Problem reported by Alan Modra in:
http://lists.gnu.org/archive/html/bug-gnulib/2014-11/msg00007.html
* lib/obstack.h (obstack_chunkfun, obstack_freefun):
Always cast the function arg, reverting this part of the previous
change.