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.
Paul Eggert [Tue, 4 Nov 2014 08:31:31 +0000 (00:31 -0800)]
obstack: avoid potentially-nonportable function casts
* lib/obstack.c (CALL_CHUNKFUN, CALL_FREEFUN):
Remove, replacing with ...
(call_chunkfun, call_freefun): New static functions.
All uses changed. Avoid potentially-nonportable casts.
(chunkfun_type, freefun_type): Remove typedefs; no longer used.
(_obstack_begin_worker): Omit last two args, since they
rely on potentially-nonportable casts. All callers changed.
* lib/obstack.h (_OBSTACK_CAST): New macro.
Use it everywhere the old API used a potentially-nonportable cast.
The new API doesn't cast.
(struct obstack): Use unions rather than requiring
potentially-nonportable casts.
(obstack_chunkfun, obstack_freefun): Return void.
Paul Eggert [Tue, 4 Nov 2014 00:34:52 +0000 (16:34 -0800)]
obstack: port to platforms that #define __alignof__
* lib/obstack.c: Include <alignof.h> if !defined __alignof__,
not if !_LIBC. We don't know of any platforms that #define
__alignof__, but it might be useful in tests. Conversely,
glibc assumes GCC.
Pádraig Brady [Fri, 31 Oct 2014 18:18:36 +0000 (18:18 +0000)]
linkat: don't unconditionally replace on GNU/Linux
* m4/linkat.m4 (gl_FUNC_LINKAT): The compile check for AT_SYMLINK_FOLLOW
was redundant for a few reasons. It was present to support compiling
on new systems but running on the old narrow window of Linux 2.6.1[67].
It setup and cleaned up test files which weren't actually used.
On non __linux__ it compile tested AT_SYMLINK_FOLLOW, but that is
implicit in the following check.
Pádraig Brady [Fri, 31 Oct 2014 18:12:15 +0000 (18:12 +0000)]
linkat: wrap to handle symlinks on OS X 10.10
* m4/linkat.m4 (gl_FUNC_LINKAT): linkat() is available on Yosemite
but not usable because it doesn't support creating hardlinks
to symlinks. Therefore add a generic test for this capability
and fallback to our emulation if linkat() fails with ENOTSUP.
* doc/posix-functions/open.texi (open):
* doc/posix-functions/openat.texi (openat):
Document that these functions do not set errno to ELOOP when
a symlink is opened with O_NOFOLLOW.
Pádraig Brady [Thu, 30 Oct 2014 04:08:50 +0000 (04:08 +0000)]
mountlist: don't use libmount to decide on dummy/remote
* lib/mountlist.c (read_file_system_list): Don't use the libmount
routines to determine whether a file system is dummy or remote,
as they're not currently compatible. For example the remoteness
is determined on file system type (for which the list seems incomplete),
rather than simply checking for a ':' in the device name.
Also libmount currently determines that 'tmpfs' is a dummy file system
even though it has associated storage.
Paul Eggert [Wed, 29 Oct 2014 23:15:41 +0000 (16:15 -0700)]
obstack: prefer __alignof__ to alignof
This is for portability to pre-4.7 GCC when compiling glibc.
See Joseph S. Myers in:
http://sourceware.org/ml/libc-alpha/2014-10/msg00703.html
* lib/obstack.c (__alignof__) [!_LIBC && !__GNUC__]:
New macro, defined by including and using <alignof.h>.
(MAX): New macro.
(DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Redefine in terms of these.
Do not use enums as they are not portable to some broken compilers.
* modules/obstack (Depends-on): Depend on alignof, not stdalign.
Paul Eggert [Wed, 29 Oct 2014 07:22:08 +0000 (00:22 -0700)]
obstack: prefer alignof to calculating alignments by hand
* lib/obstack.c: Include <stdalign.h>.
(struct fooalign): Remove.
(DEFAULT_ALIGNMENT): Use alignof rather than the old offsetof hack.
* modules/obstack (Depends-on): Add stdalign.
Paul Eggert [Wed, 29 Oct 2014 06:58:42 +0000 (23:58 -0700)]
obstack: use size_t alignments and check for overflow
* lib/obstack.c, lib/obstack.h (_obstack_begin, _obstack_begin_1):
* lib/obstack.c (_obstack_begin_worker, _obstack_newchunk):
* lib/obstack.h (struct obstack.alignment_mask):
Use _OBSTACK_SIZE_T, not int, for alignments.
* lib/obstack.c (_obstack_newchunk): Fail if the size calculation
overflows, e.g., when adding the alignment.
Alan Modra [Wed, 29 Oct 2014 03:33:00 +0000 (14:03 +1030)]
obstack: 64-bit obstack support, part 3
This finally enables full 64-bit obstack support. The glibc shared library
specific code is removed from obstack.c too, and the error handling code
conditionally compiled under control of another macro,
_OBSTACK_NO_ERROR_HANDLER.
* lib/obstack.h: Include string.h earlier.
(_OBSTACK_INTERFACE_VERSION): Define.
(_OBSTACK_SIZE_T, _CHUNK_SIZE_T): Define as size_t for version 2.
* lib/obstack.c: Don't include shlib-compat.h.
(OBSTACK_INTERFACE_VERSION): Delete.
(_OBSTACK_ELIDE_CODE): Rename from ELIDE_CODE. Define when version 1
glibc code is compatible with version 2. Don't include stdio.h for
__GNU_LIBRARY.
(obstack_exit_failure, print_and_abort, obstack_alloc_failed_handler):
Omit when _OBSTACK_NO_ERROR_HANDLER defined. Include stdio.h here.
(_obstack_compat, _obstack, _obstack_newchunk, obstack_free): Delete
glibc shared library specific source.
Alan Modra [Wed, 29 Oct 2014 03:32:40 +0000 (14:02 +1030)]
obstack: 64-bit obstack support, part 2
This gets us 4G obstack support, without changing ABI compatibility,
apart from possibly introducing some signed/unsigned comparison
warnings in code that uses obstack.h.
a) Replace "int" size parameters, return values, and macro local vars
with _OBSTACK_SIZE_T, an "unsigned int" for now.
b) Make obstack.chunk_size a _CHUNK_SIZE_T, an "unsigned long" for now.
c) Make all obstack macros checking available room use obstack_room.
"next_free + desired > chunk_limit" may wrap the lhs for chunks
allocated near the top of memory.
d) Use unsigned comparisons, and macro locals to support >2G on 32-bit.
* lib/obstack.h (_OBSTACK_SIZE_T): Define. Use throughout
in place of "int" size parameters, return values and local vars.
(_CHUNK_SIZE_T): Define.
(struct obstack): Make chunk_size a _CHUNK_SIZE_T. Make temp
union use an _OBSTACK_SIZE_T integer type.
For __GNUC__ versions of the following macros...
(obstack_room): Rename local var.
(obstack_make_room): Use obstack_room.
(obstack_grow, obstack_grow0, obstack_1grow, obstack_ptr_grow,
obstack_int_grow, obstack_blank): Likewise.
(obstack_finish): Use unsigned comparison when comparing aligned
next_free against chunk_limit.
(obstack_free): Cast OBJ to remove possible const qualifier.
For !__GNUC__ versions of the following macros...
(obstack_make_room): Use obstack_room.
(obstack_grow, obstack_grow0, obstack_1grow, obstack_ptr_grow,
obstack_int_grow, obstack_blank): Likewise.
(obstack_finish): Use unsigned comparision when comparing aligned
next_free against chunk_limit.
(obstack_free): Use temp.p and same comparisons as __GNUC__ version.
* lib/obstack.c (_obstack_begin_worker): Make "size" parameter
_OBSTACK_SIZE_T.
(_obstack_begin, _obstack_begin_1): Likewise.
(_obstack_newchunk): Likewise for length parameter. Use size_t locals.
(_obstack_memory_used): Return and use _OBSTACK_SIZE_T local.
Alan Modra [Wed, 29 Oct 2014 03:32:31 +0000 (14:02 +1030)]
obstack: 64-bit obstack support, part 1
a) Correct calls to alloc function, to use a size_t arg. "long" is
just wrong on targets like x86_64-mingw64 where "long" is 32 bits
and "size_t" 64 bits.
b) Consolidate _obstack_begin and _obstack_begin1 code.
* lib/obstack.h (struct obstack <chunkfun>): Correct prototype to
use "size_t" rather than "long".
(_obstack_begin, _obstack_begin1): Likewise.
(obstack_init, obstack_begin, obstack_specify_allocation_with_arg,
obstack_chunkfun): Update alloc function casts.
* lib/obstack.c (CALL_CHUNKFUN): Update chunkfun cast.
(chunkfun_type, freefun_type): New typdefs.
(_obstack_begin_worker): Split out from ..
(_obstack_begin, _obstack_begin_1): ..here.
Alan Modra [Wed, 29 Oct 2014 03:32:22 +0000 (14:02 +1030)]
obstack: tidy part 2
a) Don't be concerned about "not polluting the namespace with stddef.h
symbols" in obstack.h, since gnulib string.h includes stddef.h
anyway, and it seems unlikely that anyone would care.
b) Don't roll our own slow memcpy in _obstack_newchunk.
c) Rename obstack_free to _obstack_free. This makes the naming
consistent with other obstack functions and obviates the need for
__obstack_free. Ancient obstack.c defined both obstack_free and
_obstack_free. We continue to do that for _LIBC via an alias.
d) Miscellaneous macro fixes. The expression used to test for gcc-2.8
is clever, but nowadays gcc warns on undefined macros. You'll get
an undefined macro warning if simulating an old gcc with -U__GNUC__
-U__GNUC_MINOR__ -D__GNUC__=1.
* lib/obstack.h: Include stddef.h unconditionally. Formatting fixes.
(PTR_INT_TYPE): Delete, replace with ptrdiff_t.
(__obstack_free): Delete, update refs.
(_obstack_free): Rename from obstack_free.
(__extension__): Avoid undefined macro warning for __GNUC_MINOR__.
(obstack_object_size, obstack_room): Parenthesise !__GNUC__ versions.
* lib/obstack.c: Don't include stddef.h.
(COPYING_UNIT): Delete.
(_obstack_begin): Formatting fix.
(_obstack_newchunk): Use memcpy to move existing object to new chunk.
(_obstack_free): Rename from __obstack_free, update alias. Move
undef of obstack_free to where it is needed.
Alan Modra [Wed, 29 Oct 2014 03:32:13 +0000 (14:02 +1030)]
obstack: tidy part 1
a) Rename temp fields. temp.tempint and temp.tempptr just looks ugly
to me, and result in overlong lines after later patches.
b) Move error handling code, to avoid a forward declaration and to
simplify later patches in this series.
* lib/obstack.h (struct obstack <temp>): Rename fields of union
and update all uses.
* lib/obstack.c: Include stdlib.h earlier.
(obstack_exit_failure, obstack_alloc_failed_handler): Move later
in file.
(print_and_abort): Remove now redundant forward declaration.
Paul Eggert [Fri, 24 Oct 2014 17:47:44 +0000 (10:47 -0700)]
socketlib, sockets, sys_socket: Use AC_REQUIRE to pacify autoconf.
Without this change, in bleeding-edge fileutils Autoconf complains
that gl_SOCKETLIB etc. are AC_REQUIREd after being invoked.
* modules/socketlib (configure.ac): AC_REQUIRE gl_SOCKETLIB.
* modules/sockets (configure.ac): AC_REQUIRE gl_SOCKETS.
* modules/sys_socket (configure.ac): AC_REQUIRE gl_HEADER_SYS_SOCKET.
Daiki Ueno [Tue, 21 Oct 2014 09:07:00 +0000 (18:07 +0900)]
iconv: avoid false detection of non-working iconv
The INBUF arguments of iconv can be either 'const char **'
or 'char **'. If CC is g++, the difference causes a compile error
and thus leads to a false detection of non-working iconv.
Reported by Eli Zaretskii and Werner LEMBERG in:
<https://lists.gnu.org/archive/html/bug-gnulib/2014-10/msg00023.html>.
* m4/iconv.m4 (AM_ICONV_LINK): Try all possible argument types of
iconv. Bump serial number.
Pádraig Brady [Thu, 23 Oct 2014 12:59:08 +0000 (13:59 +0100)]
bootstrap: print more diagnostics for missing programs
* build-aux/bootstrap: only suppress stderr when checking for
alternative program names. This supports programs issuing non
standard error messages like:
"Provide an AUTOMAKE_VERSION environment variable, please"
Reported by Ingo Schwarze with OpenBSD
Eli Zaretskii [Tue, 7 Oct 2014 17:59:11 +0000 (20:59 +0300)]
modules/fcntl: fix error reporting by dupfd
* lib/fcntl.c (dupfd) [_WIN32]: Don't overwrite the value of
errno set by _open_osfhandle by EMFILE. Convert errors
returned by DuplicateHandle to corresponding errno values.
Jim Meyering [Wed, 24 Sep 2014 16:03:06 +0000 (09:03 -0700)]
exclude: declare exclude_patopts static
* lib/exclude.c (exclude_patopts): Declare static,
to avoid triggering a -Wmissing-prototypes warning.
The alternative (declaring it in the .h file) would
require publicizing the private "struct patopts".
Paul Eggert [Tue, 16 Sep 2014 19:26:48 +0000 (12:26 -0700)]
qsort_r: include <config.h>
Problem reported by Tom G. Christensen in:
http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00071.html
* lib/qsort.c [!_LIBC]: Include <config.h> first.
* lib/gl_anytree_list2.h: Add _GL_ATTRIBUTE_PURE to avoid
-Werror=suggest-attribute=pure.
* lib/gl_array_list.c: Likewise.
* lib/gl_avltree_list.c (gl_avltree_list_check_invariants): Add extern
declaration to avoid -Werror=missing-prototypes. This is not added
to a header as only exported for tests. Add (void) to the
check_invariants() call to indicate we're discarding the result
in this context which avoids -Werror=unused-value. Note we don't
use ignore_value here to avoid a dependency as we know we'll not
be adding __attribute__((warn_unused_result)) to check_invariants().
Add _GL_ATTRIBUTE_CONST to avoid -Werror=suggest-attribute=const.
Fridolin Pokorny [Wed, 27 Aug 2014 13:25:30 +0000 (15:25 +0200)]
mountlist: use /proc/self/mountinfo when available
Use libmount to propagate device IDs provided by Linux in
/proc/self/mountinfo. This will give more accurate output when
using df in chroot'ed environments as the device IDs are not
determined by stat() which may be inaccurate within the chroot.
* lib/mountlist.c (read_file_system_list): Use the libmount routines
from util-linux to parse "/proc/self/mountinfo" or fall back to
standard getmntent() processing.
* m4/ls-mntd-fs.m4: Check for libmount only when 1-argument
getmntent() is used, as is the case on GNU/Linux.
* DEPENDENCIES: Mention the optional util-linux dependency.
Eric Wong [Sun, 7 Sep 2014 03:22:12 +0000 (03:22 +0000)]
users.txt: add cmogstored
cmogstored has used gnulib since the beginning in 2012 to support
GNU/Linux, FreeBSD, and GNU/kFreeBSD. cmogstored is currently
included in the FreeBSD ports collection, but developed primarily
on GNU/Linux.
Current implementation only tries to rsync PO files when rsync is
installed on the host. In case of error, no files are downloaded even
if they are available. This leads to bootstrap problems for hosts
that lie behind a restrictive firewall.
This patch always tries to rsync by default, falling back to wget if
an error occurs.
Eric Blake [Thu, 4 Sep 2014 19:11:04 +0000 (13:11 -0600)]
maintainer-makefile: add syntax check for useless ';;'
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.
Paul Eggert [Thu, 4 Sep 2014 21:55:12 +0000 (14:55 -0700)]
pthread, pthread_sigmask, threadlib: port to Ubuntu 14.04
Problem reported by Assaf Gordon in:
http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00023.html
Apparently Ubuntu is doing some fancy link-time optimization
that doesn't work with -lpthread but does work with -pthread.
Work around the bug by preferring -pthread to -lpthread.
This change affects only LIBS, not CFLAGS, which is a little
weird, but it works.
* m4/pthread.m4 (gl_PTHREAD_CHECK):
* m4/threadlib.m4 (gl_THREADLIB_BODY): Prefer -pthread to -lpthread.
* m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK):
Treat -pthread like -lpthread.
Paul Eggert [Tue, 2 Sep 2014 18:56:55 +0000 (11:56 -0700)]
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
* m4/gnulib-common.m4 (AC_C_RESTRICT):
Override AC_C_RESTRICT unconditionally.
Update from autoconf, incorporating:
2014-09-02 autoconf: port 'restrict' to GCC 4.2.1
2009-01-28 Fix AC_C_RESTRICT for Sun Studio 12 C++.
Paul Eggert [Mon, 1 Sep 2014 08:51:06 +0000 (01:51 -0700)]
manywarnings: add GCC 4.9 warnings
Also, make it easier to maintain this in the future.
* build-aux/gcc-warning.spec: Add -Wabi-tag,
-Wconditionally-supported, -Wdelete-incomplete,
-Winherited-variadic-ctor, -Wvirtual-move-assign, -Wzerotrip.
Remove duplicates. Use tabs uniformly, as that's what 'cut' wants.
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wdate-time,
-Wopenmp-simd. Use -fdiagnostics-show-option and -funit-at-a-time
only for older GCC versions that need them. Handke
-Wnormalized=nfc specially, so that the 'comm' command used
for maintenance doesn't get confused.
Paul Eggert [Mon, 1 Sep 2014 02:19:44 +0000 (19:19 -0700)]
vasnprintf: fix bugs in width computation
* lib/vasnprintf.c (VASNPRINTF):
Rework previous change, which introduced a bug,
to avoid the warning in a different way.
Avoid undefined behavior if the width arg is less than -INT_MAX.
Avoid unnecessary use of HAS_WIDTH local.
* lib/parse-datetime.y (yylex): Compare pointer to end of buffer,
instead of calculating difference of pointers. This removes an
annoying warning, devoid of any use.
Paul Eggert [Fri, 29 Aug 2014 20:00:16 +0000 (13:00 -0700)]
qsort_r: new module, for GNU-style qsort_r
This works even on FreeBSD, which has an incompatible qsort_r API.
* MODULES.html.sh: Add it.
* doc/glibc-functions/qsort_r.texi: It's now supported.
* lib/qsort.c: New file, taken from glibc with minor changes
inside "#ifndef _LIBC" and with an unnecessary "#include <alloca.h>"
removed.
* lib/qsort_r.c: New file, compiled only on FreeBSD.
* lib/stdlib.in.h (qsort_r): Declare in the usual way.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS):
* modules/qsort_r, modules/qsort_r-tests: New files.
* modules/stdlib (Makefile): Set up its defaults.
* tests/test-qsort_r.c: New file.
Paul Eggert [Fri, 8 Aug 2014 00:40:01 +0000 (17:40 -0700)]
vla: new module
vla: new module
GNU RCS can use this, mostly for documentation I expect. See:
http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00025.html
* MODULES.html.sh: Add vla.
* lib/vla.h, modules/vla: New files.
Daiki Ueno [Wed, 6 Aug 2014 23:46:52 +0000 (08:46 +0900)]
localename: make gl_locale_name_thread really thread-safe on Windows
* lib/localename.c [WINDOWS_NATIVE && !IN_LIBINTL]: Include
"glthread/lock.h".
(get_lcid_lock) [WINDOWS_NATIVE]: New variable.
(get_lcid) [WINDOWS_NATIVE]: Lock while looking for an LCID.
Paul Eggert [Fri, 8 Aug 2014 01:13:41 +0000 (18:13 -0700)]
getpass: don't assume struct termios
Problem report and trivial fix by Jonas 'Sortie' Termansen in:
http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00015.html
* lib/getpass.c (getpass): Port to systems lacking struct termios.
Paul Eggert [Fri, 8 Aug 2014 01:04:32 +0000 (18:04 -0700)]
getdtablesize: fall back on sysconf (_SC_OPEN_MAX)
Problem reported by Jonas 'Sortie' Termansen in:
http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00023.html
* lib/getdtablesize.c (getdtablesize) [_SC_OPEN_MAX]:
Implement via sysconf for platforms that lack getdtablesize.
Paul Eggert [Fri, 8 Aug 2014 00:25:28 +0000 (17:25 -0700)]
vararrays: modernize AC_C_VARARRAYS for C11
This backports a change I recently made to Autoconf.
* m4/vararrays.m4 (AC_C_VARARRAYS): Define __STDC_NO_VLA__ if
VLAs are not supported, as this is what C11 does. The old macro
HAVE_C_VARARRAYS is still defined if they are supported, but is
now obsolescent. Also, check for VLA bug in GCC 3.4.3.
Paul Eggert [Tue, 5 Aug 2014 20:19:57 +0000 (13:19 -0700)]
sys_select: fix FD_ZERO problem on Solaris 10
* lib/sys_select.in.h: Fix Solaris 10 bug where "#include
<sys/time.h>" followed by "#include <sys/select.h>" caused FD_ZERO
to expand to an expression that invoked memset without necessarily
including <string.h>. The problem was that the first include
defined _SYS_TIME_H, causing the second include to short-circuit.
Fix a similar problem with <sys/types.h> followed by <sys/select.h>.
Also, fix what appears to be a cut-and-paste typo, by replacing
_GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H with
_GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H.
Paul Eggert [Mon, 4 Aug 2014 18:30:33 +0000 (11:30 -0700)]
extern-inline: port to FreeBSD, DragonFly
* m4/extern-inline.m4 (gl_EXTERN_INLINE): Also assume the bug
is present if either __DragonFly__ or __FreeBSD__ is defined.
FreeBSD problem reported by Andrey Borzenkov in:
http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html
Also, worry about __APPLE__ only if __MACH__ is also defined,
as this is more consistent with the rest of gnulib.
(_GL_EXTERN_INLINE_STDHEADER_BUG): Rename this internal macro from
_GL_EXTERN_INLINE_APPLE_BUG, since the bug is not limited to Apple.
Use consistent style to check DEBUG macro in regex_internal.c
The DEBUG macro is checked using both #if and #ifdef in
regex_internal.c. Make this consistent with mktime, where we use "#if
defined DEBUG && DEBUG", to be compatible with gnulib as well as glibc
style.
regex: Make #if/#ifdef usage consistent for DEBUG
* lib/regex_internal.c: Use "#if defined DEBUG && DEBUG" instead
of the inconsistent usage of #if and #ifdef as that works with
both Glibc and Gnulib's style.
Eric Blake [Wed, 30 Jul 2014 21:01:44 +0000 (15:01 -0600)]
openat-die: use _Noreturn markup
Compiling coreutils.git on cygwin with gcc 4.8.3, I got:
lib/openat-die.c:34:1: error: function might be candidate for attribute 'noreturn' [-Werror=suggest-attribute=noreturn]
openat_save_fail (int errnum)
^
Eric Blake [Wed, 30 Jul 2014 23:11:49 +0000 (17:11 -0600)]
test-open: port to cygwin, which lacks Fortify
On cygwin, with gcc 4.8.3, I get this compilation warning:
In file included from ../../gltests/test-open.c:35:0:
../../gltests/test-open.h:35:1: warning: always_inline function might not be inlinable [-Wattributes]
test_open (int (*func) (char const *, int, ...), bool print)
^
On that platform, there are no Fortify enhancements, and the
internal macro __always_inline is always defined to turn on the
gcc attribute, contrary to our needs. Since relying on a __
prefix is already risky, it's better to limit the workaround of
commit d6ba92ea to just glibc.
* tests/test-open.h (ALWAYS_INLINE): New macro.
(__always_inline): Don't abuse internal symbol on non-glibc.