diff options
167 files changed, 4902 insertions, 2149 deletions
diff --git a/GNUmakefile b/GNUmakefile index 4ab6429..a2f8111 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -5,7 +5,7 @@ # It is necessary if you want to build targets usually of interest # only to the maintainer. -# Copyright (C) 2001, 2003, 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2006-2017 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/Makefile.am b/Makefile.am index a31301c..2a8698b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,10 +26,10 @@ EXTRA_DIST = windows/asn1-parser/asn1-parser.vcproj \ windows/test-parser/test-parser.vcproj \ windows/test-tree/test-tree.vcproj windows/libtasn14win.mk -SUBDIRS = gl lib src examples tests +SUBDIRS = gl lib src tests if ENABLE_DOC -SUBDIRS += doc +SUBDIRS += doc examples endif ACLOCAL_AMFLAGS = -I m4 -I gl/m4 -I lib/glm4 @@ -52,5 +52,14 @@ abi-check: abi-compliance-checker -abi -lib libtasn1 -old "$(srcdir)/devel/ABI-$$(uname -m).dump" -new $(TMPFILE) @rm -f $(TMPFILE) +abi-dump: + @mkdir -p devel/headers-tmp + @cp lib/libtasn1.h devel/headers-tmp + @abi-dumper lib/.libs/libtasn1.so -o "./devel/ABI-$$(uname -m).dump" -public-headers devel/headers-tmp + @rm -rf devel/headers-tmp + + dist-hook: abi-check make -C doc/ compare-makefile + +.PHONY: abi-dump abi-check diff --git a/Makefile.in b/Makefile.in index 175253a..b3d4f76 100644 --- a/Makefile.in +++ b/Makefile.in @@ -104,7 +104,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@ENABLE_DOC_TRUE@am__append_1 = doc +@ENABLE_DOC_TRUE@am__append_1 = doc examples subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ @@ -128,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/largefile.m4 \ + $(top_srcdir)/gl/m4/limits-h.m4 \ $(top_srcdir)/gl/m4/longlong.m4 $(top_srcdir)/gl/m4/lseek.m4 \ $(top_srcdir)/gl/m4/malloc.m4 \ $(top_srcdir)/gl/m4/manywarnings.m4 \ @@ -150,10 +151,10 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/version-etc.m4 \ $(top_srcdir)/gl/m4/warn-on-use.m4 \ $(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ - $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/m4/gtk-doc.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/m4/update-header-version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -222,7 +223,7 @@ am__define_uniq_tagged_files = \ ETAGS = etags CTAGS = ctags CSCOPE = cscope -DIST_SUBDIRS = gl lib src examples tests doc +DIST_SUBDIRS = gl lib src tests doc examples am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/build-aux/ar-lib $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ @@ -423,6 +424,7 @@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ @@ -439,6 +441,7 @@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ @@ -487,6 +490,7 @@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ @@ -515,6 +519,7 @@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ @@ -527,6 +532,7 @@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ @@ -580,6 +586,7 @@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ @@ -605,6 +612,7 @@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ @@ -644,6 +652,7 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ @@ -673,6 +682,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIMITS_H = @LIMITS_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBINTL = @LTLIBINTL@ @@ -685,6 +695,7 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ @@ -698,6 +709,7 @@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ @@ -791,9 +803,11 @@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ @@ -822,6 +836,7 @@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ @@ -850,13 +865,13 @@ STRIP = @STRIP@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VALGRIND = @VALGRIND@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ -WERROR_CFLAGS = @WERROR_CFLAGS@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ @@ -934,7 +949,7 @@ EXTRA_DIST = windows/asn1-parser/asn1-parser.vcproj \ windows/test-parser/test-parser.vcproj \ windows/test-tree/test-tree.vcproj windows/libtasn14win.mk \ cfg.mk maint.mk .clcopying -SUBDIRS = gl lib src examples tests $(am__append_1) +SUBDIRS = gl lib src tests $(am__append_1) ACLOCAL_AMFLAGS = -I m4 -I gl/m4 -I lib/glm4 TMPFILE = "abi-temp.xml" all: config.h @@ -1437,9 +1452,17 @@ abi-check: abi-compliance-checker -abi -lib libtasn1 -old "$(srcdir)/devel/ABI-$$(uname -m).dump" -new $(TMPFILE) @rm -f $(TMPFILE) +abi-dump: + @mkdir -p devel/headers-tmp + @cp lib/libtasn1.h devel/headers-tmp + @abi-dumper lib/.libs/libtasn1.so -o "./devel/ABI-$$(uname -m).dump" -public-headers devel/headers-tmp + @rm -rf devel/headers-tmp + dist-hook: abi-check make -C doc/ compare-makefile +.PHONY: abi-dump abi-check + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: @@ -1,5 +1,17 @@ GNU Libtasn1 NEWS -*- outline -*- +* Noteworthy changes in release 4.10 (released 2017-01-16) [stable] +- Updated gnulib +- Removed -Werror from default compiler flags +- Fixed undefined behavior when negating integers in _asn1_ltostr(). + Issue found by oss-fuzz project (via gnutls): + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=388 +- Pass the correct length to _asn1_get_indefinite_length_string in + asn1_get_length_ber. This addresses reading 1-byte past the end + of data. Issue found by oss-fuzz project (via gnutls): + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=330 + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=331 + * Noteworthy changes in release 4.9 (released 2016-07-25) [stable] - Fixes to OID encoding of OIDs which have elements which exceed 2^32 @@ -1234,6 +1234,7 @@ m4_include([gl/m4/gnulib-common.m4]) m4_include([gl/m4/gnulib-comp.m4]) m4_include([gl/m4/include_next.m4]) m4_include([gl/m4/largefile.m4]) +m4_include([gl/m4/limits-h.m4]) m4_include([gl/m4/longlong.m4]) m4_include([gl/m4/lseek.m4]) m4_include([gl/m4/malloc.m4]) @@ -1263,6 +1264,7 @@ m4_include([gl/m4/version-etc.m4]) m4_include([gl/m4/warn-on-use.m4]) m4_include([gl/m4/warnings.m4]) m4_include([gl/m4/wchar_t.m4]) +m4_include([gl/m4/wint_t.m4]) m4_include([m4/gtk-doc.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh index f9ec9df..3b71b36 100755 --- a/build-aux/gendocs.sh +++ b/build-aux/gendocs.sh @@ -2,10 +2,9 @@ # gendocs.sh -- generate a GNU manual in many formats. This script is # mentioned in maintain.texi. See the help message below for usage details. -scriptversion=2013-10-10.09 +scriptversion=2016-12-31.18 -# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 -# Free Software Foundation, Inc. +# Copyright 2003-2017 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,17 +20,16 @@ scriptversion=2013-10-10.09 # along with this program. If not, see <http://www.gnu.org/licenses/>. # # Original author: Mohit Agarwal. -# Send bug reports and any other correspondence to bug-texinfo@gnu.org. +# Send bug reports and any other correspondence to bug-gnulib@gnu.org. # # The latest version of this script, and the companion template, is -# available from Texinfo CVS: -# http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/util/gendocs.sh -# http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/util/gendocs_template +# available from the Gnulib repository: # -# An up-to-date copy is also maintained in Gnulib (gnu.org/software/gnulib). +# http://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/gendocs.sh +# http://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/gendocs_template # TODO: -# - image importation was only implemented for HTML generated by +# - image importing was only implemented for HTML generated by # makeinfo. But it should be simple enough to adjust. # - images are not imported in the source tarball. All the needed # formats (PDF, PNG, etc.) should be included. @@ -39,12 +37,12 @@ scriptversion=2013-10-10.09 prog=`basename "$0"` srcdir=`pwd` -scripturl="http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/util/gendocs.sh" -templateurl="http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/util/gendocs_template" +scripturl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/gendocs.sh" +templateurl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_template" : ${SETLANG="env LANG= LC_MESSAGES= LC_ALL= LANGUAGE="} : ${MAKEINFO="makeinfo"} -: ${TEXI2DVI="texi2dvi -t @finalout"} +: ${TEXI2DVI="texi2dvi"} : ${DOCBOOK2HTML="docbook2html"} : ${DOCBOOK2PDF="docbook2pdf"} : ${DOCBOOK2TXT="docbook2txt"} @@ -54,9 +52,27 @@ templateurl="http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/ unset CDPATH unset use_texi2html +MANUAL_TITLE= +PACKAGE= +EMAIL=webmasters@gnu.org # please override with --email +commonarg= # passed to all makeinfo/texi2html invcations. +dirargs= # passed to all tools (-I dir). +dirs= # -I directories. +htmlarg="--css-ref=/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual" +infoarg=--no-split +generate_ascii=true +generate_html=true +generate_info=true +generate_tex=true +outdir=manual +source_extra= +split=node +srcfile= +texarg="-t @finalout" + version="gendocs.sh $scriptversion -Copyright 2013 Free Software Foundation, Inc. +Copyright 2017 Free Software Foundation, Inc. There is NO warranty. You may redistribute this software under the terms of the GNU General Public License. For more information about these matters, see the files named COPYING." @@ -75,11 +91,16 @@ Options: -o OUTDIR write files into OUTDIR, instead of manual/. -I DIR append DIR to the Texinfo search path. --common ARG pass ARG in all invocations. - --html ARG pass ARG to makeinfo or texi2html for HTML targets. + --html ARG pass ARG to makeinfo or texi2html for HTML targets, + instead of '$htmlarg'. --info ARG pass ARG to makeinfo for Info, instead of --no-split. --no-ascii skip generating the plain text output. + --no-html skip generating the html output. + --no-info skip generating the info output. + --no-tex skip generating the dvi and pdf output. --source ARG include ARG in tar archive of sources. --split HOW make split HTML by node, section, chapter; default node. + --tex ARG pass ARG to texi2dvi for DVI and PDF, instead of -t @finalout. --texi2html use texi2html to make HTML target, with all split versions. --docbook convert through DocBook too (xml, txt, html, pdf). @@ -131,23 +152,9 @@ locale, since that's the language of most Texinfo manuals. If you happen to have a non-English manual and non-English web site, see the SETLANG setting in the source. -Email bug reports or enhancement requests to bug-texinfo@gnu.org. +Email bug reports or enhancement requests to bug-gnulib@gnu.org. " -MANUAL_TITLE= -PACKAGE= -EMAIL=webmasters@gnu.org # please override with --email -commonarg= # passed to all makeinfo/texi2html invcations. -dirargs= # passed to all tools (-I dir). -dirs= # -I's directories. -htmlarg= -infoarg=--no-split -generate_ascii=true -outdir=manual -source_extra= -split=node -srcfile= - while test $# -gt 0; do case $1 in -s) shift; srcfile=$1;; @@ -159,8 +166,12 @@ while test $# -gt 0; do --html) shift; htmlarg=$1;; --info) shift; infoarg=$1;; --no-ascii) generate_ascii=false;; + --no-html) generate_ascii=false;; + --no-info) generate_info=false;; + --no-tex) generate_tex=false;; --source) shift; source_extra=$1;; --split) shift; split=$1;; + --tex) shift; texarg=$1;; --texi2html) use_texi2html=1;; --help) echo "$usage"; exit 0;; @@ -221,8 +232,9 @@ calcsize() # copy_images OUTDIR HTML-FILE... # ------------------------------- -# Copy all the images needed by the HTML-FILEs into OUTDIR. Look -# for them in the -I directories. +# Copy all the images needed by the HTML-FILEs into OUTDIR. +# Look for them in . and the -I directories; this is simpler than what +# makeinfo supports with -I, but hopefully it will suffice. copy_images() { local odir @@ -232,7 +244,7 @@ copy_images() BEGIN { \$me = '$prog'; \$odir = '$odir'; - @dirs = qw($dirs); + @dirs = qw(. $dirs); } " -e ' /<img src="(.*?)"/g && ++$need{$1}; @@ -270,32 +282,39 @@ echo "Making output for $srcfile" echo " in `pwd`" mkdir -p "$outdir/" -cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $commonarg $infoarg \"$srcfile\"" -echo "Generating info... ($cmd)" -rm -f $PACKAGE.info* # get rid of any strays -eval "$cmd" -tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info* -ls -l "$outdir/$PACKAGE.info.tar.gz" -info_tgz_size=`calcsize "$outdir/$PACKAGE.info.tar.gz"` -# do not mv the info files, there's no point in having them available -# separately on the web. - -cmd="$SETLANG $TEXI2DVI $dirargs \"$srcfile\"" -printf "\nGenerating dvi... ($cmd)\n" -eval "$cmd" -# compress/finish dvi: -gzip -f -9 $PACKAGE.dvi -dvi_gz_size=`calcsize $PACKAGE.dvi.gz` -mv $PACKAGE.dvi.gz "$outdir/" -ls -l "$outdir/$PACKAGE.dvi.gz" - -cmd="$SETLANG $TEXI2DVI --pdf $dirargs \"$srcfile\"" -printf "\nGenerating pdf... ($cmd)\n" -eval "$cmd" -pdf_size=`calcsize $PACKAGE.pdf` -mv $PACKAGE.pdf "$outdir/" -ls -l "$outdir/$PACKAGE.pdf" +# +if $generate_info; then + cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $commonarg $infoarg \"$srcfile\"" + echo "Generating info... ($cmd)" + rm -f $PACKAGE.info* # get rid of any strays + eval "$cmd" + tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info* + ls -l "$outdir/$PACKAGE.info.tar.gz" + info_tgz_size=`calcsize "$outdir/$PACKAGE.info.tar.gz"` + # do not mv the info files, there's no point in having them available + # separately on the web. +fi # end info + +# +if $generate_tex; then + cmd="$SETLANG $TEXI2DVI $dirargs $texarg \"$srcfile\"" + printf "\nGenerating dvi... ($cmd)\n" + eval "$cmd" + # compress/finish dvi: + gzip -f -9 $PACKAGE.dvi + dvi_gz_size=`calcsize $PACKAGE.dvi.gz` + mv $PACKAGE.dvi.gz "$outdir/" + ls -l "$outdir/$PACKAGE.dvi.gz" + + cmd="$SETLANG $TEXI2DVI --pdf $dirargs $texarg \"$srcfile\"" + printf "\nGenerating pdf... ($cmd)\n" + eval "$cmd" + pdf_size=`calcsize $PACKAGE.pdf` + mv $PACKAGE.pdf "$outdir/" + ls -l "$outdir/$PACKAGE.pdf" +fi # end tex (dvi + pdf) +# if $generate_ascii; then opt="-o $PACKAGE.txt --no-split --no-headers $commonarg" cmd="$SETLANG $MAKEINFO $opt \"$srcfile\"" @@ -308,6 +327,9 @@ if $generate_ascii; then ls -l "$outdir/$PACKAGE.txt" "$outdir/$PACKAGE.txt.gz" fi +# + +if $generate_html; then # Split HTML at level $1. Used for texi2html. html_split() { @@ -382,7 +404,9 @@ else # use texi2html: html_split chapter html_split section fi +fi # end html +# printf "\nMaking .tar.gz for sources...\n" d=`dirname $srcfile` ( @@ -393,6 +417,8 @@ d=`dirname $srcfile` ) texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"` +# +# Do everything again through docbook. if test -n "$docbook"; then opt="-o - --docbook $commonarg" cmd="$SETLANG $MAKEINFO $opt \"$srcfile\" >${srcdir}/$PACKAGE-db.xml" @@ -431,7 +457,8 @@ if test -n "$docbook"; then mv $PACKAGE-db.pdf "$outdir/" fi -printf "\nMaking index file...\n" +# +printf "\nMaking index.html for $PACKAGE...\n" if test -z "$use_texi2html"; then CONDS="/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\ /%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d" diff --git a/build-aux/gnupload b/build-aux/gnupload index 2da97d8..d4d95ee 100755 --- a/build-aux/gnupload +++ b/build-aux/gnupload @@ -1,9 +1,9 @@ #!/bin/sh # Sign files and upload them. -scriptversion=2013-03-19.17; # UTC +scriptversion=2016-01-11.22; # UTC -# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# Copyright (C) 2004-2017 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -435,6 +435,6 @@ exit 0 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/pmccabe2html b/build-aux/pmccabe2html index 81dd932..19e8097 100644 --- a/build-aux/pmccabe2html +++ b/build-aux/pmccabe2html @@ -1,6 +1,6 @@ # pmccabe2html - AWK script to convert pmccabe output to html -*- awk -*- -# Copyright (C) 2007-2014 Free Software Foundation, Inc. +# Copyright (C) 2007-2017 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -422,9 +422,9 @@ function html_fnc (nfun, while ((getline codeline < (fname nfun "_fn.txt")) > 0) { - gsub(/&/, "\&", codeline) # Must come first. - gsub(/</, "\<", codeline) - gsub(/>/, "\>", codeline) + gsub(/&/, "\\&", codeline) # Must come first. + gsub(/</, "\\<", codeline) + gsub(/>/, "\\>", codeline) print codeline } diff --git a/build-aux/snippet/arg-nonnull.h b/build-aux/snippet/arg-nonnull.h index 9ee8b15..1e62cc8 100644 --- a/build-aux/snippet/arg-nonnull.h +++ b/build-aux/snippet/arg-nonnull.h @@ -1,5 +1,5 @@ /* A C macro for declaring that specific arguments must not be NULL. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/build-aux/snippet/c++defs.h b/build-aux/snippet/c++defs.h index 67b1233..f03f359 100644 --- a/build-aux/snippet/c++defs.h +++ b/build-aux/snippet/c++defs.h @@ -1,5 +1,5 @@ /* C++ compatible function declaration macros. - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -17,6 +17,15 @@ #ifndef _GL_CXXDEFS_H #define _GL_CXXDEFS_H +/* Begin/end the GNULIB_NAMESPACE namespace. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { +# define _GL_END_NAMESPACE } +#else +# define _GL_BEGIN_NAMESPACE +# define _GL_END_NAMESPACE +#endif + /* The three most frequent use cases of these macros are: * For providing a substitute for a function that is missing on some @@ -111,14 +120,25 @@ that redirects to rpl_func, if GNULIB_NAMESPACE is defined. Example: _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); - */ + + Wrapping rpl_func in an object with an inline conversion operator + avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is + actually used in the program. */ #define _GL_CXXALIAS_RPL(func,rettype,parameters) \ _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) #if defined __cplusplus && defined GNULIB_NAMESPACE # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ namespace GNULIB_NAMESPACE \ { \ - rettype (*const func) parameters = ::rpl_func; \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return ::rpl_func; \ + } \ + } func = {}; \ } \ _GL_EXTERN_C int _gl_cxxalias_dummy #else @@ -135,8 +155,15 @@ # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ namespace GNULIB_NAMESPACE \ { \ - rettype (*const func) parameters = \ - reinterpret_cast<rettype(*)parameters>(::rpl_func); \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return reinterpret_cast<type>(::rpl_func); \ + } \ + } func = {}; \ } \ _GL_EXTERN_C int _gl_cxxalias_dummy #else @@ -150,19 +177,24 @@ is defined. Example: _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); - */ + + Wrapping func in an object with an inline conversion operator + avoids a reference to func unless GNULIB_NAMESPACE::func is + actually used in the program. */ #if defined __cplusplus && defined GNULIB_NAMESPACE - /* If we were to write - rettype (*const func) parameters = ::func; - like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls - better (remove an indirection through a 'static' pointer variable), - but then the _GL_CXXALIASWARN macro below would cause a warning not only - for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */ -# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static rettype (*func) parameters = ::func; \ - } \ +# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return ::func; \ + } \ + } func = {}; \ + } \ _GL_EXTERN_C int _gl_cxxalias_dummy #else # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ @@ -178,8 +210,15 @@ # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ namespace GNULIB_NAMESPACE \ { \ - static rettype (*func) parameters = \ - reinterpret_cast<rettype(*)parameters>(::func); \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return reinterpret_cast<type>(::func); \ + } \ + } func = {}; \ } \ _GL_EXTERN_C int _gl_cxxalias_dummy #else @@ -202,9 +241,15 @@ # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ namespace GNULIB_NAMESPACE \ { \ - static rettype (*func) parameters = \ - reinterpret_cast<rettype(*)parameters>( \ - (rettype2(*)parameters2)(::func)); \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \ + } \ + } func = {}; \ } \ _GL_EXTERN_C int _gl_cxxalias_dummy #else diff --git a/build-aux/snippet/warn-on-use.h b/build-aux/snippet/warn-on-use.h index 1c4d7bd..3c0eb57 100644 --- a/build-aux/snippet/warn-on-use.h +++ b/build-aux/snippet/warn-on-use.h @@ -1,5 +1,5 @@ /* A C macro for emitting warnings if a function is used. - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff --git a/build-aux/update-copyright b/build-aux/update-copyright index 90624e9..2d20d21 100755 --- a/build-aux/update-copyright +++ b/build-aux/update-copyright @@ -1,11 +1,11 @@ -eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" ${1+"$@"}' +eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"' & eval 'exec perl -wS -0777 -pi "$0" $argv:q' if 0; # Update an FSF copyright year list to include the current year. -my $VERSION = '2013-01-03.09:41'; # UTC +my $VERSION = '2016-01-12.23:13'; # UTC -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -124,7 +124,7 @@ use strict; use warnings; my $copyright_re = 'Copyright'; -my $circle_c_re = '(?:\([cC]\)|@copyright{}|©)'; +my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|©)'; my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER}; $holder ||= 'Free Software Foundation, Inc.'; my $prefix_max = 5; @@ -269,6 +269,6 @@ else # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "my $VERSION = '" # time-stamp-format: "%:y-%02m-%02d.%02H:%02M" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "'; # UTC" # End: diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free index 4c76c75..4e3f3a2 100755 --- a/build-aux/useless-if-before-free +++ b/build-aux/useless-if-before-free @@ -1,16 +1,16 @@ -eval '(exit $?0)' && eval 'exec perl -wST "$0" ${1+"$@"}' +eval '(exit $?0)' && eval 'exec perl -wST "$0" "$@"' & eval 'exec perl -wST "$0" $argv:q' if 0; # Detect instances of "if (p) free (p);". # Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces. -my $VERSION = '2012-01-06 07:23'; # UTC +my $VERSION = '2016-08-01 17:47'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook # do its job. Otherwise, update this string manually. -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2017 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -129,6 +129,9 @@ sub is_NULL ($) $err = EXIT_ERROR, next; while (defined (my $line = <FH>)) { + # Skip non-matching lines early to save time + $line =~ /\bif\b/ + or next; while ($line =~ /\b(if\s*\(\s*([^)]+?)(?:\s*!=\s*([^)]+?))?\s*\) # 1 2 3 @@ -202,6 +205,6 @@ EOF ## eval: (add-hook 'write-file-hooks 'time-stamp) ## time-stamp-start: "my $VERSION = '" ## time-stamp-format: "%:y-%02m-%02d %02H:%02M" -## time-stamp-time-zone: "UTC" +## time-stamp-time-zone: "UTC0" ## time-stamp-end: "'; # UTC" ## End: diff --git a/build-aux/vc-list-files b/build-aux/vc-list-files index b2bca54..2d17eaf 100755 --- a/build-aux/vc-list-files +++ b/build-aux/vc-list-files @@ -2,9 +2,9 @@ # List version-controlled file names. # Print a version string. -scriptversion=2011-05-16.22; # UTC +scriptversion=2016-01-11.22; # UTC -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2017 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -108,6 +108,6 @@ done # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/config.h.in b/config.h.in index de667d0..58eab21 100644 --- a/config.h.in +++ b/config.h.in @@ -29,6 +29,10 @@ whether the gnulib module fscanf shall be considered present. */ #undef GNULIB_FSCANF +/* Define to 1 if printf and friends should be labeled with attribute + "__gnu_printf__" instead of "__printf__" */ +#undef GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU + /* Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module scanf shall be considered present. */ #undef GNULIB_SCANF @@ -42,9 +46,6 @@ /* Define to 1 when the gnulib module ftello should be tested. */ #undef GNULIB_TEST_FTELLO -/* Define to 1 when the gnulib module getopt-gnu should be tested. */ -#undef GNULIB_TEST_GETOPT_GNU - /* Define to 1 when the gnulib module gettimeofday should be tested. */ #undef GNULIB_TEST_GETTIMEOFDAY @@ -100,6 +101,9 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H + /* Define to 1 if the system has the type 'long long int'. */ #undef HAVE_LONG_LONG_INT @@ -345,6 +349,9 @@ /* Define to 1 if pwrite is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PWRITE +/* Define to 1 if qsort_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_QSORT_R + /* Define to 1 if random is declared even after undefining macros. */ #undef HAVE_RAW_DECL_RANDOM @@ -562,6 +569,9 @@ /* Define to 1 if you have the <winsock2.h> header file. */ #undef HAVE_WINSOCK2_H +/* Define if you have the 'wint_t' type. */ +#undef HAVE_WINT_T + /* Define to 1 if you have the `_ftelli64' function. */ #undef HAVE__FTELLI64 @@ -578,6 +588,12 @@ */ #undef LT_OBJDIR +/* Use GNU style printf and scanf. */ +#ifndef __USE_MINGW_ANSI_STDIO +# undef __USE_MINGW_ANSI_STDIO +#endif + + /* Name of package */ #undef PACKAGE @@ -636,7 +652,7 @@ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif -/* Enable general extensions on OS X. */ +/* Enable general extensions on macOS. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif @@ -648,6 +664,34 @@ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE @@ -722,6 +766,12 @@ used. */ #undef __GETOPT_PREFIX +/* Define to 1 if the system <stdint.h> predates C++11. */ +#undef __STDC_CONSTANT_MACROS + +/* Define to 1 if the system <stdint.h> predates C++11. */ +#undef __STDC_LIMIT_MACROS + /* Please see the Gnulib manual for how to use these macros. Suppress extern inline with HP-UX cc, as it appears to be broken; see @@ -733,13 +783,28 @@ 'reference to static identifier "f" in extern inline function'. This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. - Suppress the use of extern inline on problematic Apple configurations. - OS X 10.8 and earlier mishandle it; see, e.g., - <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>. + Suppress extern inline (with or without __attribute__ ((__gnu_inline__))) + on configurations that mistakenly use 'static inline' to implement + functions or macros in standard C headers like <ctype.h>. For example, + if isdigit is mistakenly implemented via a static inline function, + a program containing an extern inline function that calls isdigit + may not work since the C standard prohibits extern inline functions + from calling static functions. This bug is known to occur on: + + OS X 10.8 and earlier; see: + http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html + + DragonFly; see + http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log + + FreeBSD; see: + http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html + OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and for clang but remains for g++; see <http://trac.macports.org/ticket/41033>. - Perhaps Apple will fix this some day. */ -#if (defined __APPLE__ \ + Assume DragonFly and FreeBSD will be similar. */ +#if (((defined __APPLE__ && defined __MACH__) \ + || defined __DragonFly__ || defined __FreeBSD__) \ && (defined __header_inline \ ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \ && ! defined __clang__) \ @@ -747,19 +812,20 @@ && (defined __GNUC__ || defined __cplusplus)) \ || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \ && defined __GNUC__ && ! defined __cplusplus)))) -# define _GL_EXTERN_INLINE_APPLE_BUG +# define _GL_EXTERN_INLINE_STDHEADER_BUG #endif #if ((__GNUC__ \ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ : (199901L <= __STDC_VERSION__ \ && !defined __HP_cc \ + && !defined __PGI \ && !(defined __SUNPRO_C && __STDC__))) \ - && !defined _GL_EXTERN_INLINE_APPLE_BUG) + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) # define _GL_INLINE inline # define _GL_EXTERN_INLINE extern inline # define _GL_EXTERN_INLINE_IN_USE #elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \ - && !defined _GL_EXTERN_INLINE_APPLE_BUG) + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) # if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__ /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) @@ -773,17 +839,19 @@ # define _GL_EXTERN_INLINE static _GL_UNUSED #endif -#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) +/* In GCC 4.6 (inclusive) to 5.1 (exclusive), + suppress bogus "no previous prototype for 'FOO'" + and "no previous declaration for 'FOO'" diagnostics, + when FOO is an inline function in the header; see + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */ +#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__ # if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ # define _GL_INLINE_HEADER_CONST_PRAGMA # else # define _GL_INLINE_HEADER_CONST_PRAGMA \ _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") # endif - /* Suppress GCC's bogus "no previous prototype for 'FOO'" - and "no previous declaration for 'FOO'" diagnostics, - when FOO is an inline function in the header; see - <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>. */ # define _GL_INLINE_HEADER_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ @@ -847,6 +915,16 @@ is a misnomer outside of parameter lists. */ #define _UNUSED_PARAMETER_ _GL_UNUSED +/* gcc supports the "unused" attribute on possibly unused labels, and + g++ has since version 4.5. Note to support C++ as well as C, + _GL_UNUSED_LABEL should be used with a trailing ; */ +#if !defined __cplusplus || __GNUC__ > 4 \ + || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# define _GL_UNUSED_LABEL _GL_UNUSED +#else +# define _GL_UNUSED_LABEL +#endif + /* The __pure__ attribute was added in gcc 2.96. */ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for GNU Libtasn1 4.9. +# Generated by GNU Autoconf 2.69 for GNU Libtasn1 4.10. # # Report bugs to <help-libtasn1@gnu.org>. # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='GNU Libtasn1' PACKAGE_TARNAME='libtasn1' -PACKAGE_VERSION='4.9' -PACKAGE_STRING='GNU Libtasn1 4.9' +PACKAGE_VERSION='4.10' +PACKAGE_STRING='GNU Libtasn1 4.10' PACKAGE_BUGREPORT='help-libtasn1@gnu.org' PACKAGE_URL='http://www.gnu.org/software/libtasn1/' @@ -649,7 +649,6 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS WARN_CFLAGS -WERROR_CFLAGS lgltests_WITNESS NEXT_AS_FIRST_DIRECTIVE_STRING_H NEXT_STRING_H @@ -735,6 +734,7 @@ VALGRIND HAVE_UNISTD_H NEXT_AS_FIRST_DIRECTIVE_UNISTD_H NEXT_UNISTD_H +UNISTD_H_DEFINES_STRUCT_TIMESPEC PTHREAD_H_DEFINES_STRUCT_TIMESPEC SYS_TIME_H_DEFINES_STRUCT_TIMESPEC TIME_H_DEFINES_STRUCT_TIMESPEC @@ -750,6 +750,7 @@ HAVE_TIMEGM HAVE_STRPTIME HAVE_NANOSLEEP HAVE_DECL_LOCALTIME_R +GNULIB_TIME_RZ GNULIB_TIME_R GNULIB_TIMEGM GNULIB_STRPTIME @@ -762,6 +763,9 @@ NEXT_STDIO_H GL_GENERATE_STDINT_H_FALSE GL_GENERATE_STDINT_H_TRUE STDINT_H +HAVE_SYS_INTTYPES_H +HAVE_SYS_BITYPES_H +HAVE_C99_STDINT_H WINT_T_SUFFIX WCHAR_T_SUFFIX SIG_ATOMIC_T_SUFFIX @@ -775,8 +779,6 @@ BITSIZEOF_WCHAR_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_PTRDIFF_T -HAVE_SYS_BITYPES_H -HAVE_SYS_INTTYPES_H HAVE_STDINT_H NEXT_AS_FIRST_DIRECTIVE_STDINT_H NEXT_STDINT_H @@ -785,12 +787,14 @@ HAVE_INTTYPES_H HAVE_WCHAR_H HAVE_UNSIGNED_LONG_LONG_INT HAVE_LONG_LONG_INT +GNULIB_OVERRIDES_WINT_T NEXT_AS_FIRST_DIRECTIVE_STDDEF_H NEXT_STDDEF_H GL_GENERATE_STDDEF_H_FALSE GL_GENERATE_STDDEF_H_TRUE STDDEF_H HAVE_WCHAR_T +HAVE_MAX_ALIGN_T REPLACE_NULL GL_GENERATE_STDARG_H_FALSE GL_GENERATE_STDARG_H_TRUE @@ -806,6 +810,7 @@ REPLACE_SETENV REPLACE_REALPATH REPLACE_REALLOC REPLACE_RANDOM_R +REPLACE_QSORT_R REPLACE_PUTENV REPLACE_PTSNAME_R REPLACE_PTSNAME @@ -829,6 +834,7 @@ HAVE_REALPATH HAVE_RANDOM_R HAVE_RANDOM_H HAVE_RANDOM +HAVE_QSORT_R HAVE_PTSNAME_R HAVE_PTSNAME HAVE_POSIX_OPENPT @@ -857,6 +863,7 @@ GNULIB_REALPATH GNULIB_REALLOC_POSIX GNULIB_RANDOM_R GNULIB_RANDOM +GNULIB_QSORT_R GNULIB_PUTENV GNULIB_PTSNAME_R GNULIB_PTSNAME @@ -875,11 +882,17 @@ GNULIB_CANONICALIZE_FILE_NAME GNULIB_CALLOC_POSIX GNULIB_ATOLL GNULIB__EXIT +GL_GENERATE_LIMITS_H_FALSE +GL_GENERATE_LIMITS_H_TRUE +LIMITS_H +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H +NEXT_LIMITS_H HAVE_WINSOCK2_H NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H NEXT_SYS_TIME_H REPLACE_STRUCT_TIMEVAL REPLACE_GETTIMEOFDAY +HAVE_TIMEZONE_T HAVE_SYS_TIME_H HAVE_STRUCT_TIMEVAL HAVE_GETTIMEOFDAY @@ -1039,9 +1052,11 @@ REPLACE_USLEEP REPLACE_UNLINKAT REPLACE_UNLINK REPLACE_TTYNAME_R +REPLACE_SYMLINKAT REPLACE_SYMLINK REPLACE_SLEEP REPLACE_RMDIR +REPLACE_READLINKAT REPLACE_READLINK REPLACE_READ REPLACE_PWRITE @@ -1070,6 +1085,7 @@ HAVE_DECL_SETHOSTNAME HAVE_DECL_GETUSERSHELL HAVE_DECL_GETPAGESIZE HAVE_DECL_GETLOGIN_R +HAVE_DECL_GETLOGIN HAVE_DECL_GETDOMAINNAME HAVE_DECL_FDATASYNC HAVE_DECL_FCHDIR @@ -1200,7 +1216,6 @@ LD FGREP SED LIBTOOL -ac_ct_AR OBJDUMP DLLTOOL AS @@ -1219,6 +1234,7 @@ build_cpu build RANLIB ARFLAGS +ac_ct_AR AR EGREP GREP @@ -1896,7 +1912,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GNU Libtasn1 4.9 to adapt to many kinds of systems. +\`configure' configures GNU Libtasn1 4.10 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1967,7 +1983,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU Libtasn1 4.9:";; + short | recursive ) echo "Configuration of GNU Libtasn1 4.10:";; esac cat <<\_ACEOF @@ -1991,7 +2007,8 @@ Optional Features: --enable-gtk-doc use gtk-doc to build documentation [[default=no]] --enable-gtk-doc-html build documentation in html format [[default=yes]] --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] - --enable-valgrind-tests run self tests under valgrind + --disable-valgrind-tests + don't try to run self tests under valgrind --enable-ld-version-script enable linker version script (default is enabled when possible) @@ -2096,7 +2113,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GNU Libtasn1 configure 4.9 +GNU Libtasn1 configure 4.10 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2748,7 +2765,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GNU Libtasn1 $as_me 4.9, which was +It was created by GNU Libtasn1 $as_me 4.10, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3036,6 +3053,7 @@ as_fn_append ac_func_list " gettimeofday" as_fn_append ac_func_list " nanotime" as_fn_append ac_header_list " sys/time.h" as_fn_append ac_header_list " sys/socket.h" +as_fn_append ac_header_list " limits.h" as_fn_append ac_header_list " unistd.h" as_fn_append ac_header_list " wchar.h" as_fn_append ac_header_list " stdint.h" @@ -3625,7 +3643,7 @@ fi # Define the identity of the package. PACKAGE='libtasn1' - VERSION='4.9' + VERSION='4.10' cat >>confdefs.h <<_ACEOF @@ -3764,7 +3782,7 @@ AM_BACKSLASH='\' # Interfaces removed: AGE=0 LT_CURRENT=11 -LT_REVISION=2 +LT_REVISION=3 LT_AGE=5 @@ -5077,6 +5095,270 @@ $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> +#include <stdlib.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + +$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +$as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if ${ac_cv_should_define__xopen_source+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_should_define__xopen_source=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <wchar.h> + mbstate_t x; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _XOPEN_SOURCE 500 + #include <wchar.h> + mbstate_t x; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_should_define__xopen_source=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +$as_echo "$ac_cv_should_define__xopen_source" >&6; } + test $ac_cv_should_define__xopen_source = yes && + $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5 @@ -5105,14 +5387,189 @@ rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5 $as_echo "$gl_cv_c_amsterdam_compiler" >&6; } - if test -z "$AR"; then - if test $gl_cv_c_amsterdam_compiler = yes; then + + if test $gl_cv_c_amsterdam_compiler = yes; then + if test -z "$AR"; then AR='cc -c.a' - if test -z "$ARFLAGS"; then - ARFLAGS='-o' + fi + if test -z "$ARFLAGS"; then + ARFLAGS='-o' + fi + else + if test -n "$ac_tool_prefix"; then + for ac_prog in ar lib "link -lib" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar lib "link -lib" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 +$as_echo_n "checking the archiver ($AR) interface... " >&6; } +if ${am_cv_ar_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + am_cv_ar_interface=ar + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int some_variable = 0; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi fi - else - if test -n "$ac_tool_prefix"; then + rm -f conftest.lib libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +$as_echo "$am_cv_ar_interface" >&6; } + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + as_fn_error $? "could not determine $AR interface" "$LINENO" 5 + ;; +esac + + fi + + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -5204,17 +5661,12 @@ else AR="$ac_cv_prog_AR" fi - if test -z "$ARFLAGS"; then - ARFLAGS='cru' - fi - fi - else - if test -z "$ARFLAGS"; then - ARFLAGS='cru' - fi + if test -z "$ARFLAGS"; then + ARFLAGS='cr' fi + if test -z "$RANLIB"; then if test $gl_cv_c_amsterdam_compiler = yes; then RANLIB=':' @@ -5386,255 +5838,6 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ctype.h> -#include <stdlib.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" -if test "x$ac_cv_header_minix_config_h" = xyes; then : - MINIX=yes -else - MINIX= -fi - - - if test "$MINIX" = yes; then - -$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h - - -$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h - - -$as_echo "#define _MINIX 1" >>confdefs.h - - -$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 -$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if ${ac_cv_safe_to_define___extensions__+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# define __EXTENSIONS__ 1 - $ac_includes_default -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_safe_to_define___extensions__=yes -else - ac_cv_safe_to_define___extensions__=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 -$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h - - $as_echo "#define _ALL_SOURCE 1" >>confdefs.h - - $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h - - $as_echo "#define _GNU_SOURCE 1" >>confdefs.h - - $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h - - $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 -$as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; } -if ${ac_cv_should_define__xopen_source+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_should_define__xopen_source=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include <wchar.h> - mbstate_t x; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #define _XOPEN_SOURCE 500 - #include <wchar.h> - mbstate_t x; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_should_define__xopen_source=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 -$as_echo "$ac_cv_should_define__xopen_source" >&6; } - test $ac_cv_should_define__xopen_source = yes && - $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } if ${ac_cv_sys_largefile_source+:} false; then : @@ -6199,6 +6402,10 @@ esac + # Pre-early section. + + + # Code from module absolute-header: # Code from module autobuild: @@ -6237,7 +6444,6 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;} # Code from module clock-time: # Code from module errno: # Code from module extensions: - # Code from module extern-inline: # Code from module fdl-1.3: # Code from module fstat: @@ -6255,6 +6461,7 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;} # Code from module include_next: # Code from module largefile: + # Code from module limits-h: # Code from module lseek: # Code from module maintainer-makefile: # Code from module malloc-posix: @@ -6296,15 +6503,19 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;} + # Pre-early section. + + + # Code from module absolute-header: # Code from module extensions: - # Code from module extern-inline: # Code from module hash-pjw-bare: # Code from module include_next: # Code from module intprops: # Code from module lib-symbol-versions: # Code from module lib-symbol-visibility: + # Code from module limits-h: # Code from module minmax: # Code from module multiarch: # Code from module snippet/arg-nonnull: @@ -6316,6 +6527,7 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;} # Code from module string: # Code from module strverscmp: # Code from module sys_types: + # Code from module verify: for ac_prog in 'bison -y' byacc do @@ -14984,6 +15196,7 @@ $as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; } HAVE_DECL_FCHDIR=1; HAVE_DECL_FDATASYNC=1; HAVE_DECL_GETDOMAINNAME=1; + HAVE_DECL_GETLOGIN=1; HAVE_DECL_GETLOGIN_R=1; HAVE_DECL_GETPAGESIZE=1; HAVE_DECL_GETUSERSHELL=1; @@ -15012,9 +15225,11 @@ $as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; } REPLACE_PWRITE=0; REPLACE_READ=0; REPLACE_READLINK=0; + REPLACE_READLINKAT=0; REPLACE_RMDIR=0; REPLACE_SLEEP=0; REPLACE_SYMLINK=0; + REPLACE_SYMLINKAT=0; REPLACE_TTYNAME_R=0; REPLACE_UNLINK=0; REPLACE_UNLINKAT=0; @@ -16175,11 +16390,12 @@ nocrash_init (void) #else /* Avoid a crash on POSIX systems. */ #include <signal.h> +#include <unistd.h> /* A POSIX signal handler. */ static void exception_handler (int sig) { - exit (1); + _exit (1); } static void nocrash_init (void) @@ -16405,17 +16621,19 @@ else for ac_kw in __restrict __restrict__ _Restrict restrict; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -typedef int * int_ptr; - int foo (int_ptr $ac_kw ip) { - return ip[0]; - } +typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } + int main () { int s[1]; - int * $ac_kw t = s; - t[0] = 0; - return foo(t) + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + ; return 0; } @@ -16446,6 +16664,7 @@ _ACEOF HAVE_GETTIMEOFDAY=1; HAVE_STRUCT_TIMEVAL=1; HAVE_SYS_TIME_H=1; + HAVE_TIMEZONE_T=0; REPLACE_GETTIMEOFDAY=0; REPLACE_STRUCT_TIMEVAL=0; @@ -16696,6 +16915,132 @@ fi + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_limits_h='<'limits.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5 +$as_echo_n "checking absolute name of <limits.h>... " >&6; } +if ${gl_cv_next_limits_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_limits_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'limits.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_limits_h + gl_cv_next_limits_h='"'$gl_header'"' + else + gl_cv_next_limits_h='<'limits.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5 +$as_echo "$gl_cv_next_limits_h" >&6; } + fi + NEXT_LIMITS_H=$gl_cv_next_limits_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'limits.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_limits_h + fi + NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has ULLONG_WIDTH etc." >&5 +$as_echo_n "checking whether limits.h has ULLONG_WIDTH etc.... " >&6; } +if ${gl_cv_header_limits_width+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include <limits.h> + int ullw = ULLONG_WIDTH; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_limits_width=yes +else + gl_cv_header_limits_width=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5 +$as_echo "$gl_cv_header_limits_width" >&6; } + if test "$gl_cv_header_limits_width" = yes; then + LIMITS_H= + else + LIMITS_H=limits.h + fi + + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + + GNULIB__EXIT=0; GNULIB_ATOLL=0; GNULIB_CALLOC_POSIX=0; @@ -16714,6 +17059,7 @@ fi GNULIB_PTSNAME=0; GNULIB_PTSNAME_R=0; GNULIB_PUTENV=0; + GNULIB_QSORT_R=0; GNULIB_RANDOM=0; GNULIB_RANDOM_R=0; GNULIB_REALLOC_POSIX=0; @@ -16742,6 +17088,7 @@ fi HAVE_POSIX_OPENPT=1; HAVE_PTSNAME=1; HAVE_PTSNAME_R=1; + HAVE_QSORT_R=1; HAVE_RANDOM=1; HAVE_RANDOM_H=1; HAVE_RANDOM_R=1; @@ -16765,6 +17112,7 @@ fi REPLACE_PTSNAME=0; REPLACE_PTSNAME_R=0; REPLACE_PUTENV=0; + REPLACE_QSORT_R=0; REPLACE_RANDOM_R=0; REPLACE_REALLOC=0; REPLACE_REALPATH=0; @@ -16806,6 +17154,9 @@ fi $as_echo "$gl_cv_func_malloc_posix" >&6; } + + + gl_cv_c_multiarch=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16849,6 +17200,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext REPLACE_NULL=0; + HAVE_MAX_ALIGN_T=1; HAVE_WCHAR_T=1; @@ -16885,6 +17237,93 @@ $as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 +$as_echo_n "checking for wint_t... " >&6; } +if ${gt_cv_c_wint_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + wint_t foo = (wchar_t)'\0'; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_c_wint_t=yes +else + gt_cv_c_wint_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 +$as_echo "$gt_cv_c_wint_t" >&6; } + if test $gt_cv_c_wint_t = yes; then + +$as_echo "#define HAVE_WINT_T 1" >>confdefs.h + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5 +$as_echo_n "checking whether wint_t is too small... " >&6; } +if ${gl_cv_type_wint_t_too_small+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +#endif +#include <wchar.h> + int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_type_wint_t_too_small=no +else + gl_cv_type_wint_t_too_small=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5 +$as_echo "$gl_cv_type_wint_t_too_small" >&6; } + if test $gl_cv_type_wint_t_too_small = yes; then + GNULIB_OVERRIDES_WINT_T=1 + else + GNULIB_OVERRIDES_WINT_T=0 + fi + else + GNULIB_OVERRIDES_WINT_T=0 + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 $as_echo_n "checking for unsigned long long int... " >&6; } if ${ac_cv_type_unsigned_long_long_int+:} false; then : @@ -17008,6 +17447,9 @@ $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h + + + if test $ac_cv_type_long_long_int = yes; then HAVE_LONG_LONG_INT=1 else @@ -17141,6 +17583,8 @@ else #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 #include <stdint.h> /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ #if !(defined WCHAR_MIN && defined WCHAR_MAX) @@ -17231,6 +17675,15 @@ uintptr_t h = UINTPTR_MAX; intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; +/* Check that SIZE_MAX has the correct type, if possible. */ +#if 201112 <= __STDC_VERSION__ +int k = _Generic (SIZE_MAX, size_t: 0); +#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +extern size_t k; +extern __typeof__ (SIZE_MAX) k; +#endif + #include <limits.h> /* for CHAR_BIT */ #define TYPE_MINIMUM(t) \ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) @@ -17309,6 +17762,8 @@ else #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 #include <stdint.h> @@ -17394,8 +17849,111 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 $as_echo "$gl_cv_header_working_stdint_h" >&6; } fi + + HAVE_C99_STDINT_H=0 + HAVE_SYS_BITYPES_H=0 + HAVE_SYS_INTTYPES_H=0 + STDINT_H=stdint.h if test "$gl_cv_header_working_stdint_h" = yes; then - STDINT_H= + HAVE_C99_STDINT_H=1 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5 +$as_echo_n "checking whether stdint.h predates C++11... " >&6; } +if ${gl_cv_header_stdint_predates_cxx11_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_header_stdint_predates_cxx11_h=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include <stdint.h> + + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + +intmax_t im = INTMAX_MAX; +int32_t i32 = INT32_C (0x7fffffff); + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_stdint_predates_cxx11_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5 +$as_echo "$gl_cv_header_stdint_predates_cxx11_h" >&6; } + + if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + +$as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h + + +$as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5 +$as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; } +if ${gl_cv_header_stdint_width+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_header_stdint_width=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 + #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include <stdint.h> + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + int iw = UINTMAX_WIDTH; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_stdint_width=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5 +$as_echo "$gl_cv_header_stdint_width" >&6; } + if test "$gl_cv_header_stdint_width" = yes; then + STDINT_H= + fi else for ac_header in sys/inttypes.h sys/bitypes.h do : @@ -17412,19 +17970,12 @@ done if test $ac_cv_header_sys_inttypes_h = yes; then HAVE_SYS_INTTYPES_H=1 - else - HAVE_SYS_INTTYPES_H=0 fi - if test $ac_cv_header_sys_bitypes_h = yes; then HAVE_SYS_BITYPES_H=1 - else - HAVE_SYS_BITYPES_H=0 fi - - if test $APPLE_UNIVERSAL_BUILD = 0; then @@ -17718,13 +18269,26 @@ _ACEOF - if test $BITSIZEOF_WINT_T -lt 32; then + if test $GNULIB_OVERRIDES_WINT_T = 1; then BITSIZEOF_WINT_T=32 fi - STDINT_H=stdint.h fi + LIMITS_H=limits.h + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + + + if test -n "$STDINT_H"; then GL_GENERATE_STDINT_H_TRUE= GL_GENERATE_STDINT_H_FALSE='#' @@ -17740,6 +18304,7 @@ fi GNULIB_STRPTIME=0; GNULIB_TIMEGM=0; GNULIB_TIME_R=0; + GNULIB_TIME_RZ=0; HAVE_DECL_LOCALTIME_R=1; HAVE_NANOSLEEP=1; HAVE_STRPTIME=1; @@ -17785,6 +18350,7 @@ $as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; } TIME_H_DEFINES_STRUCT_TIMESPEC=0 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 + UNISTD_H_DEFINES_STRUCT_TIMESPEC=0 if test $gl_cv_sys_struct_timespec_in_time_h = yes; then TIME_H_DEFINES_STRUCT_TIMESPEC=1 else @@ -17845,6 +18411,36 @@ fi $as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; } if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5 +$as_echo_n "checking for struct timespec in <unistd.h>... " >&6; } +if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> + +int +main () +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_sys_struct_timespec_in_unistd_h=yes +else + gl_cv_sys_struct_timespec_in_unistd_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5 +$as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then + UNISTD_H_DEFINES_STRUCT_TIMESPEC=1 + fi fi fi fi @@ -17863,6 +18459,7 @@ $as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; } + if test $gl_cv_have_include_next = yes; then gl_cv_next_time_h='<'time.h'>' else @@ -18338,11 +18935,6 @@ $as_echo "#define GNULIB_TEST_FTELLO 1" >>confdefs.h -$as_echo "#define GNULIB_TEST_GETOPT_GNU 1" >>confdefs.h - - - - @@ -18611,6 +19203,7 @@ $as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lseek detects pipes" >&5 $as_echo_n "checking whether lseek detects pipes... " >&6; } if ${gl_cv_func_lseek_pipe+:} false; then : @@ -18761,17 +19354,6 @@ $as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h - - if test $ac_cv_func__set_invalid_parameter_handler = yes; then - HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 - -$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h - - else - HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 - fi - - if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then @@ -18785,8 +19367,6 @@ $as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h fi - - if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then @@ -19124,6 +19704,15 @@ fi STDDEF_H= + ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include <stddef.h> + +" +if test "x$ac_cv_type_max_align_t" = xyes; then : + +else + HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h +fi + if test $gt_cv_c_wchar_t = no; then HAVE_WCHAR_T=0 STDDEF_H=stddef.h @@ -19245,6 +19834,9 @@ $as_echo "$gl_cv_next_stddef_h" >&6; } + $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h + + @@ -19317,6 +19909,48 @@ $as_echo "$gl_cv_next_stdio_h" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5 +$as_echo_n "checking which flavor of printf attribute matches inttypes macros... " >&6; } +if ${gl_cv_func_printf_attribute_flavor+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define __STDC_FORMAT_MACROS 1 + #include <stdio.h> + #include <inttypes.h> + /* For non-mingw systems, compilation will trivially succeed. + For mingw, compilation will succeed for older mingw (system + printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ + #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; + #endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_printf_attribute_flavor=system +else + gl_cv_func_printf_attribute_flavor=gnu +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5 +$as_echo "$gl_cv_func_printf_attribute_flavor" >&6; } + if test "$gl_cv_func_printf_attribute_flavor" = gnu; then + +$as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h + + fi + GNULIB_FSCANF=1 @@ -19469,7 +20103,7 @@ $as_echo "$gl_cv_next_stdlib_h" >&6; } - for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do + for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } @@ -19875,7 +20509,7 @@ done fi - OPTS="-q --error-exitcode=1 --leak-check=no" + OPTS="-q --error-exitcode=6 --leak-check=no" if test -n "$VALGRIND" \ && $VALGRIND $OPTS $SHELL -c 'exit 0' > /dev/null 2>&1; then @@ -20023,7 +20657,7 @@ done fi - OPTS="-q --error-exitcode=1 --leak-check=no" + OPTS="-q --error-exitcode=6 --leak-check=no" if test -n "$VALGRIND" \ && $VALGRIND $OPTS $SHELL -c 'exit 0' > /dev/null 2>&1; then @@ -20341,17 +20975,17 @@ fi # Check whether --enable-ld-version-script was given. if test "${enable_ld_version_script+set}" = set; then : enableval=$enable_ld_version_script; have_ld_version_script=$enableval -fi - - if test -z "$have_ld_version_script"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if LD -Wl,--version-script works" >&5 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if LD -Wl,--version-script works" >&5 $as_echo_n "checking if LD -Wl,--version-script works... " >&6; } - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" - cat > conftest.map <<EOF -foo -EOF - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if ${gl_cv_sys_ld_version_script+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_sys_ld_version_script=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" + echo foo >conftest.map + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -20363,14 +20997,9 @@ main () } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - accepts_syntax_errors=yes + else - accepts_syntax_errors=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test "$accepts_syntax_errors" = no; then - cat > conftest.map <<EOF + cat > conftest.map <<EOF VERS_1 { global: sym; }; @@ -20379,7 +21008,7 @@ VERS_2 { global: sym; } VERS_1; EOF - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -20391,21 +21020,22 @@ main () } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - have_ld_version_script=yes -else - have_ld_version_script=no + gl_cv_sys_ld_version_script=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - else - have_ld_version_script=no - fi - rm -f conftest.map - LDFLAGS="$save_LDFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ld_version_script" >&5 -$as_echo "$have_ld_version_script" >&6; } - fi - if test "$have_ld_version_script" = "yes"; then +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + rm -f conftest.map + LDFLAGS=$save_LDFLAGS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_ld_version_script" >&5 +$as_echo "$gl_cv_sys_ld_version_script" >&6; } + have_ld_version_script=$gl_cv_sys_ld_version_script +fi + + if test "$have_ld_version_script" = yes; then HAVE_LD_VERSION_SCRIPT_TRUE= HAVE_LD_VERSION_SCRIPT_FALSE='#' else @@ -20505,6 +21135,7 @@ _ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 $as_echo_n "checking for ssize_t... " >&6; } if ${gt_cv_ssize_t+:} false; then : @@ -20541,6 +21172,15 @@ $as_echo "#define ssize_t int" >>confdefs.h STDDEF_H= + ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include <stddef.h> + +" +if test "x$ac_cv_type_max_align_t" = xyes; then : + +else + HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h +fi + if test $gt_cv_c_wchar_t = no; then HAVE_WCHAR_T=0 STDDEF_H=stddef.h @@ -20764,81 +21404,6 @@ fi if test "$gl_gcc_warnings" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5 -$as_echo_n "checking whether C compiler handles -Werror -Wunknown-warning-option... " >&6; } -if ${gl_cv_warn_c__Werror__Wunknown_warning_option+:} false; then : - $as_echo_n "(cached) " >&6 -else - - gl_save_compiler_FLAGS="$CFLAGS" - as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gl_cv_warn_c__Werror__Wunknown_warning_option=yes -else - gl_cv_warn_c__Werror__Wunknown_warning_option=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$gl_save_compiler_FLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror__Wunknown_warning_option" >&5 -$as_echo "$gl_cv_warn_c__Werror__Wunknown_warning_option" >&6; } -if test "x$gl_cv_warn_c__Werror__Wunknown_warning_option" = xyes; then : - gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' -else - gl_unknown_warnings_are_errors= -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5 -$as_echo_n "checking whether C compiler handles -Werror... " >&6; } -if ${gl_cv_warn_c__Werror+:} false; then : - $as_echo_n "(cached) " >&6 -else - - gl_save_compiler_FLAGS="$CFLAGS" - as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gl_cv_warn_c__Werror=yes -else - gl_cv_warn_c__Werror=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$gl_save_compiler_FLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror" >&5 -$as_echo "$gl_cv_warn_c__Werror" >&6; } -if test "x$gl_cv_warn_c__Werror" = xyes; then : - as_fn_append WERROR_CFLAGS " -Werror" -fi - - - nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings nw="$nw -Wc++-compat" # We don't care strongly about C++ compilers nw="$nw -Wtraditional" # Warns on #elif which we use often @@ -20901,10 +21466,11 @@ else CFLAGS="$CFLAGS -W -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -void f (void) +int f (void) { typedef struct { int a; int b; } s_t; s_t s1 = { 0, }; + return s1.b; } int @@ -20963,29 +21529,44 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } fi # List all gcc warning categories. + # To compare this list to your installed GCC's, run this Bash command: + # + # comm -3 \ + # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \ + # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort | + # grep -v -x -f <( + # awk '/^[^#]/ {print ws}' ../build-aux/gcc-warning.spec)) + gl_manywarn_set= for gl_manywarn_item in \ + -fno-common \ -W \ -Wabi \ -Waddress \ -Waggressive-loop-optimizations \ -Wall \ - -Warray-bounds \ -Wattributes \ -Wbad-function-cast \ + -Wbool-compare \ -Wbuiltin-macro-redefined \ -Wcast-align \ -Wchar-subscripts \ + -Wchkp \ -Wclobbered \ -Wcomment \ -Wcomments \ -Wcoverage-mismatch \ -Wcpp \ + -Wdate-time \ -Wdeprecated \ -Wdeprecated-declarations \ + -Wdesignated-init \ -Wdisabled-optimization \ + -Wdiscarded-array-qualifiers \ + -Wdiscarded-qualifiers \ -Wdiv-by-zero \ -Wdouble-promotion \ + -Wduplicated-cond \ -Wempty-body \ -Wendif-labels \ -Wenum-compare \ @@ -20994,22 +21575,31 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } -Wformat-extra-args \ -Wformat-nonliteral \ -Wformat-security \ + -Wformat-signedness \ -Wformat-y2k \ -Wformat-zero-length \ + -Wframe-address \ -Wfree-nonheap-object \ + -Whsa \ + -Wignored-attributes \ -Wignored-qualifiers \ -Wimplicit \ -Wimplicit-function-declaration \ -Wimplicit-int \ + -Wincompatible-pointer-types \ -Winit-self \ -Winline \ + -Wint-conversion \ -Wint-to-pointer-cast \ -Winvalid-memory-model \ -Winvalid-pch \ -Wjump-misses-init \ + -Wlogical-not-parentheses \ -Wlogical-op \ -Wmain \ -Wmaybe-uninitialized \ + -Wmemset-transposed-args \ + -Wmisleading-indentation \ -Wmissing-braces \ -Wmissing-declarations \ -Wmissing-field-initializers \ @@ -21020,9 +21610,12 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } -Wnarrowing \ -Wnested-externs \ -Wnonnull \ - -Wnormalized=nfc \ + -Wnonnull-compare \ + -Wnull-dereference \ + -Wodr \ -Wold-style-declaration \ -Wold-style-definition \ + -Wopenmp-simd \ -Woverflow \ -Woverlength-strings \ -Woverride-init \ @@ -21035,8 +21628,13 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } -Wpragmas \ -Wreturn-local-addr \ -Wreturn-type \ + -Wscalar-storage-order \ -Wsequence-point \ -Wshadow \ + -Wshift-count-negative \ + -Wshift-count-overflow \ + -Wshift-negative-value \ + -Wsizeof-array-argument \ -Wsizeof-pointer-memaccess \ -Wstack-protector \ -Wstrict-aliasing \ @@ -21046,10 +21644,14 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } -Wsuggest-attribute=format \ -Wsuggest-attribute=noreturn \ -Wsuggest-attribute=pure \ + -Wsuggest-final-methods \ + -Wsuggest-final-types \ -Wswitch \ + -Wswitch-bool \ -Wswitch-default \ -Wsync-nand \ -Wsystem-headers \ + -Wtautological-compare \ -Wtrampolines \ -Wtrigraphs \ -Wtype-limits \ @@ -21073,13 +21675,29 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } -Wvla \ -Wvolatile-register-var \ -Wwrite-strings \ - -fdiagnostics-show-option \ - -funit-at-a-time \ \ ; do gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" done + # gcc --help=warnings outputs an unusual form for these options; list + # them here so that the above 'comm' command doesn't report a false match. + gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" + gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc" + gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2" + + # These are needed for older GCC versions. + if test -n "$GCC"; then + case `($CC --version) 2>/dev/null` in + 'gcc (GCC) '[0-3].* | \ + 'gcc (GCC) '4.[0-7].*) + gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option" + gl_manywarn_set="$gl_manywarn_set -funit-at-a-time" + ;; + esac + fi + # Disable specific options as needed. if test "$gl_cv_cc_nomfi_needed" = yes; then gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers" @@ -21107,6 +21725,43 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } ws=$gl_warn_set for w in $ws; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether C compiler handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_c__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_c__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_c__Werror__Wunknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_c__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_c__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= +fi + as_gl_Warn=`$as_echo "gl_cv_warn_c_$w" | $as_tr_sh` gl_positive="$w" @@ -21506,6 +22161,10 @@ if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi CONFIG_INCLUDE=config.h if test -z "${GL_GENERATE_STDARG_H_TRUE}" && test -z "${GL_GENERATE_STDARG_H_FALSE}"; then @@ -21516,6 +22175,10 @@ if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FAL as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -21993,7 +22656,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by GNU Libtasn1 $as_me 4.9, which was +This file was extended by GNU Libtasn1 $as_me 4.10, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22065,7 +22728,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -GNU Libtasn1 config.status 4.9 +GNU Libtasn1 config.status 4.10 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 7a14e04..551ad3f 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ dnl Process this file with autoconf to produce a configure script. # along with this program. If not, see <http://www.gnu.org/licenses/>. AC_PREREQ([2.61]) -AC_INIT([GNU Libtasn1],[4.9],[help-libtasn1@gnu.org]) +AC_INIT([GNU Libtasn1],[4.10],[help-libtasn1@gnu.org]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS(config.h) @@ -29,7 +29,7 @@ AM_SILENT_RULES([yes]) # Interfaces added: AGE++ # Interfaces removed: AGE=0 AC_SUBST(LT_CURRENT, 11) -AC_SUBST(LT_REVISION, 2) +AC_SUBST(LT_REVISION, 3) AC_SUBST(LT_AGE, 5) AC_PROG_CC @@ -70,8 +70,6 @@ AC_ARG_ENABLE([gcc-warnings], ) if test "$gl_gcc_warnings" = yes; then - gl_WARN_ADD([-Werror], [WERROR_CFLAGS]) - nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings nw="$nw -Wc++-compat" # We don't care strongly about C++ compilers nw="$nw -Wtraditional" # Warns on #elif which we use often diff --git a/doc/Makefile.in b/doc/Makefile.in index a4cbb20..5d281a2 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -128,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/largefile.m4 \ + $(top_srcdir)/gl/m4/limits-h.m4 \ $(top_srcdir)/gl/m4/longlong.m4 $(top_srcdir)/gl/m4/lseek.m4 \ $(top_srcdir)/gl/m4/malloc.m4 \ $(top_srcdir)/gl/m4/manywarnings.m4 \ @@ -150,10 +151,10 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/version-etc.m4 \ $(top_srcdir)/gl/m4/warn-on-use.m4 \ $(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ - $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/m4/gtk-doc.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/m4/update-header-version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -466,6 +467,7 @@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ @@ -482,6 +484,7 @@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ @@ -530,6 +533,7 @@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ @@ -558,6 +562,7 @@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ @@ -570,6 +575,7 @@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ @@ -623,6 +629,7 @@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ @@ -648,6 +655,7 @@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ @@ -687,6 +695,7 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ @@ -716,6 +725,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIMITS_H = @LIMITS_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBINTL = @LTLIBINTL@ @@ -728,6 +738,7 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ @@ -741,6 +752,7 @@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ @@ -834,9 +846,11 @@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ @@ -865,6 +879,7 @@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ @@ -893,13 +908,13 @@ STRIP = @STRIP@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VALGRIND = @VALGRIND@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ -WERROR_CFLAGS = @WERROR_CFLAGS@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ diff --git a/doc/asn1Coding.1 b/doc/asn1Coding.1 index 65f1b5f..96ced73 100644 --- a/doc/asn1Coding.1 +++ b/doc/asn1Coding.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. -.TH ASN1CODING "1" "July 2016" "asn1Coding (libtasn1) 4.9" "User Commands" +.TH ASN1CODING "1" "October 2016" "asn1Coding (libtasn1) 4.10" "User Commands" .SH NAME asn1Coding \- ASN.1 DER encoder .SH SYNOPSIS @@ -31,7 +31,7 @@ GNU Libtasn1 home page: <http://www.gnu.org/software/libtasn1/> .br General help using GNU software: <http://www.gnu.org/gethelp/> .SH COPYRIGHT -Copyright \(co 2014 Free Software Foundation, Inc. +Copyright \(co 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. .br This is free software: you are free to change and redistribute it. diff --git a/doc/asn1Decoding.1 b/doc/asn1Decoding.1 index 334672e..2e8063d 100644 --- a/doc/asn1Decoding.1 +++ b/doc/asn1Decoding.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. -.TH ASN1DECODING "1" "July 2016" "asn1Decoding (libtasn1) 4.9" "User Commands" +.TH ASN1DECODING "1" "October 2016" "asn1Decoding (libtasn1) 4.10" "User Commands" .SH NAME asn1Decoding \- ASN.1 DER decoder .SH SYNOPSIS @@ -29,7 +29,7 @@ GNU Libtasn1 home page: <http://www.gnu.org/software/libtasn1/> .br General help using GNU software: <http://www.gnu.org/gethelp/> .SH COPYRIGHT -Copyright \(co 2014 Free Software Foundation, Inc. +Copyright \(co 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. .br This is free software: you are free to change and redistribute it. diff --git a/doc/asn1Parser.1 b/doc/asn1Parser.1 index 43eb383..aba1421 100644 --- a/doc/asn1Parser.1 +++ b/doc/asn1Parser.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. -.TH ASN1PARSER "1" "July 2016" "asn1Parser (libtasn1) 4.9" "User Commands" +.TH ASN1PARSER "1" "October 2016" "asn1Parser (libtasn1) 4.10" "User Commands" .SH NAME asn1Parser \- ASN.1 syntax tree generator for libtasn1 .SH SYNOPSIS @@ -34,7 +34,7 @@ GNU Libtasn1 home page: <http://www.gnu.org/software/libtasn1/> .br General help using GNU software: <http://www.gnu.org/gethelp/> .SH COPYRIGHT -Copyright \(co 2014 Free Software Foundation, Inc. +Copyright \(co 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. .br This is free software: you are free to change and redistribute it. diff --git a/doc/cyclo/Makefile.in b/doc/cyclo/Makefile.in index 4ff6c67..4e0814f 100644 --- a/doc/cyclo/Makefile.in +++ b/doc/cyclo/Makefile.in @@ -127,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/largefile.m4 \ + $(top_srcdir)/gl/m4/limits-h.m4 \ $(top_srcdir)/gl/m4/longlong.m4 $(top_srcdir)/gl/m4/lseek.m4 \ $(top_srcdir)/gl/m4/malloc.m4 \ $(top_srcdir)/gl/m4/manywarnings.m4 \ @@ -149,10 +150,10 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/version-etc.m4 \ $(top_srcdir)/gl/m4/warn-on-use.m4 \ $(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ - $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/m4/gtk-doc.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/m4/update-header-version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -330,6 +331,7 @@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ @@ -346,6 +348,7 @@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ @@ -394,6 +397,7 @@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ @@ -422,6 +426,7 @@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ @@ -434,6 +439,7 @@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ @@ -487,6 +493,7 @@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ @@ -512,6 +519,7 @@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ @@ -551,6 +559,7 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ @@ -580,6 +589,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIMITS_H = @LIMITS_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBINTL = @LTLIBINTL@ @@ -592,6 +602,7 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ @@ -605,6 +616,7 @@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ @@ -698,9 +710,11 @@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ @@ -729,6 +743,7 @@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ @@ -757,13 +772,13 @@ STRIP = @STRIP@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VALGRIND = @VALGRIND@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ -WERROR_CFLAGS = @WERROR_CFLAGS@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ diff --git a/doc/libtasn1.html b/doc/libtasn1.html index 43522e5..609d2bc 100644 --- a/doc/libtasn1.html +++ b/doc/libtasn1.html @@ -1,7 +1,7 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <!-- This manual is for GNU Libtasn1 -(version 4.9, 4 April 2016), +(version 4.10, 4 April 2016), which is a library for Abstract Syntax Notation One (ASN.1) and Distinguished Encoding Rules (DER) manipulation. @@ -13,12 +13,12 @@ any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". --> -<!-- Created by GNU Texinfo 6.1, http://www.gnu.org/software/texinfo/ --> +<!-- Created by GNU Texinfo 6.3, http://www.gnu.org/software/texinfo/ --> <head> -<title>GNU Libtasn1 4.9</title> +<title>GNU Libtasn1 4.10</title> -<meta name="description" content="GNU Libtasn1 4.9"> -<meta name="keywords" content="GNU Libtasn1 4.9"> +<meta name="description" content="GNU Libtasn1 4.10"> +<meta name="keywords" content="GNU Libtasn1 4.10"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="makeinfo"> @@ -104,7 +104,7 @@ dd, li { </head> <body lang="en"> -<h1 class="settitle" align="center">GNU Libtasn1 4.9</h1> +<h1 class="settitle" align="center">GNU Libtasn1 4.10</h1> @@ -158,7 +158,7 @@ Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Up: <a <h1 class="top">Libtasn1</h1> <p>This manual is for GNU Libtasn1 -(version 4.9, 4 April 2016), +(version 4.10, 4 April 2016), which is a library for Abstract Syntax Notation One (ASN.1) and Distinguished Encoding Rules (DER) manipulation. </p> diff --git a/doc/libtasn1.info b/doc/libtasn1.info index 2198910..1dd21e1 100644 --- a/doc/libtasn1.info +++ b/doc/libtasn1.info @@ -1,7 +1,7 @@ This is libtasn1.info, produced by makeinfo version 6.1 from libtasn1.texi. -This manual is for GNU Libtasn1 (version 4.9, 4 April 2016), which is a +This manual is for GNU Libtasn1 (version 4.10, 4 April 2016), which is a library for Abstract Syntax Notation One (ASN.1) and Distinguished Encoding Rules (DER) manipulation. @@ -24,7 +24,7 @@ File: libtasn1.info, Node: Top, Next: Introduction, Up: (dir) Libtasn1 ******** -This manual is for GNU Libtasn1 (version 4.9, 4 April 2016), which is a +This manual is for GNU Libtasn1 (version 4.10, 4 April 2016), which is a library for Abstract Syntax Notation One (ASN.1) and Distinguished Encoding Rules (DER) manipulation. @@ -2073,67 +2073,67 @@ Function and Data Index Tag Table: -Node: Top861 -Node: Introduction1851 -Node: ASN.1 structure handling3220 -Node: ASN.1 syntax3479 -Node: Naming5067 -Node: Simple parsing6048 -Node: Library Notes6375 -Node: Future developments7157 -Node: Utilities7456 -Node: Invoking asn1Parser7676 -Node: Invoking asn1Coding8138 -Node: Invoking asn1Decoding9875 -Node: Function reference10630 -Node: ASN.1 schema functions10914 -Ref: asn1_parser2tree11113 -Ref: asn1_parser2array12164 -Node: ASN.1 field functions13482 -Ref: asn1_array2tree13699 -Ref: asn1_delete_structure14551 -Ref: asn1_delete_structure214925 -Ref: asn1_delete_element15380 -Ref: asn1_create_element15852 -Ref: asn1_print_structure16506 -Ref: asn1_number_of_elements17135 -Ref: asn1_find_structure_from_oid17730 -Ref: asn1_copy_node18208 -Ref: asn1_dup_node18694 -Ref: asn1_write_value19054 -Ref: asn1_read_value23088 -Ref: asn1_read_value_type25878 -Ref: asn1_read_tag28743 -Ref: asn1_read_node_value29450 -Node: DER functions29796 -Ref: asn1_length_der29999 -Ref: asn1_octet_der30585 -Ref: asn1_encode_simple_der31393 -Ref: asn1_bit_der32223 -Ref: asn1_der_coding33014 -Ref: asn1_get_length_der34037 -Ref: asn1_get_tag_der34577 -Ref: asn1_get_length_ber35122 -Ref: asn1_get_octet_der35715 -Ref: asn1_get_object_id_der36574 -Ref: asn1_get_bit_der37172 -Ref: asn1_der_decoding237845 -Ref: asn1_der_decoding39243 -Ref: asn1_der_decoding_element40182 -Ref: asn1_der_decoding_startEnd41489 -Ref: asn1_expand_any_defined_by42941 -Ref: asn1_expand_octet_string43746 -Ref: asn1_decode_simple_der44747 -Ref: asn1_decode_simple_ber45389 -Node: Error handling functions46090 -Ref: asn1_perror46306 -Ref: asn1_strerror46647 -Node: Auxilliary functions47058 -Ref: asn1_find_node47250 -Ref: asn1_check_version47846 -Node: Copying Information48445 -Node: GNU Free Documentation License48698 -Node: Concept Index73813 -Node: Function and Data Index74919 +Node: Top862 +Node: Introduction1853 +Node: ASN.1 structure handling3222 +Node: ASN.1 syntax3481 +Node: Naming5069 +Node: Simple parsing6050 +Node: Library Notes6377 +Node: Future developments7159 +Node: Utilities7458 +Node: Invoking asn1Parser7678 +Node: Invoking asn1Coding8140 +Node: Invoking asn1Decoding9877 +Node: Function reference10632 +Node: ASN.1 schema functions10916 +Ref: asn1_parser2tree11115 +Ref: asn1_parser2array12166 +Node: ASN.1 field functions13484 +Ref: asn1_array2tree13701 +Ref: asn1_delete_structure14553 +Ref: asn1_delete_structure214927 +Ref: asn1_delete_element15382 +Ref: asn1_create_element15854 +Ref: asn1_print_structure16508 +Ref: asn1_number_of_elements17137 +Ref: asn1_find_structure_from_oid17732 +Ref: asn1_copy_node18210 +Ref: asn1_dup_node18696 +Ref: asn1_write_value19056 +Ref: asn1_read_value23090 +Ref: asn1_read_value_type25880 +Ref: asn1_read_tag28745 +Ref: asn1_read_node_value29452 +Node: DER functions29798 +Ref: asn1_length_der30001 +Ref: asn1_octet_der30587 +Ref: asn1_encode_simple_der31395 +Ref: asn1_bit_der32225 +Ref: asn1_der_coding33016 +Ref: asn1_get_length_der34039 +Ref: asn1_get_tag_der34579 +Ref: asn1_get_length_ber35124 +Ref: asn1_get_octet_der35717 +Ref: asn1_get_object_id_der36576 +Ref: asn1_get_bit_der37174 +Ref: asn1_der_decoding237847 +Ref: asn1_der_decoding39245 +Ref: asn1_der_decoding_element40184 +Ref: asn1_der_decoding_startEnd41491 +Ref: asn1_expand_any_defined_by42943 +Ref: asn1_expand_octet_string43748 +Ref: asn1_decode_simple_der44749 +Ref: asn1_decode_simple_ber45391 +Node: Error handling functions46092 +Ref: asn1_perror46308 +Ref: asn1_strerror46649 +Node: Auxilliary functions47060 +Ref: asn1_find_node47252 +Ref: asn1_check_version47848 +Node: Copying Information48447 +Node: GNU Free Documentation License48700 +Node: Concept Index73815 +Node: Function and Data Index74921 End Tag Table diff --git a/doc/libtasn1.pdf b/doc/libtasn1.pdf Binary files differindex 207c7c1..ff69e94 100644 --- a/doc/libtasn1.pdf +++ b/doc/libtasn1.pdf diff --git a/doc/libtasn1.ps b/doc/libtasn1.ps index 47e9fc3..f7f2ca7 100644 --- a/doc/libtasn1.ps +++ b/doc/libtasn1.ps @@ -1,7 +1,7 @@ %!PS-Adobe-2.0 -%%Creator: dvips(k) 5.995 Copyright 2015 Radical Eye Software +%%Creator: dvips(k) 5.996 Copyright 2016 Radical Eye Software %%Title: libtasn1.dvi -%%CreationDate: Mon Jul 25 22:29:01 2016 +%%CreationDate: Mon Jan 16 18:51:48 2017 %%Pages: 36 %%PageOrder: Ascend %%BoundingBox: 0 0 612 792 @@ -12,7 +12,7 @@ %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips -q -o libtasn1.ps libtasn1.dvi %DVIPSParameters: dpi=600 -%DVIPSSource: TeX output 2016.07.25:2229 +%DVIPSSource: TeX output 2017.01.16:1851 %%BeginProcSet: tex.pro 0 0 %! /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S @@ -6126,15 +6126,15 @@ ifelse %%Page: 1 1 TeXDict begin 1 0 bop 150 1318 a Fs(Libtasn1)p 150 1385 3600 34 v 1035 1486 a Fr(Abstract)31 b(Syn)m(tax)f(Notation)j(One)d -(\(ASN.1\))h(library)f(for)g(the)h(GNU)g(system)2638 -1594 y(for)f(v)m(ersion)h(4.9,)g(4)g(April)f(2016)150 +(\(ASN.1\))h(library)f(for)g(the)h(GNU)g(system)2592 +1594 y(for)f(v)m(ersion)h(4.10,)h(4)f(April)f(2016)150 4795 y Fq(F)-11 b(abio)45 b(Fiorina)150 4928 y(Simon)g(Josefsson)150 5061 y(Nik)l(os)h(Ma)l(vrogiannop)t(oulos)g(\()p Fp(help-libtasn1@)o (gn)o(u.o)o(rg)o Fq(\))p 150 5141 3600 17 v eop end %%Page: 2 2 -TeXDict begin 2 1 bop 150 4523 a Fr(This)24 b(man)m(ual)i(is)f(for)g -(GNU)h(Libtasn1)f(\(v)m(ersion)h(4.9,)i(4)d(April)g(2016\),)k(whic)m(h) -c(is)g(a)h(library)e(for)h(Abstract)150 4633 y(Syn)m(tax)31 +TeXDict begin 2 1 bop 150 4523 a Fr(This)21 b(man)m(ual)i(is)f(for)g +(GNU)h(Libtasn1)g(\(v)m(ersion)g(4.10,)j(4)c(April)g(2016\),)k(whic)m +(h)c(is)h(a)f(library)g(for)g(Abstract)150 4633 y(Syn)m(tax)31 b(Notation)h(One)e(\(ASN.1\))h(and)f(Distinguished)h(Enco)s(ding)e (Rules)i(\(DER\))g(manipulation.)150 4767 y(Cop)m(yrigh)m(t)602 4764 y(c)577 4767 y Fo(\015)f Fr(2001-2015)k(F)-8 b(ree)32 diff --git a/doc/reference/Makefile.in b/doc/reference/Makefile.in index 2bcdc2d..cac282f 100644 --- a/doc/reference/Makefile.in +++ b/doc/reference/Makefile.in @@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/largefile.m4 \ + $(top_srcdir)/gl/m4/limits-h.m4 \ $(top_srcdir)/gl/m4/longlong.m4 $(top_srcdir)/gl/m4/lseek.m4 \ $(top_srcdir)/gl/m4/malloc.m4 \ $(top_srcdir)/gl/m4/manywarnings.m4 \ @@ -138,10 +139,10 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/version-etc.m4 \ $(top_srcdir)/gl/m4/warn-on-use.m4 \ $(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ - $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/m4/gtk-doc.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/m4/update-header-version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -320,6 +321,7 @@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ @@ -336,6 +338,7 @@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ @@ -384,6 +387,7 @@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ @@ -412,6 +416,7 @@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ @@ -424,6 +429,7 @@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ @@ -477,6 +483,7 @@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ @@ -502,6 +509,7 @@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ @@ -541,6 +549,7 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ @@ -570,6 +579,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIMITS_H = @LIMITS_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBINTL = @LTLIBINTL@ @@ -582,6 +592,7 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ @@ -595,6 +606,7 @@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ @@ -688,9 +700,11 @@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ @@ -719,6 +733,7 @@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ @@ -747,13 +762,13 @@ STRIP = @STRIP@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VALGRIND = @VALGRIND@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ -WERROR_CFLAGS = @WERROR_CFLAGS@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ diff --git a/doc/stamp-vti b/doc/stamp-vti index 45609da..3c29e82 100644 --- a/doc/stamp-vti +++ b/doc/stamp-vti @@ -1,4 +1,4 @@ @set UPDATED 4 April 2016 @set UPDATED-MONTH April 2016 -@set EDITION 4.9 -@set VERSION 4.9 +@set EDITION 4.10 +@set VERSION 4.10 diff --git a/doc/version.texi b/doc/version.texi index 45609da..3c29e82 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -1,4 +1,4 @@ @set UPDATED 4 April 2016 @set UPDATED-MONTH April 2016 -@set EDITION 4.9 -@set VERSION 4.9 +@set EDITION 4.10 +@set VERSION 4.10 diff --git a/examples/Makefile.in b/examples/Makefile.in index ab71c73..464be24 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -129,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/largefile.m4 \ + $(top_srcdir)/gl/m4/limits-h.m4 \ $(top_srcdir)/gl/m4/longlong.m4 $(top_srcdir)/gl/m4/lseek.m4 \ $(top_srcdir)/gl/m4/malloc.m4 \ $(top_srcdir)/gl/m4/manywarnings.m4 \ @@ -151,10 +152,10 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/version-etc.m4 \ $(top_srcdir)/gl/m4/warn-on-use.m4 \ $(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ - $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/m4/gtk-doc.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/m4/update-header-version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -387,6 +388,7 @@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ @@ -403,6 +405,7 @@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ @@ -451,6 +454,7 @@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ @@ -479,6 +483,7 @@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ @@ -491,6 +496,7 @@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ @@ -544,6 +550,7 @@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ @@ -569,6 +576,7 @@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ @@ -608,6 +616,7 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ @@ -637,6 +646,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIMITS_H = @LIMITS_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBINTL = @LTLIBINTL@ @@ -649,6 +659,7 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ @@ -662,6 +673,7 @@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ @@ -755,9 +767,11 @@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ @@ -786,6 +800,7 @@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ @@ -814,13 +829,13 @@ STRIP = @STRIP@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VALGRIND = @VALGRIND@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ -WERROR_CFLAGS = @WERROR_CFLAGS@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ diff --git a/gl/Makefile.am b/gl/Makefile.am index 57eaeb8..b72df89 100644 --- a/gl/Makefile.am +++ b/gl/Makefile.am @@ -1,6 +1,6 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files autobuild fdl-1.3 gendocs getopt-gnu gettime gnupload maintainer-makefile manywarnings pmccabe2html progname read-file stdint update-copyright valgrind-tests version-etc-fsf warnings +# Reproduce by: gnulib-tool --import --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files autobuild fdl-1.3 gendocs getopt-gnu gettime gnupload maintainer-makefile manywarnings pmccabe2html progname read-file stdint update-copyright valgrind-tests version-etc-fsf warnings AUTOMAKE_OPTIONS = 1.9.6 gnits @@ -195,6 +195,34 @@ EXTRA_DIST += $(top_srcdir)/build-aux/gnupload ## end gnulib module gnupload +## begin gnulib module limits-h + +BUILT_SOURCES += $(LIMITS_H) + +# We need the following in order to create <limits.h> when the system +# doesn't have one that is compatible with GNU. +if GL_GENERATE_LIMITS_H +limits.h: limits.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \ + < $(srcdir)/limits.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +limits.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += limits.h limits.h-t + +EXTRA_DIST += limits.in.h + +## end gnulib module limits-h + ## begin gnulib module lseek @@ -391,6 +419,7 @@ stddef.h: stddef.in.h $(top_builddir)/config.status -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ + -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ < $(srcdir)/stddef.in.h; \ @@ -422,6 +451,7 @@ stdint.h: stdint.in.h $(top_builddir)/config.status -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ + -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ @@ -443,6 +473,7 @@ stdint.h: stdint.in.h $(top_builddir)/config.status -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ + -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ < $(srcdir)/stdint.in.h; \ } > $@-t && \ mv $@-t $@ @@ -617,6 +648,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \ -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \ -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \ + -e 's/@''GNULIB_QSORT_R''@/$(GNULIB_QSORT_R)/g' \ -e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \ -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \ -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \ @@ -646,6 +678,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ + -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \ -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ @@ -668,6 +701,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \ -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \ -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \ -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \ -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \ @@ -828,10 +862,12 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ + -e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ + -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ @@ -841,6 +877,7 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ @@ -941,7 +978,6 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ - -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ @@ -963,6 +999,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ @@ -992,9 +1029,11 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \ -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \ -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \ + -e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \ -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \ -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \ -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \ + -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \ -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \ -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \ -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \ diff --git a/gl/Makefile.in b/gl/Makefile.in index 8732d46..5f14b96 100644 --- a/gl/Makefile.in +++ b/gl/Makefile.in @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files autobuild fdl-1.3 gendocs getopt-gnu gettime gnupload maintainer-makefile manywarnings pmccabe2html progname read-file stdint update-copyright valgrind-tests version-etc-fsf warnings +# Reproduce by: gnulib-tool --import --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files autobuild fdl-1.3 gendocs getopt-gnu gettime gnupload maintainer-makefile manywarnings pmccabe2html progname read-file stdint update-copyright valgrind-tests version-etc-fsf warnings @@ -136,6 +136,7 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/largefile.m4 \ + $(top_srcdir)/gl/m4/limits-h.m4 \ $(top_srcdir)/gl/m4/longlong.m4 $(top_srcdir)/gl/m4/lseek.m4 \ $(top_srcdir)/gl/m4/malloc.m4 \ $(top_srcdir)/gl/m4/manywarnings.m4 \ @@ -158,10 +159,10 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/version-etc.m4 \ $(top_srcdir)/gl/m4/warn-on-use.m4 \ $(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ - $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/m4/gtk-doc.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/m4/update-header-version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -437,6 +438,7 @@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ @@ -453,6 +455,7 @@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ @@ -501,6 +504,7 @@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ @@ -529,6 +533,7 @@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ @@ -541,6 +546,7 @@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ @@ -594,6 +600,7 @@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ @@ -619,6 +626,7 @@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ @@ -658,6 +666,7 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ @@ -687,6 +696,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIMITS_H = @LIMITS_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBINTL = @LTLIBINTL@ @@ -699,6 +709,7 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ @@ -712,6 +723,7 @@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ @@ -805,9 +817,11 @@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ @@ -836,6 +850,7 @@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ @@ -864,13 +879,13 @@ STRIP = @STRIP@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VALGRIND = @VALGRIND@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ -WERROR_CFLAGS = @WERROR_CFLAGS@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ @@ -948,8 +963,8 @@ EXTRA_DIST = m4/gnulib-cache.m4 errno.in.h fstat.c ftell.c ftello.c \ stdio-impl.h $(top_srcdir)/build-aux/gendocs.sh getopt.c \ getopt.in.h getopt1.c getopt_int.h gettimeofday.c \ $(top_srcdir)/GNUmakefile $(top_srcdir)/build-aux/gnupload \ - lseek.c $(top_srcdir)/maint.mk malloc.c msvc-inval.c \ - msvc-inval.h msvc-nothrow.c msvc-nothrow.h \ + limits.in.h lseek.c $(top_srcdir)/maint.mk malloc.c \ + msvc-inval.c msvc-inval.h msvc-nothrow.c msvc-nothrow.h \ $(top_srcdir)/build-aux/pmccabe2html \ $(top_srcdir)/build-aux/pmccabe.css read-file.h realloc.c \ $(top_srcdir)/build-aux/snippet/_Noreturn.h \ @@ -971,16 +986,18 @@ EXTRA_DIST = m4/gnulib-cache.m4 errno.in.h fstat.c ftell.c ftello.c \ # statements but through direct file reference. Therefore this snippet must be # present in all Makefile.am that need it. This is ensured by the applicability # 'all' defined above. -BUILT_SOURCES = $(ERRNO_H) $(GETOPT_H) arg-nonnull.h c++defs.h \ - warn-on-use.h $(STDARG_H) $(STDDEF_H) $(STDINT_H) stdio.h \ - stdlib.h sys/stat.h sys/time.h sys/types.h time.h unistd.h +BUILT_SOURCES = $(ERRNO_H) $(GETOPT_H) $(LIMITS_H) arg-nonnull.h \ + c++defs.h warn-on-use.h $(STDARG_H) $(STDDEF_H) $(STDINT_H) \ + stdio.h stdlib.h sys/stat.h sys/time.h sys/types.h time.h \ + unistd.h SUFFIXES = MOSTLYCLEANFILES = core *.stackdump errno.h errno.h-t getopt.h \ - getopt.h-t arg-nonnull.h arg-nonnull.h-t c++defs.h c++defs.h-t \ - warn-on-use.h warn-on-use.h-t stdarg.h stdarg.h-t stddef.h \ - stddef.h-t stdint.h stdint.h-t stdio.h stdio.h-t stdlib.h \ - stdlib.h-t sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t \ - sys/types.h sys/types.h-t time.h time.h-t unistd.h unistd.h-t + getopt.h-t limits.h limits.h-t arg-nonnull.h arg-nonnull.h-t \ + c++defs.h c++defs.h-t warn-on-use.h warn-on-use.h-t stdarg.h \ + stdarg.h-t stddef.h stddef.h-t stdint.h stdint.h-t stdio.h \ + stdio.h-t stdlib.h stdlib.h-t sys/stat.h sys/stat.h-t \ + sys/time.h sys/time.h-t sys/types.h sys/types.h-t time.h \ + time.h-t unistd.h unistd.h-t MOSTLYCLEANDIRS = sys CLEANFILES = DISTCLEANFILES = @@ -1444,6 +1461,22 @@ getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) distclean-local: clean-GNUmakefile clean-GNUmakefile: test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile + +# We need the following in order to create <limits.h> when the system +# doesn't have one that is compatible with GNU. +@GL_GENERATE_LIMITS_H_TRUE@limits.h: limits.in.h $(top_builddir)/config.status +@GL_GENERATE_LIMITS_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_LIMITS_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_LIMITS_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ < $(srcdir)/limits.in.h; \ +@GL_GENERATE_LIMITS_H_TRUE@ } > $@-t && \ +@GL_GENERATE_LIMITS_H_TRUE@ mv $@-t $@ +@GL_GENERATE_LIMITS_H_FALSE@limits.h: $(top_builddir)/config.status +@GL_GENERATE_LIMITS_H_FALSE@ rm -f $@ # The arg-nonnull.h that gets inserted into generated .h files is the same as # build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut # off. @@ -1497,6 +1530,7 @@ warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \ @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ @GL_GENERATE_STDDEF_H_TRUE@ < $(srcdir)/stddef.in.h; \ @@ -1516,6 +1550,7 @@ warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h @GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ @@ -1537,6 +1572,7 @@ warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ @GL_GENERATE_STDINT_H_TRUE@ < $(srcdir)/stdint.in.h; \ @GL_GENERATE_STDINT_H_TRUE@ } > $@-t && \ @GL_GENERATE_STDINT_H_TRUE@ mv $@-t $@ @@ -1691,6 +1727,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \ -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \ -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \ + -e 's/@''GNULIB_QSORT_R''@/$(GNULIB_QSORT_R)/g' \ -e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \ -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \ -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \ @@ -1720,6 +1757,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ + -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \ -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ @@ -1742,6 +1780,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \ -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \ -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \ -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \ -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \ @@ -1865,10 +1904,12 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ + -e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ + -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ @@ -1878,6 +1919,7 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ @@ -1960,7 +2002,6 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ - -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ @@ -1982,6 +2023,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ @@ -2011,9 +2053,11 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \ -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \ -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \ + -e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \ -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \ -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \ -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \ + -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \ -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \ -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \ -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \ diff --git a/gl/errno.in.h b/gl/errno.in.h index 832afc8..13194f9 100644 --- a/gl/errno.in.h +++ b/gl/errno.in.h @@ -1,6 +1,6 @@ /* A POSIX-like <errno.h>. - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1,5 +1,5 @@ /* fstat() replacement. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1,5 +1,5 @@ /* An ftell() function that works around platform bugs. - Copyright (C) 2007-2014 Free Software Foundation, Inc. + Copyright (C) 2007-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/ftello.c b/gl/ftello.c index ee4f7dc..298255a 100644 --- a/gl/ftello.c +++ b/gl/ftello.c @@ -1,5 +1,5 @@ /* An ftello() function that works around platform bugs. - Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/getopt.c b/gl/getopt.c index 7d950af..e40ea8d 100644 --- a/gl/getopt.c +++ b/gl/getopt.c @@ -2,7 +2,7 @@ NOTE: getopt is part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! - Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2014 Free Software + Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -487,7 +487,20 @@ _getopt_internal_r (int argc, char **argv, const char *optstring, const struct option *p; struct option_list *next; } *ambig_list = NULL; +#ifdef _LIBC +/* malloc() not used for _LIBC to simplify failure messages. */ +# define free_option_list(l) +#else +# define free_option_list(l) \ + while (l != NULL) \ + { \ + struct option_list *pn = l->next; \ + free (l); \ + l = pn; \ + } +#endif int exact = 0; + int ambig = 0; int indfound = -1; int option_index; @@ -514,22 +527,37 @@ _getopt_internal_r (int argc, char **argv, const char *optstring, pfound = p; indfound = option_index; } + else if (ambig) + ; /* Taking simpler path to handling ambiguities. */ else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) { /* Second or later nonexact match found. */ +#ifdef _LIBC + struct option_list *newp = alloca (sizeof (*newp)); +#else struct option_list *newp = malloc (sizeof (*newp)); - newp->p = p; - newp->next = ambig_list; - ambig_list = newp; + if (newp == NULL) + { + free_option_list (ambig_list); + ambig_list = NULL; + ambig = 1; /* Use simpler fallback message. */ + } + else +#endif + { + newp->p = p; + newp->next = ambig_list; + ambig_list = newp; + } } } - if (ambig_list != NULL && !exact) + if ((ambig || ambig_list) && !exact) { - if (print_errors) + if (print_errors && ambig_list) { struct option_list first; first.p = pfound; @@ -585,18 +613,20 @@ _getopt_internal_r (int argc, char **argv, const char *optstring, fputc ('\n', stderr); #endif } + else if (print_errors && ambig) + { + fprintf (stderr, + _("%s: option '%s' is ambiguous\n"), + argv[0], argv[d->optind]); + } d->__nextchar += strlen (d->__nextchar); d->optind++; d->optopt = 0; + free_option_list (ambig_list); return '?'; } - while (ambig_list != NULL) - { - struct option_list *pn = ambig_list->next; - free (ambig_list); - ambig_list = pn; - } + free_option_list (ambig_list); if (pfound != NULL) { diff --git a/gl/getopt.in.h b/gl/getopt.in.h index 7ab99fb..6cbad8e 100644 --- a/gl/getopt.in.h +++ b/gl/getopt.in.h @@ -1,5 +1,5 @@ /* Declarations for getopt. - Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2014 Free Software + Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -47,15 +47,20 @@ identifiers so that they do not collide with the system functions and variables. Renaming avoids problems with some compilers and linkers. */ -#if defined __GETOPT_PREFIX && !defined __need_getopt -# if !@HAVE_GETOPT_H@ -# define __need_system_stdlib_h -# include <stdlib.h> -# undef __need_system_stdlib_h -# include <stdio.h> -# include <unistd.h> +#if defined __GETOPT_PREFIX +# if !defined __need_getopt +# if !@HAVE_GETOPT_H@ +# define __need_system_stdlib_h +# include <stdlib.h> +# undef __need_system_stdlib_h +# include <stdio.h> +# include <unistd.h> +# endif +# undef __need_getopt # endif -# undef __need_getopt +# undef __GETOPT_CONCAT +# undef __GETOPT_XCONCAT +# undef __GETOPT_ID # undef getopt # undef getopt_long # undef getopt_long_only @@ -64,6 +69,7 @@ # undef optind # undef optopt # undef option +# undef _getopt_internal # define __GETOPT_CONCAT(x, y) x ## y # define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y) # define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y) diff --git a/gl/getopt1.c b/gl/getopt1.c index a184865..4d2e8cb 100644 --- a/gl/getopt1.c +++ b/gl/getopt1.c @@ -1,5 +1,5 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2014 Free Software + Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/gl/getopt_int.h b/gl/getopt_int.h index 24ed672..a7ce0e9 100644 --- a/gl/getopt_int.h +++ b/gl/getopt_int.h @@ -1,5 +1,5 @@ /* Internal declarations for getopt. - Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2014 Free Software + Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/gl/gettext.h b/gl/gettext.h index c7d6fd3..0465d7a 100644 --- a/gl/gettext.h +++ b/gl/gettext.h @@ -1,5 +1,5 @@ /* Convenience header for conditional use of GNU <libintl.h>. - Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2014 Free Software + Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -225,15 +225,17 @@ dcpgettext_expr (const char *domain, if (msg_ctxt_id != NULL) #endif { + int found_translation; memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcgettext (domain, msg_ctxt_id, category); + found_translation = (translation != msg_ctxt_id); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif - if (translation != msg_ctxt_id) + if (found_translation) return translation; } return msgid; @@ -271,15 +273,17 @@ dcnpgettext_expr (const char *domain, if (msg_ctxt_id != NULL) #endif { + int found_translation; memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + found_translation = !(translation == msg_ctxt_id || translation == msgid_plural); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif - if (!(translation == msg_ctxt_id || translation == msgid_plural)) + if (found_translation) return translation; } return (n == 1 ? msgid : msgid_plural); diff --git a/gl/gettime.c b/gl/gettime.c index 1b4ca8d..4ae313e 100644 --- a/gl/gettime.c +++ b/gl/gettime.c @@ -1,6 +1,6 @@ /* gettime -- get the system clock - Copyright (C) 2002, 2004-2007, 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2002, 2004-2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/gettimeofday.c b/gl/gettimeofday.c index 8b2058e..18dcbda 100644 --- a/gl/gettimeofday.c +++ b/gl/gettimeofday.c @@ -1,6 +1,6 @@ /* Provide gettimeofday for systems that don't have it or for which it's broken. - Copyright (C) 2001-2003, 2005-2007, 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/limits.in.h b/gl/limits.in.h new file mode 100644 index 0000000..a7e307f --- /dev/null +++ b/gl/limits.in.h @@ -0,0 +1,63 @@ +/* A GNU-like <limits.h>. + + Copyright 2016-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_LIMITS_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_LIMITS_H@ + +#ifndef _@GUARD_PREFIX@_LIMITS_H +#define _@GUARD_PREFIX@_LIMITS_H + +/* The number of usable bits in an unsigned or signed integer type + with minimum value MIN and maximum value MAX, as an int expression + suitable in #if. Cover all known practical hosts. This + implementation exploits the fact that MAX is 1 less than a power of + 2, and merely counts the number of 1 bits in MAX; "COBn" means + "count the number of 1 bits in the low-order n bits"). */ +#define _GL_INTEGER_WIDTH(min, max) (((min) < 0) + _GL_COB128 (max)) +#define _GL_COB128(n) (_GL_COB64 ((n) >> 31 >> 31 >> 2) + _GL_COB64 (n)) +#define _GL_COB64(n) (_GL_COB32 ((n) >> 31 >> 1) + _GL_COB32 (n)) +#define _GL_COB32(n) (_GL_COB16 ((n) >> 16) + _GL_COB16 (n)) +#define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n)) +#define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n)) +#define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1)) + +/* Macros specified by ISO/IEC TS 18661-1:2014. */ + +#if (! defined ULLONG_WIDTH \ + && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__)) +# define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX) +# define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX) +# define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX) +# define SHRT_WIDTH _GL_INTEGER_WIDTH (SHRT_MIN, SHRT_MAX) +# define USHRT_WIDTH _GL_INTEGER_WIDTH (0, USHRT_MAX) +# define INT_WIDTH _GL_INTEGER_WIDTH (INT_MIN, INT_MAX) +# define UINT_WIDTH _GL_INTEGER_WIDTH (0, UINT_MAX) +# define LONG_WIDTH _GL_INTEGER_WIDTH (LONG_MIN, LONG_MAX) +# define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX) +# define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX) +# define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX) +#endif /* !ULLONG_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */ + +#endif /* _@GUARD_PREFIX@_LIMITS_H */ +#endif /* _@GUARD_PREFIX@_LIMITS_H */ @@ -1,5 +1,5 @@ /* An lseek() function that detects pipes. - Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/m4/00gnulib.m4 b/gl/m4/00gnulib.m4 index 8eca551..bb3512f 100644 --- a/gl/m4/00gnulib.m4 +++ b/gl/m4/00gnulib.m4 @@ -1,5 +1,5 @@ # 00gnulib.m4 serial 3 -dnl Copyright (C) 2009-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/absolute-header.m4 b/gl/m4/absolute-header.m4 index ce3e39e..c73adc8 100644 --- a/gl/m4/absolute-header.m4 +++ b/gl/m4/absolute-header.m4 @@ -1,5 +1,5 @@ # absolute-header.m4 serial 16 -dnl Copyright (C) 2006-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/autobuild.m4 b/gl/m4/autobuild.m4 index 00d8709..f5f2a18 100644 --- a/gl/m4/autobuild.m4 +++ b/gl/m4/autobuild.m4 @@ -1,5 +1,5 @@ # autobuild.m4 serial 7 -dnl Copyright (C) 2004, 2006-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/clock_time.m4 b/gl/m4/clock_time.m4 index 6c4a637..21b6f25 100644 --- a/gl/m4/clock_time.m4 +++ b/gl/m4/clock_time.m4 @@ -1,5 +1,5 @@ # clock_time.m4 serial 10 -dnl Copyright (C) 2002-2006, 2009-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4 index 4ee9e6a..9f0f2f2 100644 --- a/gl/m4/errno_h.m4 +++ b/gl/m4/errno_h.m4 @@ -1,5 +1,5 @@ # errno_h.m4 serial 12 -dnl Copyright (C) 2004, 2006, 2008-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4 index 37f55ca..c60f537 100644 --- a/gl/m4/extensions.m4 +++ b/gl/m4/extensions.m4 @@ -1,7 +1,7 @@ -# serial 13 -*- Autoconf -*- +# serial 15 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -60,7 +60,7 @@ dnl configure.ac when using autoheader 2.62. #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif -/* Enable general extensions on OS X. */ +/* Enable general extensions on macOS. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif @@ -72,6 +72,34 @@ dnl configure.ac when using autoheader 2.62. #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE @@ -101,6 +129,13 @@ dnl configure.ac when using autoheader 2.62. AC_DEFINE([_DARWIN_C_SOURCE]) AC_DEFINE([_GNU_SOURCE]) AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) + AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__]) + AC_DEFINE([__STDC_WANT_LIB_EXT2__]) + AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__]) AC_DEFINE([_TANDEM_SOURCE]) AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined], [ac_cv_should_define__xopen_source], diff --git a/gl/m4/extern-inline.m4 b/gl/m4/extern-inline.m4 index 240150e..00f9609 100644 --- a/gl/m4/extern-inline.m4 +++ b/gl/m4/extern-inline.m4 @@ -1,6 +1,6 @@ dnl 'extern inline' a la ISO C99. -dnl Copyright 2012-2014 Free Software Foundation, Inc. +dnl Copyright 2012-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -19,13 +19,28 @@ AC_DEFUN([gl_EXTERN_INLINE], 'reference to static identifier "f" in extern inline function'. This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. - Suppress the use of extern inline on problematic Apple configurations. - OS X 10.8 and earlier mishandle it; see, e.g., - <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>. + Suppress extern inline (with or without __attribute__ ((__gnu_inline__))) + on configurations that mistakenly use 'static inline' to implement + functions or macros in standard C headers like <ctype.h>. For example, + if isdigit is mistakenly implemented via a static inline function, + a program containing an extern inline function that calls isdigit + may not work since the C standard prohibits extern inline functions + from calling static functions. This bug is known to occur on: + + OS X 10.8 and earlier; see: + http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html + + DragonFly; see + http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log + + FreeBSD; see: + http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html + OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and for clang but remains for g++; see <http://trac.macports.org/ticket/41033>. - Perhaps Apple will fix this some day. */ -#if (defined __APPLE__ \ + Assume DragonFly and FreeBSD will be similar. */ +#if (((defined __APPLE__ && defined __MACH__) \ + || defined __DragonFly__ || defined __FreeBSD__) \ && (defined __header_inline \ ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \ && ! defined __clang__) \ @@ -33,19 +48,20 @@ AC_DEFUN([gl_EXTERN_INLINE], && (defined __GNUC__ || defined __cplusplus)) \ || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \ && defined __GNUC__ && ! defined __cplusplus)))) -# define _GL_EXTERN_INLINE_APPLE_BUG +# define _GL_EXTERN_INLINE_STDHEADER_BUG #endif #if ((__GNUC__ \ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ : (199901L <= __STDC_VERSION__ \ && !defined __HP_cc \ + && !defined __PGI \ && !(defined __SUNPRO_C && __STDC__))) \ - && !defined _GL_EXTERN_INLINE_APPLE_BUG) + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) # define _GL_INLINE inline # define _GL_EXTERN_INLINE extern inline # define _GL_EXTERN_INLINE_IN_USE #elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \ - && !defined _GL_EXTERN_INLINE_APPLE_BUG) + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) # if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__ /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) @@ -59,17 +75,19 @@ AC_DEFUN([gl_EXTERN_INLINE], # define _GL_EXTERN_INLINE static _GL_UNUSED #endif -#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) +/* In GCC 4.6 (inclusive) to 5.1 (exclusive), + suppress bogus "no previous prototype for 'FOO'" + and "no previous declaration for 'FOO'" diagnostics, + when FOO is an inline function in the header; see + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */ +#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__ # if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ # define _GL_INLINE_HEADER_CONST_PRAGMA # else # define _GL_INLINE_HEADER_CONST_PRAGMA \ _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") # endif - /* Suppress GCC's bogus "no previous prototype for 'FOO'" - and "no previous declaration for 'FOO'" diagnostics, - when FOO is an inline function in the header; see - <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>. */ # define _GL_INLINE_HEADER_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ diff --git a/gl/m4/fseeko.m4 b/gl/m4/fseeko.m4 index 4ccb57d..fdb565b 100644 --- a/gl/m4/fseeko.m4 +++ b/gl/m4/fseeko.m4 @@ -1,5 +1,5 @@ # fseeko.m4 serial 17 -dnl Copyright (C) 2007-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/fstat.m4 b/gl/m4/fstat.m4 index ddd3fb9..14c871a 100644 --- a/gl/m4/fstat.m4 +++ b/gl/m4/fstat.m4 @@ -1,5 +1,5 @@ # fstat.m4 serial 4 -dnl Copyright (C) 2011-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/ftell.m4 b/gl/m4/ftell.m4 index b99e76d..b8336ce 100644 --- a/gl/m4/ftell.m4 +++ b/gl/m4/ftell.m4 @@ -1,5 +1,5 @@ # ftell.m4 serial 3 -dnl Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/ftello.m4 b/gl/m4/ftello.m4 index 14a9bee..0867c2a 100644 --- a/gl/m4/ftello.m4 +++ b/gl/m4/ftello.m4 @@ -1,5 +1,5 @@ # ftello.m4 serial 11 -dnl Copyright (C) 2007-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4 index f127028..7a94626 100644 --- a/gl/m4/getopt.m4 +++ b/gl/m4/getopt.m4 @@ -1,5 +1,5 @@ # getopt.m4 serial 44 -dnl Copyright (C) 2002-2006, 2008-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/gettime.m4 b/gl/m4/gettime.m4 index c5ec264..1cdab27 100644 --- a/gl/m4/gettime.m4 +++ b/gl/m4/gettime.m4 @@ -1,5 +1,5 @@ # gettime.m4 serial 8 -dnl Copyright (C) 2002, 2004-2006, 2009-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004-2006, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/gettimeofday.m4 b/gl/m4/gettimeofday.m4 index 1c2d66e..4f501e5 100644 --- a/gl/m4/gettimeofday.m4 +++ b/gl/m4/gettimeofday.m4 @@ -1,6 +1,6 @@ # serial 21 -# Copyright (C) 2001-2003, 2005, 2007, 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2003, 2005, 2007, 2009-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4 index 8e9fd37..e5dbb55 100644 --- a/gl/m4/gnulib-cache.m4 +++ b/gl/m4/gnulib-cache.m4 @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files autobuild fdl-1.3 gendocs getopt-gnu gettime gnupload maintainer-makefile manywarnings pmccabe2html progname read-file stdint update-copyright valgrind-tests version-etc-fsf warnings +# gnulib-tool --import --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files autobuild fdl-1.3 gendocs getopt-gnu gettime gnupload maintainer-makefile manywarnings pmccabe2html progname read-file stdint update-copyright valgrind-tests version-etc-fsf warnings # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([gl/override]) diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4 index 20ce40e..7d9b40b 100644 --- a/gl/m4/gnulib-common.m4 +++ b/gl/m4/gnulib-common.m4 @@ -1,5 +1,5 @@ -# gnulib-common.m4 serial 34 -dnl Copyright (C) 2007-2014 Free Software Foundation, Inc. +# gnulib-common.m4 serial 36 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -49,6 +49,16 @@ AC_DEFUN([gl_COMMON_BODY], [ is a misnomer outside of parameter lists. */ #define _UNUSED_PARAMETER_ _GL_UNUSED +/* gcc supports the "unused" attribute on possibly unused labels, and + g++ has since version 4.5. Note to support C++ as well as C, + _GL_UNUSED_LABEL should be used with a trailing ; */ +#if !defined __cplusplus || __GNUC__ > 4 \ + || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# define _GL_UNUSED_LABEL _GL_UNUSED +#else +# define _GL_UNUSED_LABEL +#endif + /* The __pure__ attribute was added in gcc 2.96. */ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) @@ -243,9 +253,10 @@ AC_DEFUN([gl_PROG_AR_RANLIB], [ dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler dnl as "cc", and GCC as "gcc". They have different object file formats and - dnl library formats. In particular, the GNU binutils programs ar, ranlib + dnl library formats. In particular, the GNU binutils programs ar and ranlib dnl produce libraries that work only with gcc, not with cc. AC_REQUIRE([AC_PROG_CC]) + AC_BEFORE([$0], [AM_PROG_AR]) AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler], [ AC_EGREP_CPP([Amsterdam], @@ -257,25 +268,37 @@ Amsterdam [gl_cv_c_amsterdam_compiler=yes], [gl_cv_c_amsterdam_compiler=no]) ]) - if test -z "$AR"; then - if test $gl_cv_c_amsterdam_compiler = yes; then + + dnl Don't compete with AM_PROG_AR's decision about AR/ARFLAGS if we are not + dnl building with __ACK__. + if test $gl_cv_c_amsterdam_compiler = yes; then + if test -z "$AR"; then AR='cc -c.a' - if test -z "$ARFLAGS"; then - ARFLAGS='-o' - fi - else - dnl Use the Automake-documented default values for AR and ARFLAGS, - dnl but prefer ${host}-ar over ar (useful for cross-compiling). - AC_CHECK_TOOL([AR], [ar], [ar]) - if test -z "$ARFLAGS"; then - ARFLAGS='cru' - fi fi - else if test -z "$ARFLAGS"; then - ARFLAGS='cru' + ARFLAGS='-o' fi + else + dnl AM_PROG_AR was added in automake v1.11.2. AM_PROG_AR does not AC_SUBST + dnl ARFLAGS variable (it is filed into Makefile.in directly by automake + dnl script on-demand, if not specified by ./configure of course). + dnl Don't AC_REQUIRE the AM_PROG_AR otherwise the code for __ACK__ above + dnl will be ignored. Also, pay attention to call AM_PROG_AR in else block + dnl because AM_PROG_AR is written so it could re-set AR variable even for + dnl __ACK__. It may seem like its easier to avoid calling the macro here, + dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good + dnl default value and automake should usually know them). + m4_ifdef([AM_PROG_AR], [AM_PROG_AR], [:]) fi + + dnl In case the code above has not helped with setting AR/ARFLAGS, use + dnl Automake-documented default values for AR and ARFLAGS, but prefer + dnl ${host}-ar over ar (useful for cross-compiling). + AC_CHECK_TOOL([AR], [ar], [ar]) + if test -z "$ARFLAGS"; then + ARFLAGS='cr' + fi + AC_SUBST([AR]) AC_SUBST([ARFLAGS]) if test -z "$RANLIB"; then @@ -309,26 +332,28 @@ m4_ifdef([AC_PROG_MKDIR_P], [ ]) # AC_C_RESTRICT -# This definition overrides the AC_C_RESTRICT macro from autoconf 2.60..2.61, -# so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++ -# works. -# This definition can be removed once autoconf >= 2.62 can be assumed. -# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness. -m4_ifndef([AC_AUTOCONF_VERSION],[ +# This definition is copied from post-2.69 Autoconf and overrides the +# AC_C_RESTRICT macro from autoconf 2.60..2.69. It can be removed +# once autoconf >= 2.70 can be assumed. It's painful to check version +# numbers, and in practice this macro is more up-to-date than Autoconf +# is, so override Autoconf unconditionally. AC_DEFUN([AC_C_RESTRICT], [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict], [ac_cv_c_restrict=no # The order here caters to the fact that C++ does not require restrict. for ac_kw in __restrict __restrict__ _Restrict restrict; do - AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [[typedef int * int_ptr; - int foo (int_ptr $ac_kw ip) { - return ip[0]; - }]], - [[int s[1]; - int * $ac_kw t = s; - t[0] = 0; - return foo(t)]])], + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } + ]], + [[int s[1]; + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + ]])], [ac_cv_c_restrict=$ac_kw]) test "$ac_cv_c_restrict" != no && break done @@ -338,21 +363,21 @@ AC_DEFUN([AC_C_RESTRICT], nothing if this is not supported. Do not define if restrict is supported directly. */ #undef restrict -/* Work around a bug in Sun C++: it does not support _Restrict, even - though the corresponding Sun C compiler does, which causes - "#define restrict _Restrict" in the previous line. Perhaps some future - version of Sun C++ will work with _Restrict; if so, it'll probably - define __RESTRICT, just as Sun C does. */ +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ #if defined __SUNPRO_CC && !defined __RESTRICT # define _Restrict +# define __restrict__ #endif]) case $ac_cv_c_restrict in restrict) ;; no) AC_DEFINE([restrict], []) ;; *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; esac -]) -]) +])# AC_C_RESTRICT # gl_BIGENDIAN # is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd. diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4 index 3299b2b..20a1e48 100644 --- a/gl/m4/gnulib-comp.m4 +++ b/gl/m4/gnulib-comp.m4 @@ -1,5 +1,5 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -37,14 +37,17 @@ AC_DEFUN([gl_EARLY], m4_pattern_allow([^gl_ES$])dnl a valid locale name m4_pattern_allow([^gl_LIBOBJS$])dnl a variable m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable + + # Pre-early section. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_PROG_AR_RANLIB]) + # Code from module absolute-header: # Code from module autobuild: AB_INIT # Code from module clock-time: # Code from module errno: # Code from module extensions: - AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) # Code from module extern-inline: # Code from module fdl-1.3: # Code from module fstat: @@ -62,6 +65,7 @@ AC_DEFUN([gl_EARLY], # Code from module include_next: # Code from module largefile: AC_REQUIRE([AC_SYS_LARGEFILE]) + # Code from module limits-h: # Code from module lseek: # Code from module maintainer-makefile: # Code from module malloc-posix: @@ -147,7 +151,6 @@ AC_DEFUN([gl_INIT], GNULIB_GL_UNISTD_H_GETOPT=1 fi AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) - gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) gl_FUNC_GETOPT_POSIX if test $REPLACE_GETOPT = 1; then AC_LIBOBJ([getopt]) @@ -177,6 +180,7 @@ AC_DEFUN([gl_INIT], [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], [GNUmakefile=$GNUmakefile])]) AC_REQUIRE([gl_LARGEFILE]) + gl_LIMITS_H gl_FUNC_LSEEK if test $REPLACE_LSEEK = 1; then AC_LIBOBJ([lseek]) @@ -190,11 +194,11 @@ AC_DEFUN([gl_INIT], AC_LIBOBJ([malloc]) fi gl_STDLIB_MODULE_INDICATOR([malloc-posix]) - gl_MSVC_INVAL + AC_REQUIRE([gl_MSVC_INVAL]) if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then AC_LIBOBJ([msvc-inval]) fi - gl_MSVC_NOTHROW + AC_REQUIRE([gl_MSVC_NOTHROW]) if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then AC_LIBOBJ([msvc-nothrow]) fi @@ -375,6 +379,7 @@ AC_DEFUN([gl_FILE_LIST], [ build-aux/vc-list-files doc/fdl-1.3.texi doc/gendocs_template + doc/gendocs_template_min lib/errno.in.h lib/fstat.c lib/ftell.c @@ -386,6 +391,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/gettext.h lib/gettime.c lib/gettimeofday.c + lib/limits.in.h lib/lseek.c lib/malloc.c lib/msvc-inval.c @@ -431,6 +437,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/gnulib-common.m4 m4/include_next.m4 m4/largefile.m4 + m4/limits-h.m4 m4/longlong.m4 m4/lseek.m4 m4/malloc.m4 @@ -460,6 +467,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/warn-on-use.m4 m4/warnings.m4 m4/wchar_t.m4 + m4/wint_t.m4 top/GNUmakefile top/maint.mk ]) diff --git a/gl/m4/include_next.m4 b/gl/m4/include_next.m4 index 69ad3db..e687e23 100644 --- a/gl/m4/include_next.m4 +++ b/gl/m4/include_next.m4 @@ -1,5 +1,5 @@ # include_next.m4 serial 23 -dnl Copyright (C) 2006-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/largefile.m4 b/gl/m4/largefile.m4 index a1b564a..790f7c0 100644 --- a/gl/m4/largefile.m4 +++ b/gl/m4/largefile.m4 @@ -1,6 +1,6 @@ # Enable large files on systems where this is not the default. -# Copyright 1992-1996, 1998-2014 Free Software Foundation, Inc. +# Copyright 1992-1996, 1998-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/limits-h.m4 b/gl/m4/limits-h.m4 new file mode 100644 index 0000000..443f91b --- /dev/null +++ b/gl/m4/limits-h.m4 @@ -0,0 +1,31 @@ +dnl Check whether limits.h has needed features. + +dnl Copyright 2016-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +AC_DEFUN_ONCE([gl_LIMITS_H], +[ + gl_CHECK_NEXT_HEADERS([limits.h]) + + AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.], + [gl_cv_header_limits_width], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include <limits.h> + int ullw = ULLONG_WIDTH;]])], + [gl_cv_header_limits_width=yes], + [gl_cv_header_limits_width=no])]) + if test "$gl_cv_header_limits_width" = yes; then + LIMITS_H= + else + LIMITS_H=limits.h + fi + AC_SUBST([LIMITS_H]) + AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) +]) diff --git a/gl/m4/longlong.m4 b/gl/m4/longlong.m4 index eefb37c..9a3294b 100644 --- a/gl/m4/longlong.m4 +++ b/gl/m4/longlong.m4 @@ -1,5 +1,5 @@ # longlong.m4 serial 17 -dnl Copyright (C) 1999-2007, 2009-2014 Free Software Foundation, Inc. +dnl Copyright (C) 1999-2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/lseek.m4 b/gl/m4/lseek.m4 index 0904d02..627e772 100644 --- a/gl/m4/lseek.m4 +++ b/gl/m4/lseek.m4 @@ -1,5 +1,5 @@ # lseek.m4 serial 10 -dnl Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/malloc.m4 b/gl/m4/malloc.m4 index 322ad6e..e1d2ec6 100644 --- a/gl/m4/malloc.m4 +++ b/gl/m4/malloc.m4 @@ -1,13 +1,13 @@ -# malloc.m4 serial 14 -dnl Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc. +# malloc.m4 serial 15 +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. m4_version_prereq([2.70], [] ,[ -# This is taken from the following Autoconf patch: -# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9 +# This is adapted with modifications from upstream Autoconf here: +# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c AC_DEFUN([_AC_FUNC_MALLOC_IF], [ AC_REQUIRE([AC_HEADER_STDC])dnl @@ -23,7 +23,10 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF], char *malloc (); #endif ]], - [[return ! malloc (0);]]) + [[char *p = malloc (0); + int result = !p; + free (p); + return result;]]) ], [ac_cv_func_malloc_0_nonnull=yes], [ac_cv_func_malloc_0_nonnull=no], diff --git a/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4 index e1cee6c..0f06ade 100644 --- a/gl/m4/manywarnings.m4 +++ b/gl/m4/manywarnings.m4 @@ -1,5 +1,5 @@ -# manywarnings.m4 serial 6 -dnl Copyright (C) 2008-2014 Free Software Foundation, Inc. +# manywarnings.m4 serial 8 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -62,10 +62,11 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], CFLAGS="$CFLAGS -W -Werror" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [[void f (void) + [[int f (void) { typedef struct { int a; int b; } s_t; s_t s1 = { 0, }; + return s1.b; } ]], [[]])], @@ -93,29 +94,44 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], fi # List all gcc warning categories. + # To compare this list to your installed GCC's, run this Bash command: + # + # comm -3 \ + # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \ + # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort | + # grep -v -x -f <( + # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec)) + gl_manywarn_set= for gl_manywarn_item in \ + -fno-common \ -W \ -Wabi \ -Waddress \ -Waggressive-loop-optimizations \ -Wall \ - -Warray-bounds \ -Wattributes \ -Wbad-function-cast \ + -Wbool-compare \ -Wbuiltin-macro-redefined \ -Wcast-align \ -Wchar-subscripts \ + -Wchkp \ -Wclobbered \ -Wcomment \ -Wcomments \ -Wcoverage-mismatch \ -Wcpp \ + -Wdate-time \ -Wdeprecated \ -Wdeprecated-declarations \ + -Wdesignated-init \ -Wdisabled-optimization \ + -Wdiscarded-array-qualifiers \ + -Wdiscarded-qualifiers \ -Wdiv-by-zero \ -Wdouble-promotion \ + -Wduplicated-cond \ -Wempty-body \ -Wendif-labels \ -Wenum-compare \ @@ -124,22 +140,31 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], -Wformat-extra-args \ -Wformat-nonliteral \ -Wformat-security \ + -Wformat-signedness \ -Wformat-y2k \ -Wformat-zero-length \ + -Wframe-address \ -Wfree-nonheap-object \ + -Whsa \ + -Wignored-attributes \ -Wignored-qualifiers \ -Wimplicit \ -Wimplicit-function-declaration \ -Wimplicit-int \ + -Wincompatible-pointer-types \ -Winit-self \ -Winline \ + -Wint-conversion \ -Wint-to-pointer-cast \ -Winvalid-memory-model \ -Winvalid-pch \ -Wjump-misses-init \ + -Wlogical-not-parentheses \ -Wlogical-op \ -Wmain \ -Wmaybe-uninitialized \ + -Wmemset-transposed-args \ + -Wmisleading-indentation \ -Wmissing-braces \ -Wmissing-declarations \ -Wmissing-field-initializers \ @@ -150,9 +175,12 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], -Wnarrowing \ -Wnested-externs \ -Wnonnull \ - -Wnormalized=nfc \ + -Wnonnull-compare \ + -Wnull-dereference \ + -Wodr \ -Wold-style-declaration \ -Wold-style-definition \ + -Wopenmp-simd \ -Woverflow \ -Woverlength-strings \ -Woverride-init \ @@ -165,8 +193,13 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], -Wpragmas \ -Wreturn-local-addr \ -Wreturn-type \ + -Wscalar-storage-order \ -Wsequence-point \ -Wshadow \ + -Wshift-count-negative \ + -Wshift-count-overflow \ + -Wshift-negative-value \ + -Wsizeof-array-argument \ -Wsizeof-pointer-memaccess \ -Wstack-protector \ -Wstrict-aliasing \ @@ -176,10 +209,14 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], -Wsuggest-attribute=format \ -Wsuggest-attribute=noreturn \ -Wsuggest-attribute=pure \ + -Wsuggest-final-methods \ + -Wsuggest-final-types \ -Wswitch \ + -Wswitch-bool \ -Wswitch-default \ -Wsync-nand \ -Wsystem-headers \ + -Wtautological-compare \ -Wtrampolines \ -Wtrigraphs \ -Wtype-limits \ @@ -203,13 +240,29 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], -Wvla \ -Wvolatile-register-var \ -Wwrite-strings \ - -fdiagnostics-show-option \ - -funit-at-a-time \ \ ; do gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" done + # gcc --help=warnings outputs an unusual form for these options; list + # them here so that the above 'comm' command doesn't report a false match. + gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" + gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc" + gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2" + gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2" + + # These are needed for older GCC versions. + if test -n "$GCC"; then + case `($CC --version) 2>/dev/null` in + 'gcc (GCC) '[[0-3]].* | \ + 'gcc (GCC) '4.[[0-7]].*) + gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option" + gl_manywarn_set="$gl_manywarn_set -funit-at-a-time" + ;; + esac + fi + # Disable specific options as needed. if test "$gl_cv_cc_nomfi_needed" = yes; then gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers" diff --git a/gl/m4/msvc-inval.m4 b/gl/m4/msvc-inval.m4 index 7f26087..3324375 100644 --- a/gl/m4/msvc-inval.m4 +++ b/gl/m4/msvc-inval.m4 @@ -1,5 +1,5 @@ # msvc-inval.m4 serial 1 -dnl Copyright (C) 2011-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/msvc-nothrow.m4 b/gl/m4/msvc-nothrow.m4 index 9e32c17..3014661 100644 --- a/gl/m4/msvc-nothrow.m4 +++ b/gl/m4/msvc-nothrow.m4 @@ -1,5 +1,5 @@ # msvc-nothrow.m4 serial 1 -dnl Copyright (C) 2011-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/multiarch.m4 b/gl/m4/multiarch.m4 index 2cb956d..30006cb 100644 --- a/gl/m4/multiarch.m4 +++ b/gl/m4/multiarch.m4 @@ -1,5 +1,5 @@ # multiarch.m4 serial 7 -dnl Copyright (C) 2008-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/nocrash.m4 b/gl/m4/nocrash.m4 index 5a5d77d..2c2c5fb 100644 --- a/gl/m4/nocrash.m4 +++ b/gl/m4/nocrash.m4 @@ -1,5 +1,5 @@ # nocrash.m4 serial 4 -dnl Copyright (C) 2005, 2009-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -110,11 +110,12 @@ nocrash_init (void) #else /* Avoid a crash on POSIX systems. */ #include <signal.h> +#include <unistd.h> /* A POSIX signal handler. */ static void exception_handler (int sig) { - exit (1); + _exit (1); } static void nocrash_init (void) diff --git a/gl/m4/off_t.m4 b/gl/m4/off_t.m4 index f5885b3..92c45ef 100644 --- a/gl/m4/off_t.m4 +++ b/gl/m4/off_t.m4 @@ -1,5 +1,5 @@ # off_t.m4 serial 1 -dnl Copyright (C) 2012-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/read-file.m4 b/gl/m4/read-file.m4 index a2beacc..5540000 100644 --- a/gl/m4/read-file.m4 +++ b/gl/m4/read-file.m4 @@ -1,5 +1,5 @@ # read-file.m4 serial 3 -dnl Copyright (C) 2002-2006, 2009-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/realloc.m4 b/gl/m4/realloc.m4 index f96537b..3d05b44 100644 --- a/gl/m4/realloc.m4 +++ b/gl/m4/realloc.m4 @@ -1,13 +1,13 @@ -# realloc.m4 serial 13 -dnl Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc. +# realloc.m4 serial 14 +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. m4_version_prereq([2.70], [] ,[ -# This is taken from the following Autoconf patch: -# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9 +# This is adapted with modifications from upstream Autoconf here: +# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c AC_DEFUN([_AC_FUNC_REALLOC_IF], [ AC_REQUIRE([AC_HEADER_STDC])dnl @@ -23,7 +23,10 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF], char *realloc (); #endif ]], - [[return ! realloc (0, 0);]]) + [[char *p = realloc (0, 0); + int result = !p; + free (p); + return result;]]) ], [ac_cv_func_realloc_0_nonnull=yes], [ac_cv_func_realloc_0_nonnull=no], diff --git a/gl/m4/ssize_t.m4 b/gl/m4/ssize_t.m4 index fbe1d06..66ba9d4 100644 --- a/gl/m4/ssize_t.m4 +++ b/gl/m4/ssize_t.m4 @@ -1,5 +1,5 @@ # ssize_t.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2001-2003, 2006, 2010-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2003, 2006, 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/stdarg.m4 b/gl/m4/stdarg.m4 index 732aa31..40db5e4 100644 --- a/gl/m4/stdarg.m4 +++ b/gl/m4/stdarg.m4 @@ -1,5 +1,5 @@ # stdarg.m4 serial 6 -dnl Copyright (C) 2006, 2008-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/stddef_h.m4 b/gl/m4/stddef_h.m4 index c555e29..f45def1 100644 --- a/gl/m4/stddef_h.m4 +++ b/gl/m4/stddef_h.m4 @@ -1,6 +1,6 @@ -dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues. -# stddef_h.m4 serial 4 -dnl Copyright (C) 2009-2014 Free Software Foundation, Inc. +dnl A placeholder for <stddef.h>, for platforms that have issues. +# stddef_h.m4 serial 5 +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -10,6 +10,9 @@ AC_DEFUN([gl_STDDEF_H], AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) AC_REQUIRE([gt_TYPE_WCHAR_T]) STDDEF_H= + AC_CHECK_TYPE([max_align_t], [], [HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h], + [[#include <stddef.h> + ]]) if test $gt_cv_c_wchar_t = no; then HAVE_WCHAR_T=0 STDDEF_H=stddef.h @@ -43,5 +46,6 @@ AC_DEFUN([gl_STDDEF_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. REPLACE_NULL=0; AC_SUBST([REPLACE_NULL]) + HAVE_MAX_ALIGN_T=1; AC_SUBST([HAVE_MAX_ALIGN_T]) HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T]) ]) diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4 index 1981d9d..4ac854d 100644 --- a/gl/m4/stdint.m4 +++ b/gl/m4/stdint.m4 @@ -1,5 +1,5 @@ -# stdint.m4 serial 43 -dnl Copyright (C) 2001-2014 Free Software Foundation, Inc. +# stdint.m4 serial 50 +dnl Copyright (C) 2001-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -11,6 +11,9 @@ AC_DEFUN_ONCE([gl_STDINT_H], [ AC_PREREQ([2.59])dnl + AC_REQUIRE([gl_LIMITS_H]) + AC_REQUIRE([gt_TYPE_WINT_T]) + dnl Check for long long int and unsigned long long int. AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) if test $ac_cv_type_long_long_int = yes; then @@ -70,6 +73,8 @@ AC_DEFUN_ONCE([gl_STDINT_H], AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 #include <stdint.h> /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ #if !(defined WCHAR_MIN && defined WCHAR_MAX) @@ -150,6 +155,15 @@ uintptr_t h = UINTPTR_MAX; intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; +/* Check that SIZE_MAX has the correct type, if possible. */ +#if 201112 <= __STDC_VERSION__ +int k = _Generic (SIZE_MAX, size_t: 0); +#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +extern size_t k; +extern __typeof__ (SIZE_MAX) k; +#endif + #include <limits.h> /* for CHAR_BIT */ #define TYPE_MINIMUM(t) \ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) @@ -218,6 +232,8 @@ struct s { AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 #include <stdint.h> ] gl_STDINT_INCLUDES @@ -278,28 +294,74 @@ static const char *macro_values[] = ]) ]) fi + + HAVE_C99_STDINT_H=0 + HAVE_SYS_BITYPES_H=0 + HAVE_SYS_INTTYPES_H=0 + STDINT_H=stdint.h if test "$gl_cv_header_working_stdint_h" = yes; then - STDINT_H= + HAVE_C99_STDINT_H=1 + dnl Now see whether the system <stdint.h> works without + dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined. + AC_CACHE_CHECK([whether stdint.h predates C++11], + [gl_cv_header_stdint_predates_cxx11_h], + [gl_cv_header_stdint_predates_cxx11_h=yes + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include <stdint.h> +] +gl_STDINT_INCLUDES +[ +intmax_t im = INTMAX_MAX; +int32_t i32 = INT32_C (0x7fffffff); + ]])], + [gl_cv_header_stdint_predates_cxx11_h=no])]) + + if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + AC_DEFINE([__STDC_CONSTANT_MACROS], [1], + [Define to 1 if the system <stdint.h> predates C++11.]) + AC_DEFINE([__STDC_LIMIT_MACROS], [1], + [Define to 1 if the system <stdint.h> predates C++11.]) + fi + AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.], + [gl_cv_header_stdint_width], + [gl_cv_header_stdint_width=no + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 + #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include <stdint.h> + ]gl_STDINT_INCLUDES[ + int iw = UINTMAX_WIDTH; + ]])], + [gl_cv_header_stdint_width=yes])]) + if test "$gl_cv_header_stdint_width" = yes; then + STDINT_H= + fi else dnl Check for <sys/inttypes.h>, and for dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5). AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) if test $ac_cv_header_sys_inttypes_h = yes; then HAVE_SYS_INTTYPES_H=1 - else - HAVE_SYS_INTTYPES_H=0 fi - AC_SUBST([HAVE_SYS_INTTYPES_H]) if test $ac_cv_header_sys_bitypes_h = yes; then HAVE_SYS_BITYPES_H=1 - else - HAVE_SYS_BITYPES_H=0 fi - AC_SUBST([HAVE_SYS_BITYPES_H]) - gl_STDINT_TYPE_PROPERTIES - STDINT_H=stdint.h fi + + dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH. + LIMITS_H=limits.h + AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) + + AC_SUBST([HAVE_C99_STDINT_H]) + AC_SUBST([HAVE_SYS_BITYPES_H]) + AC_SUBST([HAVE_SYS_INTTYPES_H]) AC_SUBST([STDINT_H]) AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) ]) @@ -467,7 +529,7 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], dnl requirement that wint_t is "unchanged by default argument promotions". dnl In this case gnulib's <wchar.h> and <wctype.h> override wint_t. dnl Set the variable BITSIZEOF_WINT_T accordingly. - if test $BITSIZEOF_WINT_T -lt 32; then + if test $GNULIB_OVERRIDES_WINT_T = 1; then BITSIZEOF_WINT_T=32 fi ]) @@ -477,8 +539,3 @@ dnl Remove this when we can assume autoconf >= 2.61. m4_ifdef([AC_COMPUTE_INT], [], [ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) ]) - -# Hey Emacs! -# Local Variables: -# indent-tabs-mode: nil -# End: diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4 index d15913a..9ffbb85 100644 --- a/gl/m4/stdio_h.m4 +++ b/gl/m4/stdio_h.m4 @@ -1,14 +1,45 @@ -# stdio_h.m4 serial 43 -dnl Copyright (C) 2007-2014 Free Software Foundation, Inc. +# stdio_h.m4 serial 48 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_STDIO_H], [ + AH_VERBATIM([MINGW_ANSI_STDIO], +[/* Use GNU style printf and scanf. */ +#ifndef __USE_MINGW_ANSI_STDIO +# undef __USE_MINGW_ANSI_STDIO +#endif +]) + AC_DEFINE([__USE_MINGW_ANSI_STDIO]) AC_REQUIRE([gl_STDIO_H_DEFAULTS]) gl_NEXT_HEADERS([stdio.h]) + dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and + dnl inttypes.h behave like gnu instead of system; we must give our + dnl printf wrapper the right attribute to match. + AC_CACHE_CHECK([which flavor of printf attribute matches inttypes macros], + [gl_cv_func_printf_attribute_flavor], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #define __STDC_FORMAT_MACROS 1 + #include <stdio.h> + #include <inttypes.h> + /* For non-mingw systems, compilation will trivially succeed. + For mingw, compilation will succeed for older mingw (system + printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ + #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; + #endif + ]])], [gl_cv_func_printf_attribute_flavor=system], + [gl_cv_func_printf_attribute_flavor=gnu])]) + if test "$gl_cv_func_printf_attribute_flavor" = gnu; then + AC_DEFINE([GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU], [1], + [Define to 1 if printf and friends should be labeled with + attribute "__gnu_printf__" instead of "__printf__"]) + fi + dnl No need to create extra modules for these functions. Everyone who uses dnl <stdio.h> likely needs them. GNULIB_FSCANF=1 diff --git a/gl/m4/stdlib_h.m4 b/gl/m4/stdlib_h.m4 index 03b448b..110fe2d 100644 --- a/gl/m4/stdlib_h.m4 +++ b/gl/m4/stdlib_h.m4 @@ -1,5 +1,5 @@ -# stdlib_h.m4 serial 42 -dnl Copyright (C) 2007-2014 Free Software Foundation, Inc. +# stdlib_h.m4 serial 43 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -21,7 +21,7 @@ AC_DEFUN([gl_STDLIB_H], #endif ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps - posix_openpt ptsname ptsname_r random random_r realpath rpmatch + posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv]) ]) @@ -55,6 +55,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], GNULIB_PTSNAME=0; AC_SUBST([GNULIB_PTSNAME]) GNULIB_PTSNAME_R=0; AC_SUBST([GNULIB_PTSNAME_R]) GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV]) + GNULIB_QSORT_R=0; AC_SUBST([GNULIB_QSORT_R]) GNULIB_RANDOM=0; AC_SUBST([GNULIB_RANDOM]) GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R]) GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) @@ -84,6 +85,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT]) HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME]) HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R]) + HAVE_QSORT_R=1; AC_SUBST([HAVE_QSORT_R]) HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM]) HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H]) HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) @@ -107,6 +109,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME]) REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R]) REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) + REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R]) REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R]) REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC]) REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH]) diff --git a/gl/m4/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4 index 114d828..3ecbe7c 100644 --- a/gl/m4/sys_socket_h.m4 +++ b/gl/m4/sys_socket_h.m4 @@ -1,5 +1,5 @@ # sys_socket_h.m4 serial 23 -dnl Copyright (C) 2005-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/sys_stat_h.m4 b/gl/m4/sys_stat_h.m4 index eaa7642..1e34ac4 100644 --- a/gl/m4/sys_stat_h.m4 +++ b/gl/m4/sys_stat_h.m4 @@ -1,5 +1,5 @@ # sys_stat_h.m4 serial 28 -*- Autoconf -*- -dnl Copyright (C) 2006-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/sys_time_h.m4 b/gl/m4/sys_time_h.m4 index 5c79300..e622dbe 100644 --- a/gl/m4/sys_time_h.m4 +++ b/gl/m4/sys_time_h.m4 @@ -1,7 +1,7 @@ # Configure a replacement for <sys/time.h>. # serial 8 -# Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,6 +105,7 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS], HAVE_GETTIMEOFDAY=1; AC_SUBST([HAVE_GETTIMEOFDAY]) HAVE_STRUCT_TIMEVAL=1; AC_SUBST([HAVE_STRUCT_TIMEVAL]) HAVE_SYS_TIME_H=1; AC_SUBST([HAVE_SYS_TIME_H]) + HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T]) REPLACE_GETTIMEOFDAY=0; AC_SUBST([REPLACE_GETTIMEOFDAY]) REPLACE_STRUCT_TIMEVAL=0; AC_SUBST([REPLACE_STRUCT_TIMEVAL]) ]) diff --git a/gl/m4/sys_types_h.m4 b/gl/m4/sys_types_h.m4 index 9748905..2eb4e9e 100644 --- a/gl/m4/sys_types_h.m4 +++ b/gl/m4/sys_types_h.m4 @@ -1,5 +1,5 @@ -# sys_types_h.m4 serial 5 -dnl Copyright (C) 2011-2014 Free Software Foundation, Inc. +# sys_types_h.m4 serial 6 +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -22,3 +22,28 @@ AC_DEFUN_ONCE([gl_SYS_TYPES_H], AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS], [ ]) + +# This works around a buggy version in autoconf <= 2.69. +# See <https://lists.gnu.org/archive/html/autoconf/2016-08/msg00014.html> + +m4_version_prereq([2.70], [], [ + +# This is taken from the following Autoconf patch: +# http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=e17a30e98 + +m4_undefine([AC_HEADER_MAJOR]) +AC_DEFUN([AC_HEADER_MAJOR], +[AC_CHECK_HEADERS_ONCE([sys/types.h]) +AC_CHECK_HEADER([sys/mkdev.h], + [AC_DEFINE([MAJOR_IN_MKDEV], [1], + [Define to 1 if `major', `minor', and `makedev' are declared in + <mkdev.h>.])]) +if test $ac_cv_header_sys_mkdev_h = no; then + AC_CHECK_HEADER([sys/sysmacros.h], + [AC_DEFINE([MAJOR_IN_SYSMACROS], [1], + [Define to 1 if `major', `minor', and `makedev' are declared in + <sysmacros.h>.])]) +fi +]) + +]) diff --git a/gl/m4/time_h.m4 b/gl/m4/time_h.m4 index 9852778..b925678 100644 --- a/gl/m4/time_h.m4 +++ b/gl/m4/time_h.m4 @@ -1,8 +1,8 @@ # Configure a more-standard replacement for <time.h>. -# Copyright (C) 2000-2001, 2003-2007, 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2000-2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. -# serial 8 +# serial 9 # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -26,7 +26,7 @@ AC_DEFUN([gl_HEADER_TIME_H_BODY], ]) dnl Check whether 'struct timespec' is declared -dnl in time.h, sys/time.h, or pthread.h. +dnl in time.h, sys/time.h, pthread.h, or unistd.h. AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC], [ @@ -44,6 +44,7 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC], TIME_H_DEFINES_STRUCT_TIMESPEC=0 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 + UNISTD_H_DEFINES_STRUCT_TIMESPEC=0 if test $gl_cv_sys_struct_timespec_in_time_h = yes; then TIME_H_DEFINES_STRUCT_TIMESPEC=1 else @@ -70,12 +71,26 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC], [gl_cv_sys_struct_timespec_in_pthread_h=no])]) if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 + else + AC_CACHE_CHECK([for struct timespec in <unistd.h>], + [gl_cv_sys_struct_timespec_in_unistd_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <unistd.h> + ]], + [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], + [gl_cv_sys_struct_timespec_in_unistd_h=yes], + [gl_cv_sys_struct_timespec_in_unistd_h=no])]) + if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then + UNISTD_H_DEFINES_STRUCT_TIMESPEC=1 + fi fi fi fi AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC]) AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC]) + AC_SUBST([UNISTD_H_DEFINES_STRUCT_TIMESPEC]) ]) AC_DEFUN([gl_TIME_MODULE_INDICATOR], @@ -94,6 +109,7 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], GNULIB_STRPTIME=0; AC_SUBST([GNULIB_STRPTIME]) GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM]) GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R]) + GNULIB_TIME_RZ=0; AC_SUBST([GNULIB_TIME_RZ]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R]) HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) diff --git a/gl/m4/timespec.m4 b/gl/m4/timespec.m4 index 2ce654f..c901468 100644 --- a/gl/m4/timespec.m4 +++ b/gl/m4/timespec.m4 @@ -1,6 +1,6 @@ #serial 15 -# Copyright (C) 2000-2001, 2003-2007, 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2000-2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4 index 1fa197e..25aef19 100644 --- a/gl/m4/unistd_h.m4 +++ b/gl/m4/unistd_h.m4 @@ -1,5 +1,5 @@ -# unistd_h.m4 serial 67 -dnl Copyright (C) 2006-2014 Free Software Foundation, Inc. +# unistd_h.m4 serial 69 +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -145,6 +145,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR]) HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC]) HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME]) + HAVE_DECL_GETLOGIN=1; AC_SUBST([HAVE_DECL_GETLOGIN]) HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL]) @@ -173,9 +174,11 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE]) REPLACE_READ=0; AC_SUBST([REPLACE_READ]) REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK]) + REPLACE_READLINKAT=0; AC_SUBST([REPLACE_READLINKAT]) REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR]) REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP]) REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK]) + REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT]) REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R]) REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK]) REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT]) diff --git a/gl/m4/valgrind-tests.m4 b/gl/m4/valgrind-tests.m4 index 347b2e9..8a6650b 100644 --- a/gl/m4/valgrind-tests.m4 +++ b/gl/m4/valgrind-tests.m4 @@ -1,5 +1,5 @@ # valgrind-tests.m4 serial 3 -dnl Copyright (C) 2008-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -12,8 +12,8 @@ dnl From Simon Josefsson AC_DEFUN([gl_VALGRIND_TESTS], [ AC_ARG_ENABLE(valgrind-tests, - AS_HELP_STRING([--enable-valgrind-tests], - [run self tests under valgrind]), + AS_HELP_STRING([--disable-valgrind-tests], + [don't try to run self tests under valgrind]), [opt_valgrind_tests=$enableval], [opt_valgrind_tests=yes]) # Run self-tests under valgrind? @@ -21,7 +21,7 @@ AC_DEFUN([gl_VALGRIND_TESTS], AC_CHECK_PROGS(VALGRIND, valgrind) fi - OPTS="-q --error-exitcode=1 --leak-check=no" + OPTS="-q --error-exitcode=6 --leak-check=no" if test -n "$VALGRIND" \ && $VALGRIND $OPTS $SHELL -c 'exit 0' > /dev/null 2>&1; then diff --git a/gl/m4/version-etc.m4 b/gl/m4/version-etc.m4 index 667f9f8..c099101 100644 --- a/gl/m4/version-etc.m4 +++ b/gl/m4/version-etc.m4 @@ -1,5 +1,5 @@ # version-etc.m4 serial 1 -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/warn-on-use.m4 b/gl/m4/warn-on-use.m4 index cc690f8..25ce737 100644 --- a/gl/m4/warn-on-use.m4 +++ b/gl/m4/warn-on-use.m4 @@ -1,5 +1,5 @@ # warn-on-use.m4 serial 5 -dnl Copyright (C) 2010-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/warnings.m4 b/gl/m4/warnings.m4 index 43156f4..e697174 100644 --- a/gl/m4/warnings.m4 +++ b/gl/m4/warnings.m4 @@ -1,5 +1,5 @@ # warnings.m4 serial 11 -dnl Copyright (C) 2008-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/wchar_t.m4 b/gl/m4/wchar_t.m4 index 839a04c..11783d2 100644 --- a/gl/m4/wchar_t.m4 +++ b/gl/m4/wchar_t.m4 @@ -1,5 +1,5 @@ # wchar_t.m4 serial 4 (gettext-0.18.2) -dnl Copyright (C) 2002-2003, 2008-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2003, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gl/m4/wint_t.m4 b/gl/m4/wint_t.m4 new file mode 100644 index 0000000..65e25a4 --- /dev/null +++ b/gl/m4/wint_t.m4 @@ -0,0 +1,62 @@ +# wint_t.m4 serial 6 +dnl Copyright (C) 2003, 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. +dnl Test whether <wchar.h> has the 'wint_t' type and whether gnulib's +dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'. +dnl Prerequisite: AC_PROG_CC + +AC_DEFUN([gt_TYPE_WINT_T], +[ + AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + wint_t foo = (wchar_t)'\0';]], + [[]])], + [gt_cv_c_wint_t=yes], + [gt_cv_c_wint_t=no])]) + if test $gt_cv_c_wint_t = yes; then + AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) + + dnl Determine whether gnulib's <wchar.h> or <wctype.h> would, if present, + dnl override 'wint_t'. + AC_CACHE_CHECK([whether wint_t is too small], + [gl_cv_type_wint_t_too_small], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +#endif +#include <wchar.h> + int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; + ]])], + [gl_cv_type_wint_t_too_small=no], + [gl_cv_type_wint_t_too_small=yes])]) + if test $gl_cv_type_wint_t_too_small = yes; then + GNULIB_OVERRIDES_WINT_T=1 + else + GNULIB_OVERRIDES_WINT_T=0 + fi + else + GNULIB_OVERRIDES_WINT_T=0 + fi + AC_SUBST([GNULIB_OVERRIDES_WINT_T]) +]) diff --git a/gl/malloc.c b/gl/malloc.c index bc81c54..eeaf12b 100644 --- a/gl/malloc.c +++ b/gl/malloc.c @@ -1,6 +1,6 @@ /* malloc() function that is glibc compatible. - Copyright (C) 1997-1998, 2006-2007, 2009-2014 Free Software Foundation, Inc. + Copyright (C) 1997-1998, 2006-2007, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/msvc-inval.c b/gl/msvc-inval.c index f83827f..7139e93 100644 --- a/gl/msvc-inval.c +++ b/gl/msvc-inval.c @@ -1,5 +1,5 @@ /* Invalid parameter handler for MSVC runtime libraries. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/msvc-inval.h b/gl/msvc-inval.h index a0ef540..6e216d6 100644 --- a/gl/msvc-inval.h +++ b/gl/msvc-inval.h @@ -1,5 +1,5 @@ /* Invalid parameter handler for MSVC runtime libraries. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/msvc-nothrow.c b/gl/msvc-nothrow.c index b1e5f0c..d127eb4 100644 --- a/gl/msvc-nothrow.c +++ b/gl/msvc-nothrow.c @@ -1,6 +1,6 @@ /* Wrappers that don't throw invalid parameter notifications with MSVC runtime libraries. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/msvc-nothrow.h b/gl/msvc-nothrow.h index 0d4dea5..c70efc7 100644 --- a/gl/msvc-nothrow.h +++ b/gl/msvc-nothrow.h @@ -1,6 +1,6 @@ /* Wrappers that don't throw invalid parameter notifications with MSVC runtime libraries. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/progname.c b/gl/progname.c index 2919be9..05b2a7f 100644 --- a/gl/progname.c +++ b/gl/progname.c @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2001-2003, 2005-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2017 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2001. This program is free software: you can redistribute it and/or modify diff --git a/gl/progname.h b/gl/progname.h index fa15871..f33881c 100644 --- a/gl/progname.h +++ b/gl/progname.h @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2001-2004, 2006, 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006, 2009-2017 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2001. This program is free software: you can redistribute it and/or modify diff --git a/gl/read-file.c b/gl/read-file.c index 45f6690..2418053 100644 --- a/gl/read-file.c +++ b/gl/read-file.c @@ -1,5 +1,5 @@ /* read-file.c -- read file contents into a string - Copyright (C) 2006, 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. Written by Simon Josefsson and Bruno Haible. This program is free software; you can redistribute it and/or modify diff --git a/gl/read-file.h b/gl/read-file.h index f458b48..23e0920 100644 --- a/gl/read-file.h +++ b/gl/read-file.h @@ -1,5 +1,5 @@ /* read-file.h -- read file contents into a string - Copyright (C) 2006, 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify diff --git a/gl/realloc.c b/gl/realloc.c index 8dfcfbe..526b487 100644 --- a/gl/realloc.c +++ b/gl/realloc.c @@ -1,6 +1,6 @@ /* realloc() function that is glibc compatible. - Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2014 Free Software + Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gl/stdarg.in.h b/gl/stdarg.in.h index 5b37dd3..3785cd1 100644 --- a/gl/stdarg.in.h +++ b/gl/stdarg.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around <stdarg.h>. - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/stddef.in.h b/gl/stddef.in.h index f5c0e05..5b496a6 100644 --- a/gl/stddef.in.h +++ b/gl/stddef.in.h @@ -1,6 +1,6 @@ /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -39,7 +39,6 @@ # if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T) # ifdef __need_wint_t -# undef _@GUARD_PREFIX@_STDDEF_H # define _GL_STDDEF_WINT_T # endif # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ @@ -54,33 +53,58 @@ # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ -# ifndef _@GUARD_PREFIX@_STDDEF_H -# define _@GUARD_PREFIX@_STDDEF_H - /* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */ -#if @REPLACE_NULL@ -# undef NULL -# ifdef __cplusplus +# if (@REPLACE_NULL@ \ + && (!defined _@GUARD_PREFIX@_STDDEF_H || defined _GL_STDDEF_WINT_T)) +# undef NULL +# ifdef __cplusplus /* ISO C++ says that the macro NULL must expand to an integer constant expression, hence '((void *) 0)' is not allowed in C++. */ -# if __GNUG__ >= 3 +# if __GNUG__ >= 3 /* GNU C++ has a __null macro that behaves like an integer ('int' or 'long') but has the same size as a pointer. Use that, to avoid warnings. */ -# define NULL __null -# else -# define NULL 0L +# define NULL __null +# else +# define NULL 0L +# endif +# else +# define NULL ((void *) 0) +# endif # endif -# else -# define NULL ((void *) 0) -# endif -#endif + +# ifndef _@GUARD_PREFIX@_STDDEF_H +# define _@GUARD_PREFIX@_STDDEF_H /* Some platforms lack wchar_t. */ #if !@HAVE_WCHAR_T@ # define wchar_t int #endif +/* Some platforms lack max_align_t. The check for _GCC_MAX_ALIGN_T is + a hack in case the configure-time test was done with g++ even though + we are currently compiling with gcc. */ +#if ! (@HAVE_MAX_ALIGN_T@ || defined _GCC_MAX_ALIGN_T) +/* On the x86, the maximum storage alignment of double, long, etc. is 4, + but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8, + and the C11 standard allows this. Work around this problem by + using __alignof__ (which returns 8 for double) rather than _Alignof + (which returns 4), and align each union member accordingly. */ +# ifdef __GNUC__ +# define _GL_STDDEF_ALIGNAS(type) \ + __attribute__ ((__aligned__ (__alignof__ (type)))) +# else +# define _GL_STDDEF_ALIGNAS(type) /* */ +# endif +typedef union +{ + char *__p _GL_STDDEF_ALIGNAS (char *); + double __d _GL_STDDEF_ALIGNAS (double); + long double __ld _GL_STDDEF_ALIGNAS (long double); + long int __i _GL_STDDEF_ALIGNAS (long int); +} max_align_t; +#endif + # endif /* _@GUARD_PREFIX@_STDDEF_H */ # endif /* _@GUARD_PREFIX@_STDDEF_H */ #endif /* __need_XXX */ diff --git a/gl/stdint.in.h b/gl/stdint.in.h index 247f0d8..d899c1e 100644 --- a/gl/stdint.in.h +++ b/gl/stdint.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002, 2004-2014 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2017 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. @@ -79,54 +79,60 @@ #if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H #define _@GUARD_PREFIX@_STDINT_H +/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX, + LONG_MIN, LONG_MAX, ULONG_MAX, _GL_INTEGER_WIDTH. */ +#include <limits.h> + +/* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides + wint_t. */ +#if @GNULIB_OVERRIDES_WINT_T@ +# undef WINT_MIN +# undef WINT_MAX +# define WINT_MIN 0x0U +# define WINT_MAX 0xffffffffU +#endif + +#if ! @HAVE_C99_STDINT_H@ + /* <sys/types.h> defines some of the stdint.h types as well, on glibc, IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>). AIX 5.2 <sys/types.h> isn't needed and causes troubles. Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but relies on the system <stdint.h> definitions, so include <sys/types.h> after @NEXT_STDINT_H@. */ -#if @HAVE_SYS_TYPES_H@ && ! defined _AIX -# include <sys/types.h> -#endif - -/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX, - LONG_MIN, LONG_MAX, ULONG_MAX. */ -#include <limits.h> +# if @HAVE_SYS_TYPES_H@ && ! defined _AIX +# include <sys/types.h> +# endif -#if @HAVE_INTTYPES_H@ +# if @HAVE_INTTYPES_H@ /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. <inttypes.h> also defines intptr_t and uintptr_t. */ -# include <inttypes.h> -#elif @HAVE_SYS_INTTYPES_H@ +# include <inttypes.h> +# elif @HAVE_SYS_INTTYPES_H@ /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ -# include <sys/inttypes.h> -#endif +# include <sys/inttypes.h> +# endif -#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ +# if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is included by <sys/types.h>. */ -# include <sys/bitypes.h> -#endif +# include <sys/bitypes.h> +# endif -#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H +# undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H /* Minimum and maximum values for an integer type under the usual assumption. Return an unspecified value if BITS == 0, adding a check to pacify picky compilers. */ -#define _STDINT_MIN(signed, bits, zero) \ - ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero)) +# define _STDINT_MIN(signed, bits, zero) \ + ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero)) -#define _STDINT_MAX(signed, bits, zero) \ - ((signed) \ - ? ~ _STDINT_MIN (signed, bits, zero) \ - : /* The expression for the unsigned case. The subtraction of (signed) \ - is a nop in the unsigned case and avoids "signed integer overflow" \ - warnings in the signed case. */ \ - ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) +# define _STDINT_MAX(signed, bits, zero) \ + (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) #if !GNULIB_defined_stdint_types @@ -135,26 +141,26 @@ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. */ -#undef int8_t -#undef uint8_t +# undef int8_t +# undef uint8_t typedef signed char gl_int8_t; typedef unsigned char gl_uint8_t; -#define int8_t gl_int8_t -#define uint8_t gl_uint8_t +# define int8_t gl_int8_t +# define uint8_t gl_uint8_t -#undef int16_t -#undef uint16_t +# undef int16_t +# undef uint16_t typedef short int gl_int16_t; typedef unsigned short int gl_uint16_t; -#define int16_t gl_int16_t -#define uint16_t gl_uint16_t +# define int16_t gl_int16_t +# define uint16_t gl_uint16_t -#undef int32_t -#undef uint32_t +# undef int32_t +# undef uint32_t typedef int gl_int32_t; typedef unsigned int gl_uint32_t; -#define int32_t gl_int32_t -#define uint32_t gl_uint32_t +# define int32_t gl_int32_t +# define uint32_t gl_uint32_t /* If the system defines INT64_MAX, assume int64_t works. That way, if the underlying platform defines int64_t to be a 64-bit long long @@ -162,54 +168,54 @@ typedef unsigned int gl_uint32_t; int, which would mess up C++ name mangling. We must use #ifdef rather than #if, to avoid an error with HP-UX 10.20 cc. */ -#ifdef INT64_MAX -# define GL_INT64_T -#else +# ifdef INT64_MAX +# define GL_INT64_T +# else /* Do not undefine int64_t if gnulib is not being used with 64-bit types, since otherwise it breaks platforms like Tandem/NSK. */ -# if LONG_MAX >> 31 >> 31 == 1 -# undef int64_t +# if LONG_MAX >> 31 >> 31 == 1 +# undef int64_t typedef long int gl_int64_t; -# define int64_t gl_int64_t -# define GL_INT64_T -# elif defined _MSC_VER -# undef int64_t +# define int64_t gl_int64_t +# define GL_INT64_T +# elif defined _MSC_VER +# undef int64_t typedef __int64 gl_int64_t; -# define int64_t gl_int64_t -# define GL_INT64_T -# elif @HAVE_LONG_LONG_INT@ -# undef int64_t +# define int64_t gl_int64_t +# define GL_INT64_T +# elif @HAVE_LONG_LONG_INT@ +# undef int64_t typedef long long int gl_int64_t; -# define int64_t gl_int64_t -# define GL_INT64_T +# define int64_t gl_int64_t +# define GL_INT64_T +# endif # endif -#endif -#ifdef UINT64_MAX -# define GL_UINT64_T -#else -# if ULONG_MAX >> 31 >> 31 >> 1 == 1 -# undef uint64_t -typedef unsigned long int gl_uint64_t; -# define uint64_t gl_uint64_t +# ifdef UINT64_MAX # define GL_UINT64_T -# elif defined _MSC_VER -# undef uint64_t +# else +# if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# undef uint64_t +typedef unsigned long int gl_uint64_t; +# define uint64_t gl_uint64_t +# define GL_UINT64_T +# elif defined _MSC_VER +# undef uint64_t typedef unsigned __int64 gl_uint64_t; -# define uint64_t gl_uint64_t -# define GL_UINT64_T -# elif @HAVE_UNSIGNED_LONG_LONG_INT@ -# undef uint64_t +# define uint64_t gl_uint64_t +# define GL_UINT64_T +# elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# undef uint64_t typedef unsigned long long int gl_uint64_t; -# define uint64_t gl_uint64_t -# define GL_UINT64_T +# define uint64_t gl_uint64_t +# define GL_UINT64_T +# endif # endif -#endif /* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */ -#define _UINT8_T -#define _UINT32_T -#define _UINT64_T +# define _UINT8_T +# define _UINT32_T +# define _UINT64_T /* 7.18.1.2. Minimum-width integer types */ @@ -218,26 +224,26 @@ typedef unsigned long long int gl_uint64_t; types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types are the same as the corresponding N_t types. */ -#undef int_least8_t -#undef uint_least8_t -#undef int_least16_t -#undef uint_least16_t -#undef int_least32_t -#undef uint_least32_t -#undef int_least64_t -#undef uint_least64_t -#define int_least8_t int8_t -#define uint_least8_t uint8_t -#define int_least16_t int16_t -#define uint_least16_t uint16_t -#define int_least32_t int32_t -#define uint_least32_t uint32_t -#ifdef GL_INT64_T -# define int_least64_t int64_t -#endif -#ifdef GL_UINT64_T -# define uint_least64_t uint64_t -#endif +# undef int_least8_t +# undef uint_least8_t +# undef int_least16_t +# undef uint_least16_t +# undef int_least32_t +# undef uint_least32_t +# undef int_least64_t +# undef uint_least64_t +# define int_least8_t int8_t +# define uint_least8_t uint8_t +# define int_least16_t int16_t +# define uint_least16_t uint16_t +# define int_least32_t int32_t +# define uint_least32_t uint32_t +# ifdef GL_INT64_T +# define int_least64_t int64_t +# endif +# ifdef GL_UINT64_T +# define uint_least64_t uint64_t +# endif /* 7.18.1.3. Fastest minimum-width integer types */ @@ -250,50 +256,55 @@ typedef unsigned long long int gl_uint64_t; uses types consistent with glibc, as that lessens the chance of incompatibility with older GNU hosts. */ -#undef int_fast8_t -#undef uint_fast8_t -#undef int_fast16_t -#undef uint_fast16_t -#undef int_fast32_t -#undef uint_fast32_t -#undef int_fast64_t -#undef uint_fast64_t +# undef int_fast8_t +# undef uint_fast8_t +# undef int_fast16_t +# undef uint_fast16_t +# undef int_fast32_t +# undef uint_fast32_t +# undef int_fast64_t +# undef uint_fast64_t typedef signed char gl_int_fast8_t; typedef unsigned char gl_uint_fast8_t; -#ifdef __sun +# ifdef __sun /* Define types compatible with SunOS 5.10, so that code compiled under earlier SunOS versions works with code compiled under SunOS 5.10. */ typedef int gl_int_fast32_t; typedef unsigned int gl_uint_fast32_t; -#else +# else typedef long int gl_int_fast32_t; typedef unsigned long int gl_uint_fast32_t; -#endif +# endif typedef gl_int_fast32_t gl_int_fast16_t; typedef gl_uint_fast32_t gl_uint_fast16_t; -#define int_fast8_t gl_int_fast8_t -#define uint_fast8_t gl_uint_fast8_t -#define int_fast16_t gl_int_fast16_t -#define uint_fast16_t gl_uint_fast16_t -#define int_fast32_t gl_int_fast32_t -#define uint_fast32_t gl_uint_fast32_t -#ifdef GL_INT64_T -# define int_fast64_t int64_t -#endif -#ifdef GL_UINT64_T -# define uint_fast64_t uint64_t -#endif +# define int_fast8_t gl_int_fast8_t +# define uint_fast8_t gl_uint_fast8_t +# define int_fast16_t gl_int_fast16_t +# define uint_fast16_t gl_uint_fast16_t +# define int_fast32_t gl_int_fast32_t +# define uint_fast32_t gl_uint_fast32_t +# ifdef GL_INT64_T +# define int_fast64_t int64_t +# endif +# ifdef GL_UINT64_T +# define uint_fast64_t uint64_t +# endif /* 7.18.1.4. Integer types capable of holding object pointers */ -#undef intptr_t -#undef uintptr_t +/* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own + definitions of intptr_t and uintptr_t (which use int and unsigned) + to avoid clashes with declarations of system functions like sbrk. */ +# ifndef _INTPTR_T_DECLARED +# undef intptr_t +# undef uintptr_t typedef long int gl_intptr_t; typedef unsigned long int gl_uintptr_t; -#define intptr_t gl_intptr_t -#define uintptr_t gl_uintptr_t +# define intptr_t gl_intptr_t +# define uintptr_t gl_uintptr_t +# endif /* 7.18.1.5. Greatest-width integer types */ @@ -304,33 +315,33 @@ typedef unsigned long int gl_uintptr_t; similarly for UINTMAX_MAX and uintmax_t. This avoids problems with assuming one type where another is used by the system. */ -#ifndef INTMAX_MAX -# undef INTMAX_C -# undef intmax_t -# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# ifndef INTMAX_MAX +# undef INTMAX_C +# undef intmax_t +# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 typedef long long int gl_intmax_t; -# define intmax_t gl_intmax_t -# elif defined GL_INT64_T -# define intmax_t int64_t -# else +# define intmax_t gl_intmax_t +# elif defined GL_INT64_T +# define intmax_t int64_t +# else typedef long int gl_intmax_t; -# define intmax_t gl_intmax_t +# define intmax_t gl_intmax_t +# endif # endif -#endif -#ifndef UINTMAX_MAX -# undef UINTMAX_C -# undef uintmax_t -# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# ifndef UINTMAX_MAX +# undef UINTMAX_C +# undef uintmax_t +# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 typedef unsigned long long int gl_uintmax_t; -# define uintmax_t gl_uintmax_t -# elif defined GL_UINT64_T -# define uintmax_t uint64_t -# else +# define uintmax_t gl_uintmax_t +# elif defined GL_UINT64_T +# define uintmax_t uint64_t +# else typedef unsigned long int gl_uintmax_t; -# define uintmax_t gl_uintmax_t +# define uintmax_t gl_uintmax_t +# endif # endif -#endif /* Verify that intmax_t and uintmax_t have the same size. Too much code breaks if this is not the case. If this check fails, the reason is likely @@ -338,8 +349,8 @@ typedef unsigned long int gl_uintmax_t; typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) ? 1 : -1]; -#define GNULIB_defined_stdint_types 1 -#endif /* !GNULIB_defined_stdint_types */ +# define GNULIB_defined_stdint_types 1 +# endif /* !GNULIB_defined_stdint_types */ /* 7.18.2. Limits of specified-width integer types */ @@ -348,37 +359,37 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. */ -#undef INT8_MIN -#undef INT8_MAX -#undef UINT8_MAX -#define INT8_MIN (~ INT8_MAX) -#define INT8_MAX 127 -#define UINT8_MAX 255 - -#undef INT16_MIN -#undef INT16_MAX -#undef UINT16_MAX -#define INT16_MIN (~ INT16_MAX) -#define INT16_MAX 32767 -#define UINT16_MAX 65535 - -#undef INT32_MIN -#undef INT32_MAX -#undef UINT32_MAX -#define INT32_MIN (~ INT32_MAX) -#define INT32_MAX 2147483647 -#define UINT32_MAX 4294967295U - -#if defined GL_INT64_T && ! defined INT64_MAX +# undef INT8_MIN +# undef INT8_MAX +# undef UINT8_MAX +# define INT8_MIN (~ INT8_MAX) +# define INT8_MAX 127 +# define UINT8_MAX 255 + +# undef INT16_MIN +# undef INT16_MAX +# undef UINT16_MAX +# define INT16_MIN (~ INT16_MAX) +# define INT16_MAX 32767 +# define UINT16_MAX 65535 + +# undef INT32_MIN +# undef INT32_MAX +# undef UINT32_MAX +# define INT32_MIN (~ INT32_MAX) +# define INT32_MAX 2147483647 +# define UINT32_MAX 4294967295U + +# if defined GL_INT64_T && ! defined INT64_MAX /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0 evaluates the latter incorrectly in preprocessor expressions. */ -# define INT64_MIN (- INTMAX_C (1) << 63) -# define INT64_MAX INTMAX_C (9223372036854775807) -#endif +# define INT64_MIN (- INTMAX_C (1) << 63) +# define INT64_MAX INTMAX_C (9223372036854775807) +# endif -#if defined GL_UINT64_T && ! defined UINT64_MAX -# define UINT64_MAX UINTMAX_C (18446744073709551615) -#endif +# if defined GL_UINT64_T && ! defined UINT64_MAX +# define UINT64_MAX UINTMAX_C (18446744073709551615) +# endif /* 7.18.2.2. Limits of minimum-width integer types */ @@ -386,38 +397,38 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types are the same as the corresponding N_t types. */ -#undef INT_LEAST8_MIN -#undef INT_LEAST8_MAX -#undef UINT_LEAST8_MAX -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST8_MAX INT8_MAX -#define UINT_LEAST8_MAX UINT8_MAX - -#undef INT_LEAST16_MIN -#undef INT_LEAST16_MAX -#undef UINT_LEAST16_MAX -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST16_MAX INT16_MAX -#define UINT_LEAST16_MAX UINT16_MAX - -#undef INT_LEAST32_MIN -#undef INT_LEAST32_MAX -#undef UINT_LEAST32_MAX -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST32_MAX INT32_MAX -#define UINT_LEAST32_MAX UINT32_MAX - -#undef INT_LEAST64_MIN -#undef INT_LEAST64_MAX -#ifdef GL_INT64_T -# define INT_LEAST64_MIN INT64_MIN -# define INT_LEAST64_MAX INT64_MAX -#endif +# undef INT_LEAST8_MIN +# undef INT_LEAST8_MAX +# undef UINT_LEAST8_MAX +# define INT_LEAST8_MIN INT8_MIN +# define INT_LEAST8_MAX INT8_MAX +# define UINT_LEAST8_MAX UINT8_MAX + +# undef INT_LEAST16_MIN +# undef INT_LEAST16_MAX +# undef UINT_LEAST16_MAX +# define INT_LEAST16_MIN INT16_MIN +# define INT_LEAST16_MAX INT16_MAX +# define UINT_LEAST16_MAX UINT16_MAX + +# undef INT_LEAST32_MIN +# undef INT_LEAST32_MAX +# undef UINT_LEAST32_MAX +# define INT_LEAST32_MIN INT32_MIN +# define INT_LEAST32_MAX INT32_MAX +# define UINT_LEAST32_MAX UINT32_MAX + +# undef INT_LEAST64_MIN +# undef INT_LEAST64_MAX +# ifdef GL_INT64_T +# define INT_LEAST64_MIN INT64_MIN +# define INT_LEAST64_MAX INT64_MAX +# endif -#undef UINT_LEAST64_MAX -#ifdef GL_UINT64_T -# define UINT_LEAST64_MAX UINT64_MAX -#endif +# undef UINT_LEAST64_MAX +# ifdef GL_UINT64_T +# define UINT_LEAST64_MAX UINT64_MAX +# endif /* 7.18.2.3. Limits of fastest minimum-width integer types */ @@ -425,117 +436,117 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types are taken from the same list of types. */ -#undef INT_FAST8_MIN -#undef INT_FAST8_MAX -#undef UINT_FAST8_MAX -#define INT_FAST8_MIN SCHAR_MIN -#define INT_FAST8_MAX SCHAR_MAX -#define UINT_FAST8_MAX UCHAR_MAX - -#undef INT_FAST16_MIN -#undef INT_FAST16_MAX -#undef UINT_FAST16_MAX -#define INT_FAST16_MIN INT_FAST32_MIN -#define INT_FAST16_MAX INT_FAST32_MAX -#define UINT_FAST16_MAX UINT_FAST32_MAX - -#undef INT_FAST32_MIN -#undef INT_FAST32_MAX -#undef UINT_FAST32_MAX -#ifdef __sun -# define INT_FAST32_MIN INT_MIN -# define INT_FAST32_MAX INT_MAX -# define UINT_FAST32_MAX UINT_MAX -#else -# define INT_FAST32_MIN LONG_MIN -# define INT_FAST32_MAX LONG_MAX -# define UINT_FAST32_MAX ULONG_MAX -#endif +# undef INT_FAST8_MIN +# undef INT_FAST8_MAX +# undef UINT_FAST8_MAX +# define INT_FAST8_MIN SCHAR_MIN +# define INT_FAST8_MAX SCHAR_MAX +# define UINT_FAST8_MAX UCHAR_MAX + +# undef INT_FAST16_MIN +# undef INT_FAST16_MAX +# undef UINT_FAST16_MAX +# define INT_FAST16_MIN INT_FAST32_MIN +# define INT_FAST16_MAX INT_FAST32_MAX +# define UINT_FAST16_MAX UINT_FAST32_MAX + +# undef INT_FAST32_MIN +# undef INT_FAST32_MAX +# undef UINT_FAST32_MAX +# ifdef __sun +# define INT_FAST32_MIN INT_MIN +# define INT_FAST32_MAX INT_MAX +# define UINT_FAST32_MAX UINT_MAX +# else +# define INT_FAST32_MIN LONG_MIN +# define INT_FAST32_MAX LONG_MAX +# define UINT_FAST32_MAX ULONG_MAX +# endif -#undef INT_FAST64_MIN -#undef INT_FAST64_MAX -#ifdef GL_INT64_T -# define INT_FAST64_MIN INT64_MIN -# define INT_FAST64_MAX INT64_MAX -#endif +# undef INT_FAST64_MIN +# undef INT_FAST64_MAX +# ifdef GL_INT64_T +# define INT_FAST64_MIN INT64_MIN +# define INT_FAST64_MAX INT64_MAX +# endif -#undef UINT_FAST64_MAX -#ifdef GL_UINT64_T -# define UINT_FAST64_MAX UINT64_MAX -#endif +# undef UINT_FAST64_MAX +# ifdef GL_UINT64_T +# define UINT_FAST64_MAX UINT64_MAX +# endif /* 7.18.2.4. Limits of integer types capable of holding object pointers */ -#undef INTPTR_MIN -#undef INTPTR_MAX -#undef UINTPTR_MAX -#define INTPTR_MIN LONG_MIN -#define INTPTR_MAX LONG_MAX -#define UINTPTR_MAX ULONG_MAX +# undef INTPTR_MIN +# undef INTPTR_MAX +# undef UINTPTR_MAX +# define INTPTR_MIN LONG_MIN +# define INTPTR_MAX LONG_MAX +# define UINTPTR_MAX ULONG_MAX /* 7.18.2.5. Limits of greatest-width integer types */ -#ifndef INTMAX_MAX -# undef INTMAX_MIN -# ifdef INT64_MAX -# define INTMAX_MIN INT64_MIN -# define INTMAX_MAX INT64_MAX -# else -# define INTMAX_MIN INT32_MIN -# define INTMAX_MAX INT32_MAX +# ifndef INTMAX_MAX +# undef INTMAX_MIN +# ifdef INT64_MAX +# define INTMAX_MIN INT64_MIN +# define INTMAX_MAX INT64_MAX +# else +# define INTMAX_MIN INT32_MIN +# define INTMAX_MAX INT32_MAX +# endif # endif -#endif -#ifndef UINTMAX_MAX -# ifdef UINT64_MAX -# define UINTMAX_MAX UINT64_MAX -# else -# define UINTMAX_MAX UINT32_MAX +# ifndef UINTMAX_MAX +# ifdef UINT64_MAX +# define UINTMAX_MAX UINT64_MAX +# else +# define UINTMAX_MAX UINT32_MAX +# endif # endif -#endif /* 7.18.3. Limits of other integer types */ /* ptrdiff_t limits */ -#undef PTRDIFF_MIN -#undef PTRDIFF_MAX -#if @APPLE_UNIVERSAL_BUILD@ -# ifdef _LP64 -# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l) -# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) +# undef PTRDIFF_MIN +# undef PTRDIFF_MAX +# if @APPLE_UNIVERSAL_BUILD@ +# ifdef _LP64 +# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l) +# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) +# else +# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0) +# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) +# endif # else -# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0) -# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) -# endif -#else -# define PTRDIFF_MIN \ +# define PTRDIFF_MIN \ _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) -# define PTRDIFF_MAX \ +# define PTRDIFF_MAX \ _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) -#endif +# endif /* sig_atomic_t limits */ -#undef SIG_ATOMIC_MIN -#undef SIG_ATOMIC_MAX -#define SIG_ATOMIC_MIN \ +# undef SIG_ATOMIC_MIN +# undef SIG_ATOMIC_MAX +# define SIG_ATOMIC_MIN \ _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ 0@SIG_ATOMIC_T_SUFFIX@) -#define SIG_ATOMIC_MAX \ +# define SIG_ATOMIC_MAX \ _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ 0@SIG_ATOMIC_T_SUFFIX@) /* size_t limit */ -#undef SIZE_MAX -#if @APPLE_UNIVERSAL_BUILD@ -# ifdef _LP64 -# define SIZE_MAX _STDINT_MAX (0, 64, 0ul) +# undef SIZE_MAX +# if @APPLE_UNIVERSAL_BUILD@ +# ifdef _LP64 +# define SIZE_MAX _STDINT_MAX (0, 64, 0ul) +# else +# define SIZE_MAX _STDINT_MAX (0, 32, 0ul) +# endif # else -# define SIZE_MAX _STDINT_MAX (0, 32, 0ul) +# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) # endif -#else -# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) -#endif /* wchar_t limits */ /* Get WCHAR_MIN, WCHAR_MAX. @@ -543,29 +554,29 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) sequence of nested includes <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes <stdint.h> and assumes its types are already defined. */ -#if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) +# if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included before <wchar.h>. */ -# include <stddef.h> -# include <stdio.h> -# include <time.h> -# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H -# include <wchar.h> -# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H -#endif -#undef WCHAR_MIN -#undef WCHAR_MAX -#define WCHAR_MIN \ +# include <stddef.h> +# include <stdio.h> +# include <time.h> +# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +# include <wchar.h> +# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +# endif +# undef WCHAR_MIN +# undef WCHAR_MAX +# define WCHAR_MIN \ _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) -#define WCHAR_MAX \ +# define WCHAR_MAX \ _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) /* wint_t limits */ -#undef WINT_MIN -#undef WINT_MAX -#define WINT_MIN \ +# undef WINT_MIN +# undef WINT_MAX +# define WINT_MIN \ _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) -#define WINT_MAX \ +# define WINT_MAX \ _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) /* 7.18.4. Macros for integer constants */ @@ -576,59 +587,120 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */ -#undef INT8_C -#undef UINT8_C -#define INT8_C(x) x -#define UINT8_C(x) x - -#undef INT16_C -#undef UINT16_C -#define INT16_C(x) x -#define UINT16_C(x) x - -#undef INT32_C -#undef UINT32_C -#define INT32_C(x) x -#define UINT32_C(x) x ## U - -#undef INT64_C -#undef UINT64_C -#if LONG_MAX >> 31 >> 31 == 1 -# define INT64_C(x) x##L -#elif defined _MSC_VER -# define INT64_C(x) x##i64 -#elif @HAVE_LONG_LONG_INT@ -# define INT64_C(x) x##LL -#endif -#if ULONG_MAX >> 31 >> 31 >> 1 == 1 -# define UINT64_C(x) x##UL -#elif defined _MSC_VER -# define UINT64_C(x) x##ui64 -#elif @HAVE_UNSIGNED_LONG_LONG_INT@ -# define UINT64_C(x) x##ULL -#endif +# undef INT8_C +# undef UINT8_C +# define INT8_C(x) x +# define UINT8_C(x) x + +# undef INT16_C +# undef UINT16_C +# define INT16_C(x) x +# define UINT16_C(x) x + +# undef INT32_C +# undef UINT32_C +# define INT32_C(x) x +# define UINT32_C(x) x ## U + +# undef INT64_C +# undef UINT64_C +# if LONG_MAX >> 31 >> 31 == 1 +# define INT64_C(x) x##L +# elif defined _MSC_VER +# define INT64_C(x) x##i64 +# elif @HAVE_LONG_LONG_INT@ +# define INT64_C(x) x##LL +# endif +# if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# define UINT64_C(x) x##UL +# elif defined _MSC_VER +# define UINT64_C(x) x##ui64 +# elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# define UINT64_C(x) x##ULL +# endif /* 7.18.4.2. Macros for greatest-width integer constants */ -#ifndef INTMAX_C -# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define INTMAX_C(x) x##LL -# elif defined GL_INT64_T -# define INTMAX_C(x) INT64_C(x) -# else -# define INTMAX_C(x) x##L +# ifndef INTMAX_C +# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# define INTMAX_C(x) x##LL +# elif defined GL_INT64_T +# define INTMAX_C(x) INT64_C(x) +# else +# define INTMAX_C(x) x##L +# endif # endif -#endif -#ifndef UINTMAX_C -# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 -# define UINTMAX_C(x) x##ULL -# elif defined GL_UINT64_T -# define UINTMAX_C(x) UINT64_C(x) -# else -# define UINTMAX_C(x) x##UL +# ifndef UINTMAX_C +# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define UINTMAX_C(x) x##ULL +# elif defined GL_UINT64_T +# define UINTMAX_C(x) UINT64_C(x) +# else +# define UINTMAX_C(x) x##UL +# endif # endif -#endif + +#endif /* !@HAVE_C99_STDINT_H@ */ + +/* Macros specified by ISO/IEC TS 18661-1:2014. */ + +#if (!defined UINTMAX_WIDTH \ + && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__)) +# ifdef INT8_MAX +# define INT8_WIDTH _GL_INTEGER_WIDTH (INT8_MIN, INT8_MAX) +# endif +# ifdef UINT8_MAX +# define UINT8_WIDTH _GL_INTEGER_WIDTH (0, UINT8_MAX) +# endif +# ifdef INT16_MAX +# define INT16_WIDTH _GL_INTEGER_WIDTH (INT16_MIN, INT16_MAX) +# endif +# ifdef UINT16_MAX +# define UINT16_WIDTH _GL_INTEGER_WIDTH (0, UINT16_MAX) +# endif +# ifdef INT32_MAX +# define INT32_WIDTH _GL_INTEGER_WIDTH (INT32_MIN, INT32_MAX) +# endif +# ifdef UINT32_MAX +# define UINT32_WIDTH _GL_INTEGER_WIDTH (0, UINT32_MAX) +# endif +# ifdef INT64_MAX +# define INT64_WIDTH _GL_INTEGER_WIDTH (INT64_MIN, INT64_MAX) +# endif +# ifdef UINT64_MAX +# define UINT64_WIDTH _GL_INTEGER_WIDTH (0, UINT64_MAX) +# endif +# define INT_LEAST8_WIDTH _GL_INTEGER_WIDTH (INT_LEAST8_MIN, INT_LEAST8_MAX) +# define UINT_LEAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST8_MAX) +# define INT_LEAST16_WIDTH _GL_INTEGER_WIDTH (INT_LEAST16_MIN, INT_LEAST16_MAX) +# define UINT_LEAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST16_MAX) +# define INT_LEAST32_WIDTH _GL_INTEGER_WIDTH (INT_LEAST32_MIN, INT_LEAST32_MAX) +# define UINT_LEAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST32_MAX) +# define INT_LEAST64_WIDTH _GL_INTEGER_WIDTH (INT_LEAST64_MIN, INT_LEAST64_MAX) +# define UINT_LEAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST64_MAX) +# define INT_FAST8_WIDTH _GL_INTEGER_WIDTH (INT_FAST8_MIN, INT_FAST8_MAX) +# define UINT_FAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST8_MAX) +# define INT_FAST16_WIDTH _GL_INTEGER_WIDTH (INT_FAST16_MIN, INT_FAST16_MAX) +# define UINT_FAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST16_MAX) +# define INT_FAST32_WIDTH _GL_INTEGER_WIDTH (INT_FAST32_MIN, INT_FAST32_MAX) +# define UINT_FAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST32_MAX) +# define INT_FAST64_WIDTH _GL_INTEGER_WIDTH (INT_FAST64_MIN, INT_FAST64_MAX) +# define UINT_FAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST64_MAX) +# define INTPTR_WIDTH _GL_INTEGER_WIDTH (INTPTR_MIN, INTPTR_MAX) +# define UINTPTR_WIDTH _GL_INTEGER_WIDTH (0, UINTPTR_MAX) +# define INTMAX_WIDTH _GL_INTEGER_WIDTH (INTMAX_MIN, INTMAX_MAX) +# define UINTMAX_WIDTH _GL_INTEGER_WIDTH (0, UINTMAX_MAX) +# define PTRDIFF_WIDTH _GL_INTEGER_WIDTH (PTRDIFF_MIN, PTRDIFF_MAX) +# define SIZE_WIDTH _GL_INTEGER_WIDTH (0, SIZE_MAX) +# define WCHAR_WIDTH _GL_INTEGER_WIDTH (WCHAR_MIN, WCHAR_MAX) +# ifdef WINT_MAX +# define WINT_WIDTH _GL_INTEGER_WIDTH (WINT_MIN, WINT_MAX) +# endif +# ifdef SIG_ATOMIC_MAX +# define SIG_ATOMIC_WIDTH _GL_INTEGER_WIDTH (SIG_ATOMIC_MIN, SIG_ATOMIC_MAX) +# endif +#endif /* !WINT_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */ #endif /* _@GUARD_PREFIX@_STDINT_H */ #endif /* !(defined __ANDROID__ && ...) */ diff --git a/gl/stdio-impl.h b/gl/stdio-impl.h index 299fe47..75a945e 100644 --- a/gl/stdio-impl.h +++ b/gl/stdio-impl.h @@ -1,5 +1,5 @@ /* Implementation details of FILE streams. - Copyright (C) 2007-2008, 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2007-2008, 2010-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +28,8 @@ #include <errno.h> /* For detecting Plan9. */ -#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */ +#if defined __sferror || defined __DragonFly__ || defined __ANDROID__ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ # if defined __DragonFly__ /* DragonFly */ /* See <http://www.dragonflybsd.org/cvsweb/src/lib/libc/stdio/priv_stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup>. */ @@ -57,7 +58,7 @@ # define fp_ fp # endif -# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __ANDROID__ /* NetBSD >= 1.5ZA, OpenBSD, Android */ +# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __minix || defined __ANDROID__ /* NetBSD >= 1.5ZA, OpenBSD, Minix 3, Android */ /* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> and <http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> */ struct __sfileext @@ -66,7 +67,7 @@ /* More fields, not relevant here. */ }; # define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub -# else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin */ +# else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin, Android */ # define fp_ub fp_->_ub # endif @@ -109,4 +110,31 @@ # define _flag __flag # endif +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* newer Windows with MSVC */ + +/* <stdio.h> does not define the innards of FILE any more. */ +# define WINDOWS_OPAQUE_FILE + +struct _gl_real_FILE +{ + /* Note: Compared to older Windows and to mingw, it has the fields + _base and _cnt swapped. */ + unsigned char *_ptr; + unsigned char *_base; + int _cnt; + int _flag; + int _file; + int _charbuf; + int _bufsiz; +}; +# define fp_ ((struct _gl_real_FILE *) fp) + +/* These values were determined by a program similar to the one at + <http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00165.html>. */ +# define _IOREAD 0x1 +# define _IOWRT 0x2 +# define _IORW 0x4 +# define _IOEOF 0x8 +# define _IOERR 0x10 + #endif diff --git a/gl/stdio.in.h b/gl/stdio.in.h index 1e1fe84..d706377 100644 --- a/gl/stdio.in.h +++ b/gl/stdio.in.h @@ -1,6 +1,6 @@ /* A GNU-like <stdio.h>. - Copyright (C) 2004, 2007-2014 Free Software Foundation, Inc. + Copyright (C) 2004, 2007-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -84,8 +84,13 @@ except that it indicates to GCC that the supported format string directives are the ones of the system printf(), rather than the ones standardized by ISO C99 and POSIX. */ -#define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \ +#if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU +# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \ + _GL_ATTRIBUTE_FORMAT_PRINTF (formatstring_parameter, first_argument) +#else +# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \ _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument)) +#endif /* _GL_ATTRIBUTE_FORMAT_SCANF indicates to GCC that the function takes a format string and arguments, @@ -113,6 +118,26 @@ # include <unistd.h> #endif +/* MSVC declares 'perror' in <stdlib.h>, not in <stdio.h>. We must include + it before we #define perror rpl_perror. */ +/* But in any case avoid namespace pollution on glibc systems. */ +#if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \ + && ! defined __GLIBC__ +# include <stdlib.h> +#endif + +/* MSVC declares 'remove' in <io.h>, not in <stdio.h>. We must include + it before we #define remove rpl_remove. */ +/* MSVC declares 'rename' in <io.h>, not in <stdio.h>. We must include + it before we #define rename rpl_rename. */ +/* But in any case avoid namespace pollution on glibc systems. */ +#if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \ + && ! defined __GLIBC__ +# include <io.h> +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ @@ -718,11 +743,10 @@ _GL_WARN_ON_USE (getline, "getline is unportable - " so any use of gets warrants an unconditional warning; besides, C11 removed it. */ #undef gets -#if HAVE_RAW_DECL_GETS +#if HAVE_RAW_DECL_GETS && !defined __cplusplus _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); #endif - #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@ struct obstack; /* Grow an obstack with formatted output. Return the number of diff --git a/gl/stdlib.in.h b/gl/stdlib.in.h index 46e10db..b5cf9d3 100644 --- a/gl/stdlib.in.h +++ b/gl/stdlib.in.h @@ -1,6 +1,6 @@ /* A GNU-like <stdlib.h>. - Copyright (C) 1995, 2001-2004, 2006-2014 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2004, 2006-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -520,6 +520,44 @@ _GL_CXXALIAS_SYS (putenv, int, (char *string)); _GL_CXXALIASWARN (putenv); #endif +#if @GNULIB_QSORT_R@ +/* Sort an array of NMEMB elements, starting at address BASE, each element + occupying SIZE bytes, in ascending order according to the comparison + function COMPARE. */ +# if @REPLACE_QSORT_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef qsort_r +# define qsort_r rpl_qsort_r +# endif +_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, + int (*compare) (void const *, void const *, + void *), + void *arg) _GL_ARG_NONNULL ((1, 4))); +_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, + int (*compare) (void const *, void const *, + void *), + void *arg)); +# else +# if !@HAVE_QSORT_R@ +_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, + int (*compare) (void const *, void const *, + void *), + void *arg) _GL_ARG_NONNULL ((1, 4))); +# endif +_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, + int (*compare) (void const *, void const *, + void *), + void *arg)); +# endif +_GL_CXXALIASWARN (qsort_r); +#elif defined GNULIB_POSIXCHECK +# undef qsort_r +# if HAVE_RAW_DECL_QSORT_R +_GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - " + "use gnulib module qsort_r for portability"); +# endif +#endif + #if @GNULIB_RANDOM_R@ # if !@HAVE_RANDOM_R@ diff --git a/gl/sys_stat.in.h b/gl/sys_stat.in.h index b47a7ff..d5ca343 100644 --- a/gl/sys_stat.in.h +++ b/gl/sys_stat.in.h @@ -1,5 +1,5 @@ /* Provide a more complete sys/stat header file. - Copyright (C) 2005-2014 Free Software Foundation, Inc. + Copyright (C) 2005-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/sys_time.in.h b/gl/sys_time.in.h index 30057ad..57739bc 100644 --- a/gl/sys_time.in.h +++ b/gl/sys_time.in.h @@ -1,6 +1,6 @@ /* Provide a more complete sys/time.h. - Copyright (C) 2007-2014 Free Software Foundation, Inc. + Copyright (C) 2007-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -109,6 +109,13 @@ _GL_CXXALIAS_SYS_CAST (gettimeofday, int, (struct timeval *restrict, void *restrict)); # endif _GL_CXXALIASWARN (gettimeofday); +# if defined __cplusplus && defined GNULIB_NAMESPACE +namespace GNULIB_NAMESPACE { + typedef ::timeval +#undef timeval + timeval; +} +# endif #elif defined GNULIB_POSIXCHECK # undef gettimeofday # if HAVE_RAW_DECL_GETTIMEOFDAY diff --git a/gl/sys_types.in.h b/gl/sys_types.in.h index deb5d67..30ebfbd 100644 --- a/gl/sys_types.in.h +++ b/gl/sys_types.in.h @@ -1,6 +1,6 @@ /* Provide a more complete sys/types.h. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/time.in.h b/gl/time.in.h index 81abdf4..fef8980 100644 --- a/gl/time.in.h +++ b/gl/time.in.h @@ -1,6 +1,6 @@ /* A more-standard <time.h>. - Copyright (C) 2007-2014 Free Software Foundation, Inc. + Copyright (C) 2007-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,11 +22,13 @@ /* Don't get in the way of glibc when it includes time.h merely to declare a few standard symbols, rather than to declare all the - symbols. Also, Solaris 8 <time.h> eventually includes itself + symbols. (However, skip this for MinGW as it treats __need_time_t + incompatibly.) Also, Solaris 8 <time.h> eventually includes itself recursively; if that is happening, just include the system <time.h> without adding our own declarations. */ -#if (defined __need_time_t || defined __need_clock_t \ - || defined __need_timespec \ +#if (((defined __need_time_t || defined __need_clock_t \ + || defined __need_timespec) \ + && !defined __MINGW32__) \ || defined _@GUARD_PREFIX@_TIME_H) # @INCLUDE_NEXT@ @NEXT_TIME_H@ @@ -55,6 +57,8 @@ # include <sys/time.h> # elif @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ # include <pthread.h> +# elif @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ +# include <unistd.h> # else # ifdef __cplusplus @@ -213,7 +217,7 @@ _GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer)); _GL_CXXALIASWARN (gmtime); # endif -/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store +/* Parse BUF as a timestamp, assuming FORMAT specifies its layout, and store the resulting broken-down time into TM. See <http://www.opengroup.org/susv3xsh/strptime.html>. */ # if @GNULIB_STRPTIME@ @@ -229,6 +233,25 @@ _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf, _GL_CXXALIASWARN (strptime); # endif +# if defined _GNU_SOURCE && @GNULIB_TIME_RZ@ && ! @HAVE_TIMEZONE_T@ +typedef struct tm_zone *timezone_t; +_GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name)); +_GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name)); +_GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz)); +_GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz)); +_GL_FUNCDECL_SYS (localtime_rz, struct tm *, + (timezone_t __tz, time_t const *restrict __timer, + struct tm *restrict __result) _GL_ARG_NONNULL ((2, 3))); +_GL_CXXALIAS_SYS (localtime_rz, struct tm *, + (timezone_t __tz, time_t const *restrict __timer, + struct tm *restrict __result)); +_GL_FUNCDECL_SYS (mktime_z, time_t, + (timezone_t __tz, struct tm *restrict __result) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_SYS (mktime_z, time_t, + (timezone_t __tz, struct tm *restrict __result)); +# endif + /* Convert TM to a time_t value, assuming UTC. */ # if @GNULIB_TIMEGM@ # if @REPLACE_TIMEGM@ diff --git a/gl/timespec.h b/gl/timespec.h index 872cbb7..a5eca79 100644 --- a/gl/timespec.h +++ b/gl/timespec.h @@ -1,6 +1,6 @@ /* timespec -- System time interface - Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2014 Free Software + Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -29,7 +29,7 @@ _GL_INLINE_HEADER_BEGIN # define _GL_TIMESPEC_INLINE _GL_INLINE #endif -/* Resolution of timespec time stamps (in units per second), and log +/* Resolution of timespec timestamps (in units per second), and log base 10 of the resolution. */ enum { TIMESPEC_RESOLUTION = 1000000000 }; @@ -48,7 +48,7 @@ make_timespec (time_t s, long int ns) /* Return negative, zero, positive if A < B, A == B, A > B, respectively. - For each time stamp T, this code assumes that either: + For each timestamp T, this code assumes that either: * T.tv_nsec is in the range 0..999999999; or * T.tv_sec corresponds to a valid leap second on a host that supports @@ -56,7 +56,7 @@ make_timespec (time_t s, long int ns) * T.tv_sec is the minimum time_t value and T.tv_nsec is -1; or T.tv_sec is the maximum time_t value and T.tv_nsec is 2000000000. This allows for special struct timespec values that are less or - greater than all possible valid time stamps. + greater than all possible valid timestamps. In all these cases, it is safe to subtract two tv_nsec values and convert the result to integer without worrying about overflow on @@ -74,7 +74,7 @@ make_timespec (time_t s, long int ns) The (int) cast avoids a gcc -Wconversion warning. */ -_GL_TIMESPEC_INLINE int +_GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE timespec_cmp (struct timespec a, struct timespec b) { return (a.tv_sec < b.tv_sec ? -1 @@ -84,7 +84,7 @@ timespec_cmp (struct timespec a, struct timespec b) /* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be nonnegative. */ -_GL_TIMESPEC_INLINE int +_GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE timespec_sign (struct timespec a) { return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec; diff --git a/gl/unistd.c b/gl/unistd.c index 6c6a8e2..72bad1c 100644 --- a/gl/unistd.c +++ b/gl/unistd.c @@ -1,3 +1,4 @@ #include <config.h> #define _GL_UNISTD_INLINE _GL_EXTERN_INLINE #include "unistd.h" +typedef int dummy; diff --git a/gl/unistd.in.h b/gl/unistd.in.h index 622b228..d5fa34d 100644 --- a/gl/unistd.in.h +++ b/gl/unistd.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around <unistd.h>. - Copyright (C) 2003-2014 Free Software Foundation, Inc. + Copyright (C) 2003-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -55,9 +55,13 @@ #include <stddef.h> /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */ +/* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>. We must include + it before we #define unlink rpl_unlink. */ /* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>. */ /* But avoid namespace pollution on glibc systems. */ #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \ + || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) \ || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \ && defined __CYGWIN__)) \ && ! defined __GLIBC__ @@ -401,6 +405,12 @@ _GL_WARN_ON_USE (dup3, "dup3 is unportable - " /* Set of environment variables and values. An array of strings of the form "VARIABLE=VALUE", terminated with a NULL. */ # if defined __APPLE__ && defined __MACH__ +# include <TargetConditionals.h> +# if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR +# define _GL_USE_CRT_EXTERNS +# endif +# endif +# ifdef _GL_USE_CRT_EXTERNS # include <crt_externs.h> # define environ (*_NSGetEnviron ()) # else @@ -770,7 +780,7 @@ _GL_WARN_ON_USE (gethostname, "gethostname is unportable - " ${LOGNAME-$USER} on Unix platforms, $USERNAME on native Windows platforms. */ -# if !@HAVE_GETLOGIN@ +# if !@HAVE_DECL_GETLOGIN@ _GL_FUNCDECL_SYS (getlogin, char *, (void)); # endif _GL_CXXALIAS_SYS (getlogin, char *, (void)); @@ -1287,13 +1297,24 @@ _GL_WARN_ON_USE (readlink, "readlink is unportable - " #if @GNULIB_READLINKAT@ -# if !@HAVE_READLINKAT@ +# if @REPLACE_READLINKAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define readlinkat rpl_readlinkat +# endif +_GL_FUNCDECL_RPL (readlinkat, ssize_t, + (int fd, char const *file, char *buf, size_t len) + _GL_ARG_NONNULL ((2, 3))); +_GL_CXXALIAS_RPL (readlinkat, ssize_t, + (int fd, char const *file, char *buf, size_t len)); +# else +# if !@HAVE_READLINKAT@ _GL_FUNCDECL_SYS (readlinkat, ssize_t, (int fd, char const *file, char *buf, size_t len) _GL_ARG_NONNULL ((2, 3))); -# endif +# endif _GL_CXXALIAS_SYS (readlinkat, ssize_t, (int fd, char const *file, char *buf, size_t len)); +# endif _GL_CXXALIASWARN (readlinkat); #elif defined GNULIB_POSIXCHECK # undef readlinkat @@ -1407,13 +1428,25 @@ _GL_WARN_ON_USE (symlink, "symlink is not portable - " #if @GNULIB_SYMLINKAT@ -# if !@HAVE_SYMLINKAT@ +# if @REPLACE_SYMLINKAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef symlinkat +# define symlinkat rpl_symlinkat +# endif +_GL_FUNCDECL_RPL (symlinkat, int, + (char const *contents, int fd, char const *file) + _GL_ARG_NONNULL ((1, 3))); +_GL_CXXALIAS_RPL (symlinkat, int, + (char const *contents, int fd, char const *file)); +# else +# if !@HAVE_SYMLINKAT@ _GL_FUNCDECL_SYS (symlinkat, int, (char const *contents, int fd, char const *file) _GL_ARG_NONNULL ((1, 3))); -# endif +# endif _GL_CXXALIAS_SYS (symlinkat, int, (char const *contents, int fd, char const *file)); +# endif _GL_CXXALIASWARN (symlinkat); #elif defined GNULIB_POSIXCHECK # undef symlinkat diff --git a/gl/version-etc-fsf.c b/gl/version-etc-fsf.c index b37dd60..6b6f582 100644 --- a/gl/version-etc-fsf.c +++ b/gl/version-etc-fsf.c @@ -1,5 +1,5 @@ /* Variable with FSF copyright information, for version-etc. - Copyright (C) 1999-2006, 2009-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gl/version-etc.c b/gl/version-etc.c index 04f5b62..ce84af3 100644 --- a/gl/version-etc.c +++ b/gl/version-etc.c @@ -1,5 +1,5 @@ /* Print --version and bug-reporting information in a consistent format. - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ # define PACKAGE PACKAGE_TARNAME #endif -enum { COPYRIGHT_YEAR = 2014 }; +enum { COPYRIGHT_YEAR = 2017 }; /* The three functions below display the --version information the standard way. diff --git a/gl/version-etc.h b/gl/version-etc.h index 8e1b2cc..b931de8 100644 --- a/gl/version-etc.h +++ b/gl/version-etc.h @@ -1,5 +1,5 @@ /* Print --version and bug-reporting information in a consistent format. - Copyright (C) 1999, 2003, 2005, 2009-2014 Free Software Foundation, Inc. + Copyright (C) 1999, 2003, 2005, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.2" +#define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -256,7 +256,7 @@ extern int _asn1_yydebug; /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; + union YYSTYPE { #line 62 "ASN1.y" /* yacc.c:355 */ @@ -267,6 +267,8 @@ union YYSTYPE #line 269 "ASN1.c" /* yacc.c:355 */ }; + +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif @@ -280,7 +282,7 @@ int _asn1_yyparse (void); /* Copy the second part of user declarations. */ -#line 284 "ASN1.c" /* yacc.c:358 */ +#line 286 "ASN1.c" /* yacc.c:358 */ #ifdef short # undef short @@ -1540,86 +1542,86 @@ yyreduce: p_tree=(yyval.node); } -#line 1544 "ASN1.c" /* yacc.c:1646 */ +#line 1546 "ASN1.c" /* yacc.c:1646 */ break; case 3: #line 148 "ASN1.y" /* yacc.c:1646 */ {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1550 "ASN1.c" /* yacc.c:1646 */ +#line 1552 "ASN1.c" /* yacc.c:1646 */ break; case 4: #line 149 "ASN1.y" /* yacc.c:1646 */ {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1556 "ASN1.c" /* yacc.c:1646 */ +#line 1558 "ASN1.c" /* yacc.c:1646 */ break; case 5: #line 152 "ASN1.y" /* yacc.c:1646 */ {snprintf((yyval.str),sizeof((yyval.str)),"-%s",(yyvsp[0].str));} -#line 1562 "ASN1.c" /* yacc.c:1646 */ +#line 1564 "ASN1.c" /* yacc.c:1646 */ break; case 6: #line 155 "ASN1.y" /* yacc.c:1646 */ {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1568 "ASN1.c" /* yacc.c:1646 */ +#line 1570 "ASN1.c" /* yacc.c:1646 */ break; case 7: #line 156 "ASN1.y" /* yacc.c:1646 */ {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1574 "ASN1.c" /* yacc.c:1646 */ +#line 1576 "ASN1.c" /* yacc.c:1646 */ break; case 8: #line 159 "ASN1.y" /* yacc.c:1646 */ {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1580 "ASN1.c" /* yacc.c:1646 */ +#line 1582 "ASN1.c" /* yacc.c:1646 */ break; case 9: #line 160 "ASN1.y" /* yacc.c:1646 */ {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1586 "ASN1.c" /* yacc.c:1646 */ +#line 1588 "ASN1.c" /* yacc.c:1646 */ break; case 10: #line 163 "ASN1.y" /* yacc.c:1646 */ {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1592 "ASN1.c" /* yacc.c:1646 */ +#line 1594 "ASN1.c" /* yacc.c:1646 */ break; case 11: #line 164 "ASN1.y" /* yacc.c:1646 */ {snprintf((yyval.str),sizeof((yyval.str)),"-%s",(yyvsp[0].str));} -#line 1598 "ASN1.c" /* yacc.c:1646 */ +#line 1600 "ASN1.c" /* yacc.c:1646 */ break; case 12: #line 165 "ASN1.y" /* yacc.c:1646 */ {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1604 "ASN1.c" /* yacc.c:1646 */ +#line 1606 "ASN1.c" /* yacc.c:1646 */ break; case 13: #line 168 "ASN1.y" /* yacc.c:1646 */ {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1610 "ASN1.c" /* yacc.c:1646 */ +#line 1612 "ASN1.c" /* yacc.c:1646 */ break; case 14: #line 169 "ASN1.y" /* yacc.c:1646 */ {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1616 "ASN1.c" /* yacc.c:1646 */ +#line 1618 "ASN1.c" /* yacc.c:1646 */ break; case 15: #line 172 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);} -#line 1623 "ASN1.c" /* yacc.c:1646 */ +#line 1625 "ASN1.c" /* yacc.c:1646 */ break; case 16: @@ -1627,27 +1629,27 @@ yyreduce: {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT); _asn1_set_name((yyval.node),(yyvsp[-3].str)); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);} -#line 1631 "ASN1.c" /* yacc.c:1646 */ +#line 1633 "ASN1.c" /* yacc.c:1646 */ break; case 17: #line 179 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 1637 "ASN1.c" /* yacc.c:1646 */ +#line 1639 "ASN1.c" /* yacc.c:1646 */ break; case 18: #line 180 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[-2].node); _asn1_set_right(_asn1_get_last_right((yyvsp[-2].node)),(yyvsp[0].node));} -#line 1644 "ASN1.c" /* yacc.c:1646 */ +#line 1646 "ASN1.c" /* yacc.c:1646 */ break; case 19: #line 184 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT); _asn1_set_value((yyval.node),(yyvsp[0].str),strlen((yyvsp[0].str))+1);} -#line 1651 "ASN1.c" /* yacc.c:1646 */ +#line 1653 "ASN1.c" /* yacc.c:1646 */ break; case 20: @@ -1655,108 +1657,108 @@ yyreduce: {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT); _asn1_set_name((yyval.node),(yyvsp[-3].str)); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);} -#line 1659 "ASN1.c" /* yacc.c:1646 */ +#line 1661 "ASN1.c" /* yacc.c:1646 */ break; case 21: #line 191 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 1665 "ASN1.c" /* yacc.c:1646 */ +#line 1667 "ASN1.c" /* yacc.c:1646 */ break; case 22: #line 192 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[-1].node); _asn1_set_right(_asn1_get_last_right((yyvsp[-1].node)),(yyvsp[0].node));} -#line 1672 "ASN1.c" /* yacc.c:1646 */ +#line 1674 "ASN1.c" /* yacc.c:1646 */ break; case 23: #line 196 "ASN1.y" /* yacc.c:1646 */ {(yyval.constant)=CONST_UNIVERSAL;} -#line 1678 "ASN1.c" /* yacc.c:1646 */ +#line 1680 "ASN1.c" /* yacc.c:1646 */ break; case 24: #line 197 "ASN1.y" /* yacc.c:1646 */ {(yyval.constant)=CONST_PRIVATE;} -#line 1684 "ASN1.c" /* yacc.c:1646 */ +#line 1686 "ASN1.c" /* yacc.c:1646 */ break; case 25: #line 198 "ASN1.y" /* yacc.c:1646 */ {(yyval.constant)=CONST_APPLICATION;} -#line 1690 "ASN1.c" /* yacc.c:1646 */ +#line 1692 "ASN1.c" /* yacc.c:1646 */ break; case 26: #line 201 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TAG); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);} -#line 1697 "ASN1.c" /* yacc.c:1646 */ +#line 1699 "ASN1.c" /* yacc.c:1646 */ break; case 27: #line 203 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TAG | (yyvsp[-2].constant)); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);} -#line 1704 "ASN1.c" /* yacc.c:1646 */ +#line 1706 "ASN1.c" /* yacc.c:1646 */ break; case 28: #line 207 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 1710 "ASN1.c" /* yacc.c:1646 */ +#line 1712 "ASN1.c" /* yacc.c:1646 */ break; case 29: #line 208 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_EXPLICIT);} -#line 1716 "ASN1.c" /* yacc.c:1646 */ +#line 1718 "ASN1.c" /* yacc.c:1646 */ break; case 30: #line 209 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_IMPLICIT);} -#line 1722 "ASN1.c" /* yacc.c:1646 */ +#line 1724 "ASN1.c" /* yacc.c:1646 */ break; case 31: #line 212 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_DEFAULT); _asn1_set_value((yyval.node),(yyvsp[0].str),strlen((yyvsp[0].str))+1);} -#line 1729 "ASN1.c" /* yacc.c:1646 */ +#line 1731 "ASN1.c" /* yacc.c:1646 */ break; case 32: #line 214 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_DEFAULT|CONST_TRUE);} -#line 1735 "ASN1.c" /* yacc.c:1646 */ +#line 1737 "ASN1.c" /* yacc.c:1646 */ break; case 33: #line 215 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_DEFAULT|CONST_FALSE);} -#line 1741 "ASN1.c" /* yacc.c:1646 */ +#line 1743 "ASN1.c" /* yacc.c:1646 */ break; case 36: #line 224 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER);} -#line 1747 "ASN1.c" /* yacc.c:1646 */ +#line 1749 "ASN1.c" /* yacc.c:1646 */ break; case 37: #line 225 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_LIST); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 1754 "ASN1.c" /* yacc.c:1646 */ +#line 1756 "ASN1.c" /* yacc.c:1646 */ break; case 38: #line 227 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER);} -#line 1760 "ASN1.c" /* yacc.c:1646 */ +#line 1762 "ASN1.c" /* yacc.c:1646 */ break; case 39: @@ -1765,32 +1767,32 @@ yyreduce: _asn1_set_down((yyval.node),_asn1_add_static_node(ASN1_ETYPE_SIZE)); _asn1_set_value(_asn1_get_down((yyval.node)),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1); _asn1_set_name(_asn1_get_down((yyval.node)),(yyvsp[-4].str));} -#line 1769 "ASN1.c" /* yacc.c:1646 */ +#line 1771 "ASN1.c" /* yacc.c:1646 */ break; case 40: #line 235 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BOOLEAN);} -#line 1775 "ASN1.c" /* yacc.c:1646 */ +#line 1777 "ASN1.c" /* yacc.c:1646 */ break; case 41: #line 238 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UTC_TIME);} -#line 1781 "ASN1.c" /* yacc.c:1646 */ +#line 1783 "ASN1.c" /* yacc.c:1646 */ break; case 42: #line 239 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_GENERALIZED_TIME);} -#line 1787 "ASN1.c" /* yacc.c:1646 */ +#line 1789 "ASN1.c" /* yacc.c:1646 */ break; case 43: #line 242 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SIZE|CONST_1_PARAM); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);} -#line 1794 "ASN1.c" /* yacc.c:1646 */ +#line 1796 "ASN1.c" /* yacc.c:1646 */ break; case 44: @@ -1798,149 +1800,149 @@ yyreduce: {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SIZE|CONST_MIN_MAX); _asn1_set_value((yyval.node),(yyvsp[-4].str),strlen((yyvsp[-4].str))+1); _asn1_set_name((yyval.node),(yyvsp[-1].str));} -#line 1802 "ASN1.c" /* yacc.c:1646 */ +#line 1804 "ASN1.c" /* yacc.c:1646 */ break; case 45: #line 250 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 1808 "ASN1.c" /* yacc.c:1646 */ +#line 1810 "ASN1.c" /* yacc.c:1646 */ break; case 46: #line 251 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[-1].node);} -#line 1814 "ASN1.c" /* yacc.c:1646 */ +#line 1816 "ASN1.c" /* yacc.c:1646 */ break; case 47: #line 254 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_GENERALSTRING);} -#line 1820 "ASN1.c" /* yacc.c:1646 */ +#line 1822 "ASN1.c" /* yacc.c:1646 */ break; case 48: #line 255 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_GENERALSTRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1827 "ASN1.c" /* yacc.c:1646 */ +#line 1829 "ASN1.c" /* yacc.c:1646 */ break; case 49: #line 259 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NUMERIC_STRING|CONST_UNIVERSAL);} -#line 1833 "ASN1.c" /* yacc.c:1646 */ +#line 1835 "ASN1.c" /* yacc.c:1646 */ break; case 50: #line 260 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NUMERIC_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1840 "ASN1.c" /* yacc.c:1646 */ +#line 1842 "ASN1.c" /* yacc.c:1646 */ break; case 51: #line 264 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IA5_STRING);} -#line 1846 "ASN1.c" /* yacc.c:1646 */ +#line 1848 "ASN1.c" /* yacc.c:1646 */ break; case 52: #line 265 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IA5_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1853 "ASN1.c" /* yacc.c:1646 */ +#line 1855 "ASN1.c" /* yacc.c:1646 */ break; case 53: #line 269 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TELETEX_STRING);} -#line 1859 "ASN1.c" /* yacc.c:1646 */ +#line 1861 "ASN1.c" /* yacc.c:1646 */ break; case 54: #line 270 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TELETEX_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1866 "ASN1.c" /* yacc.c:1646 */ +#line 1868 "ASN1.c" /* yacc.c:1646 */ break; case 55: #line 274 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_PRINTABLE_STRING);} -#line 1872 "ASN1.c" /* yacc.c:1646 */ +#line 1874 "ASN1.c" /* yacc.c:1646 */ break; case 56: #line 275 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_PRINTABLE_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1879 "ASN1.c" /* yacc.c:1646 */ +#line 1881 "ASN1.c" /* yacc.c:1646 */ break; case 57: #line 279 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UNIVERSAL_STRING);} -#line 1885 "ASN1.c" /* yacc.c:1646 */ +#line 1887 "ASN1.c" /* yacc.c:1646 */ break; case 58: #line 280 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UNIVERSAL_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1892 "ASN1.c" /* yacc.c:1646 */ +#line 1894 "ASN1.c" /* yacc.c:1646 */ break; case 59: #line 284 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BMP_STRING);} -#line 1898 "ASN1.c" /* yacc.c:1646 */ +#line 1900 "ASN1.c" /* yacc.c:1646 */ break; case 60: #line 285 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BMP_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1905 "ASN1.c" /* yacc.c:1646 */ +#line 1907 "ASN1.c" /* yacc.c:1646 */ break; case 61: #line 289 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UTF8_STRING);} -#line 1911 "ASN1.c" /* yacc.c:1646 */ +#line 1913 "ASN1.c" /* yacc.c:1646 */ break; case 62: #line 290 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UTF8_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1918 "ASN1.c" /* yacc.c:1646 */ +#line 1920 "ASN1.c" /* yacc.c:1646 */ break; case 63: #line 294 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_VISIBLE_STRING);} -#line 1924 "ASN1.c" /* yacc.c:1646 */ +#line 1926 "ASN1.c" /* yacc.c:1646 */ break; case 64: #line 295 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_VISIBLE_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1931 "ASN1.c" /* yacc.c:1646 */ +#line 1933 "ASN1.c" /* yacc.c:1646 */ break; case 65: #line 299 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OCTET_STRING);} -#line 1937 "ASN1.c" /* yacc.c:1646 */ +#line 1939 "ASN1.c" /* yacc.c:1646 */ break; case 66: #line 300 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OCTET_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1944 "ASN1.c" /* yacc.c:1646 */ +#line 1946 "ASN1.c" /* yacc.c:1646 */ break; case 67: @@ -1948,59 +1950,59 @@ yyreduce: {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT); _asn1_set_name((yyval.node),(yyvsp[-3].str)); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);} -#line 1952 "ASN1.c" /* yacc.c:1646 */ +#line 1954 "ASN1.c" /* yacc.c:1646 */ break; case 68: #line 309 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 1958 "ASN1.c" /* yacc.c:1646 */ +#line 1960 "ASN1.c" /* yacc.c:1646 */ break; case 69: #line 310 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[-2].node); _asn1_set_right(_asn1_get_last_right((yyvsp[-2].node)),(yyvsp[0].node));} -#line 1965 "ASN1.c" /* yacc.c:1646 */ +#line 1967 "ASN1.c" /* yacc.c:1646 */ break; case 70: #line 314 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BIT_STRING);} -#line 1971 "ASN1.c" /* yacc.c:1646 */ +#line 1973 "ASN1.c" /* yacc.c:1646 */ break; case 71: #line 315 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BIT_STRING|CONST_SIZE);} -#line 1977 "ASN1.c" /* yacc.c:1646 */ +#line 1979 "ASN1.c" /* yacc.c:1646 */ break; case 72: #line 317 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BIT_STRING|CONST_LIST); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 1984 "ASN1.c" /* yacc.c:1646 */ +#line 1986 "ASN1.c" /* yacc.c:1646 */ break; case 73: #line 322 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_ENUMERATED|CONST_LIST); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 1991 "ASN1.c" /* yacc.c:1646 */ +#line 1993 "ASN1.c" /* yacc.c:1646 */ break; case 74: #line 327 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID);} -#line 1997 "ASN1.c" /* yacc.c:1646 */ +#line 1999 "ASN1.c" /* yacc.c:1646 */ break; case 75: #line 330 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IDENTIFIER); _asn1_set_value((yyval.node),(yyvsp[0].str),strlen((yyvsp[0].str))+1);} -#line 2004 "ASN1.c" /* yacc.c:1646 */ +#line 2006 "ASN1.c" /* yacc.c:1646 */ break; case 76: @@ -2008,133 +2010,133 @@ yyreduce: {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IDENTIFIER|CONST_SIZE); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 2012 "ASN1.c" /* yacc.c:1646 */ +#line 2014 "ASN1.c" /* yacc.c:1646 */ break; case 77: #line 335 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2018 "ASN1.c" /* yacc.c:1646 */ +#line 2020 "ASN1.c" /* yacc.c:1646 */ break; case 78: #line 336 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2024 "ASN1.c" /* yacc.c:1646 */ +#line 2026 "ASN1.c" /* yacc.c:1646 */ break; case 79: #line 337 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2030 "ASN1.c" /* yacc.c:1646 */ +#line 2032 "ASN1.c" /* yacc.c:1646 */ break; case 81: #line 339 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2036 "ASN1.c" /* yacc.c:1646 */ +#line 2038 "ASN1.c" /* yacc.c:1646 */ break; case 82: #line 340 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2042 "ASN1.c" /* yacc.c:1646 */ +#line 2044 "ASN1.c" /* yacc.c:1646 */ break; case 83: #line 341 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2048 "ASN1.c" /* yacc.c:1646 */ +#line 2050 "ASN1.c" /* yacc.c:1646 */ break; case 84: #line 342 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2054 "ASN1.c" /* yacc.c:1646 */ +#line 2056 "ASN1.c" /* yacc.c:1646 */ break; case 85: #line 343 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2060 "ASN1.c" /* yacc.c:1646 */ +#line 2062 "ASN1.c" /* yacc.c:1646 */ break; case 86: #line 344 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2066 "ASN1.c" /* yacc.c:1646 */ +#line 2068 "ASN1.c" /* yacc.c:1646 */ break; case 87: #line 345 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2072 "ASN1.c" /* yacc.c:1646 */ +#line 2074 "ASN1.c" /* yacc.c:1646 */ break; case 88: #line 346 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2078 "ASN1.c" /* yacc.c:1646 */ +#line 2080 "ASN1.c" /* yacc.c:1646 */ break; case 89: #line 347 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2084 "ASN1.c" /* yacc.c:1646 */ +#line 2086 "ASN1.c" /* yacc.c:1646 */ break; case 90: #line 348 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2090 "ASN1.c" /* yacc.c:1646 */ +#line 2092 "ASN1.c" /* yacc.c:1646 */ break; case 91: #line 349 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2096 "ASN1.c" /* yacc.c:1646 */ +#line 2098 "ASN1.c" /* yacc.c:1646 */ break; case 92: #line 350 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2102 "ASN1.c" /* yacc.c:1646 */ +#line 2104 "ASN1.c" /* yacc.c:1646 */ break; case 93: #line 351 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2108 "ASN1.c" /* yacc.c:1646 */ +#line 2110 "ASN1.c" /* yacc.c:1646 */ break; case 94: #line 352 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2114 "ASN1.c" /* yacc.c:1646 */ +#line 2116 "ASN1.c" /* yacc.c:1646 */ break; case 95: #line 353 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2120 "ASN1.c" /* yacc.c:1646 */ +#line 2122 "ASN1.c" /* yacc.c:1646 */ break; case 96: #line 354 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2126 "ASN1.c" /* yacc.c:1646 */ +#line 2128 "ASN1.c" /* yacc.c:1646 */ break; case 97: #line 355 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NULL);} -#line 2132 "ASN1.c" /* yacc.c:1646 */ +#line 2134 "ASN1.c" /* yacc.c:1646 */ break; case 98: #line 358 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2138 "ASN1.c" /* yacc.c:1646 */ +#line 2140 "ASN1.c" /* yacc.c:1646 */ break; case 99: @@ -2142,13 +2144,13 @@ yyreduce: {(yyval.node)=_asn1_mod_type((yyvsp[0].node),CONST_TAG); _asn1_set_right((yyvsp[-1].node),_asn1_get_down((yyval.node))); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 2146 "ASN1.c" /* yacc.c:1646 */ +#line 2148 "ASN1.c" /* yacc.c:1646 */ break; case 100: #line 364 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2152 "ASN1.c" /* yacc.c:1646 */ +#line 2154 "ASN1.c" /* yacc.c:1646 */ break; case 101: @@ -2156,46 +2158,46 @@ yyreduce: {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_DEFAULT); _asn1_set_right((yyvsp[0].node),_asn1_get_down((yyval.node))); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 2160 "ASN1.c" /* yacc.c:1646 */ +#line 2162 "ASN1.c" /* yacc.c:1646 */ break; case 102: #line 368 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_OPTION);} -#line 2166 "ASN1.c" /* yacc.c:1646 */ +#line 2168 "ASN1.c" /* yacc.c:1646 */ break; case 103: #line 371 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_set_name((yyvsp[0].node),(yyvsp[-1].str));} -#line 2172 "ASN1.c" /* yacc.c:1646 */ +#line 2174 "ASN1.c" /* yacc.c:1646 */ break; case 104: #line 374 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2178 "ASN1.c" /* yacc.c:1646 */ +#line 2180 "ASN1.c" /* yacc.c:1646 */ break; case 105: #line 375 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[-2].node); _asn1_set_right(_asn1_get_last_right((yyvsp[-2].node)),(yyvsp[0].node));} -#line 2185 "ASN1.c" /* yacc.c:1646 */ +#line 2187 "ASN1.c" /* yacc.c:1646 */ break; case 106: #line 379 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SEQUENCE); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 2192 "ASN1.c" /* yacc.c:1646 */ +#line 2194 "ASN1.c" /* yacc.c:1646 */ break; case 107: #line 381 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SEQUENCE_OF); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 2199 "ASN1.c" /* yacc.c:1646 */ +#line 2201 "ASN1.c" /* yacc.c:1646 */ break; case 108: @@ -2203,21 +2205,21 @@ yyreduce: {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SEQUENCE_OF|CONST_SIZE); _asn1_set_right((yyvsp[-2].node),(yyvsp[0].node)); _asn1_set_down((yyval.node),(yyvsp[-2].node));} -#line 2207 "ASN1.c" /* yacc.c:1646 */ +#line 2209 "ASN1.c" /* yacc.c:1646 */ break; case 109: #line 388 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SET); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 2214 "ASN1.c" /* yacc.c:1646 */ +#line 2216 "ASN1.c" /* yacc.c:1646 */ break; case 110: #line 390 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SET_OF); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 2221 "ASN1.c" /* yacc.c:1646 */ +#line 2223 "ASN1.c" /* yacc.c:1646 */ break; case 111: @@ -2225,20 +2227,20 @@ yyreduce: {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SET_OF|CONST_SIZE); _asn1_set_right((yyvsp[-2].node),(yyvsp[0].node)); _asn1_set_down((yyval.node),(yyvsp[-2].node));} -#line 2229 "ASN1.c" /* yacc.c:1646 */ +#line 2231 "ASN1.c" /* yacc.c:1646 */ break; case 112: #line 397 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CHOICE); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 2236 "ASN1.c" /* yacc.c:1646 */ +#line 2238 "ASN1.c" /* yacc.c:1646 */ break; case 113: #line 401 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_ANY);} -#line 2242 "ASN1.c" /* yacc.c:1646 */ +#line 2244 "ASN1.c" /* yacc.c:1646 */ break; case 114: @@ -2246,19 +2248,19 @@ yyreduce: {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_ANY|CONST_DEFINED_BY); _asn1_set_down((yyval.node),_asn1_add_static_node(ASN1_ETYPE_CONSTANT)); _asn1_set_name(_asn1_get_down((yyval.node)),(yyvsp[0].str));} -#line 2250 "ASN1.c" /* yacc.c:1646 */ +#line 2252 "ASN1.c" /* yacc.c:1646 */ break; case 115: #line 407 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_set_name((yyvsp[0].node),(yyvsp[-2].str));} -#line 2256 "ASN1.c" /* yacc.c:1646 */ +#line 2258 "ASN1.c" /* yacc.c:1646 */ break; case 116: #line 409 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_set_name((yyvsp[0].node), last_error_token);} -#line 2262 "ASN1.c" /* yacc.c:1646 */ +#line 2264 "ASN1.c" /* yacc.c:1646 */ break; case 117: @@ -2266,7 +2268,7 @@ yyreduce: {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN); _asn1_set_name((yyval.node),(yyvsp[-6].str)); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 2270 "ASN1.c" /* yacc.c:1646 */ +#line 2272 "ASN1.c" /* yacc.c:1646 */ break; case 118: @@ -2275,7 +2277,7 @@ yyreduce: _asn1_set_name((yyval.node),(yyvsp[-5].str)); _asn1_set_value((yyval.node),(yyvsp[-4].str),strlen((yyvsp[-4].str))+1); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 2279 "ASN1.c" /* yacc.c:1646 */ +#line 2281 "ASN1.c" /* yacc.c:1646 */ break; case 119: @@ -2283,32 +2285,32 @@ yyreduce: {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_ASSIGN); _asn1_set_name((yyval.node),(yyvsp[-3].str)); _asn1_set_value((yyval.node),(yyvsp[0].str),strlen((yyvsp[0].str))+1);} -#line 2287 "ASN1.c" /* yacc.c:1646 */ +#line 2289 "ASN1.c" /* yacc.c:1646 */ break; case 120: #line 427 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2293 "ASN1.c" /* yacc.c:1646 */ +#line 2295 "ASN1.c" /* yacc.c:1646 */ break; case 121: #line 428 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2299 "ASN1.c" /* yacc.c:1646 */ +#line 2301 "ASN1.c" /* yacc.c:1646 */ break; case 122: #line 431 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[0].node);} -#line 2305 "ASN1.c" /* yacc.c:1646 */ +#line 2307 "ASN1.c" /* yacc.c:1646 */ break; case 123: #line 432 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=(yyvsp[-1].node); _asn1_set_right(_asn1_get_last_right((yyvsp[-1].node)),(yyvsp[0].node));} -#line 2312 "ASN1.c" /* yacc.c:1646 */ +#line 2314 "ASN1.c" /* yacc.c:1646 */ break; case 124: @@ -2316,37 +2318,37 @@ yyreduce: {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID); _asn1_set_down((yyval.node),(yyvsp[-1].node)); _asn1_set_name((yyval.node),(yyvsp[-3].str));} -#line 2320 "ASN1.c" /* yacc.c:1646 */ +#line 2322 "ASN1.c" /* yacc.c:1646 */ break; case 125: #line 439 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID); _asn1_set_name((yyval.node),(yyvsp[-2].str));} -#line 2327 "ASN1.c" /* yacc.c:1646 */ +#line 2329 "ASN1.c" /* yacc.c:1646 */ break; case 126: #line 441 "ASN1.y" /* yacc.c:1646 */ {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID); _asn1_set_name((yyval.node),(yyvsp[0].str));} -#line 2334 "ASN1.c" /* yacc.c:1646 */ +#line 2336 "ASN1.c" /* yacc.c:1646 */ break; case 127: #line 465 "ASN1.y" /* yacc.c:1646 */ {(yyval.constant)=CONST_EXPLICIT;} -#line 2340 "ASN1.c" /* yacc.c:1646 */ +#line 2342 "ASN1.c" /* yacc.c:1646 */ break; case 128: #line 466 "ASN1.y" /* yacc.c:1646 */ {(yyval.constant)=CONST_IMPLICIT;} -#line 2346 "ASN1.c" /* yacc.c:1646 */ +#line 2348 "ASN1.c" /* yacc.c:1646 */ break; -#line 2350 "ASN1.c" /* yacc.c:1646 */ +#line 2352 "ASN1.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2729,7 +2731,7 @@ _asn1_create_errorDescription (int error, char *error_desc) case ASN1_NAME_TOO_LONG: snprintf (error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, "%s:%u: name too long (more than %u characters)", file_name, - line_number, ASN1_MAX_NAME_SIZE); + line_number, (unsigned)ASN1_MAX_NAME_SIZE); break; case ASN1_IDENTIFIER_NOT_FOUND: snprintf (error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, @@ -2757,7 +2759,7 @@ _asn1_create_errorDescription (int error, char *error_desc) * * Returns: %ASN1_SUCCESS if the file has a correct syntax and every * identifier is known, %ASN1_ELEMENT_NOT_EMPTY if @definitions not - * %NULL, %ASN1_FILE_NOT_FOUND if an error occured while + * %NULL, %ASN1_FILE_NOT_FOUND if an error occurred while * opening @file, %ASN1_SYNTAX_ERROR if the syntax is not * correct, %ASN1_IDENTIFIER_NOT_FOUND if in the file there is an * identifier that is not defined, %ASN1_NAME_TOO_LONG if in the @@ -2845,7 +2847,7 @@ asn1_parser2tree (const char *file, asn1_node * definitions, * will be "xx_asn1_tab". * * Returns: %ASN1_SUCCESS if the file has a correct syntax and every - * identifier is known, %ASN1_FILE_NOT_FOUND if an error occured + * identifier is known, %ASN1_FILE_NOT_FOUND if an error occurred * while opening @inputFileName, %ASN1_SYNTAX_ERROR if the syntax is * not correct, %ASN1_IDENTIFIER_NOT_FOUND if in the file there is * an identifier that is not defined, %ASN1_NAME_TOO_LONG if in the @@ -57,7 +57,7 @@ static int _asn1_yylex(void); /* Prefix symbols and functions with _asn1_ */ /* %define parse.lac full */ %error-verbose -%name-prefix="_asn1_yy" +%name-prefix "_asn1_yy" %union { unsigned int constant; @@ -621,7 +621,7 @@ _asn1_create_errorDescription (int error, char *error_desc) case ASN1_NAME_TOO_LONG: snprintf (error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, "%s:%u: name too long (more than %u characters)", file_name, - line_number, ASN1_MAX_NAME_SIZE); + line_number, (unsigned)ASN1_MAX_NAME_SIZE); break; case ASN1_IDENTIFIER_NOT_FOUND: snprintf (error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, @@ -649,7 +649,7 @@ _asn1_create_errorDescription (int error, char *error_desc) * * Returns: %ASN1_SUCCESS if the file has a correct syntax and every * identifier is known, %ASN1_ELEMENT_NOT_EMPTY if @definitions not - * %NULL, %ASN1_FILE_NOT_FOUND if an error occured while + * %NULL, %ASN1_FILE_NOT_FOUND if an error occurred while * opening @file, %ASN1_SYNTAX_ERROR if the syntax is not * correct, %ASN1_IDENTIFIER_NOT_FOUND if in the file there is an * identifier that is not defined, %ASN1_NAME_TOO_LONG if in the @@ -737,7 +737,7 @@ asn1_parser2tree (const char *file, asn1_node * definitions, * will be "xx_asn1_tab". * * Returns: %ASN1_SUCCESS if the file has a correct syntax and every - * identifier is known, %ASN1_FILE_NOT_FOUND if an error occured + * identifier is known, %ASN1_FILE_NOT_FOUND if an error occurred * while opening @inputFileName, %ASN1_SYNTAX_ERROR if the syntax is * not correct, %ASN1_IDENTIFIER_NOT_FOUND if in the file there is * an identifier that is not defined, %ASN1_NAME_TOO_LONG if in the diff --git a/lib/Makefile.in b/lib/Makefile.in index 3dc3c0d..e09a7e8 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -132,6 +132,7 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/largefile.m4 \ + $(top_srcdir)/gl/m4/limits-h.m4 \ $(top_srcdir)/gl/m4/longlong.m4 $(top_srcdir)/gl/m4/lseek.m4 \ $(top_srcdir)/gl/m4/malloc.m4 \ $(top_srcdir)/gl/m4/manywarnings.m4 \ @@ -154,10 +155,10 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/version-etc.m4 \ $(top_srcdir)/gl/m4/warn-on-use.m4 \ $(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ - $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/m4/gtk-doc.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/m4/update-header-version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -473,6 +474,7 @@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ @@ -489,6 +491,7 @@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ @@ -537,6 +540,7 @@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ @@ -565,6 +569,7 @@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ @@ -577,6 +582,7 @@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ @@ -630,6 +636,7 @@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ @@ -655,6 +662,7 @@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ @@ -694,6 +702,7 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ @@ -723,6 +732,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIMITS_H = @LIMITS_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBINTL = @LTLIBINTL@ @@ -735,6 +745,7 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ @@ -748,6 +759,7 @@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ @@ -841,9 +853,11 @@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ @@ -872,6 +886,7 @@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ @@ -900,13 +915,13 @@ STRIP = @STRIP@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VALGRIND = @VALGRIND@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ -WERROR_CFLAGS = @WERROR_CFLAGS@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ diff --git a/lib/decoding.c b/lib/decoding.c index 2cd9ac3..c2e6027 100644 --- a/lib/decoding.c +++ b/lib/decoding.c @@ -114,7 +114,7 @@ asn1_get_length_der (const unsigned char *der, int der_len, int *len) k = der[0] & 0x7F; punt = 1; if (k) - { /* definite length method */ + { /* definite length method */ ans = 0; while (punt <= k && punt < der_len) { @@ -154,7 +154,7 @@ asn1_get_length_der (const unsigned char *der, int der_len, int *len) * @der_len: Length of DER data to decode. * @cls: Output variable containing decoded class. * @len: Output variable containing the length of the DER TAG data. - * @tag: Output variable containing the decoded tag. + * @tag: Output variable containing the decoded tag (may be %NULL). * * Decode the class and TAG from DER code. * @@ -237,9 +237,9 @@ asn1_get_length_ber (const unsigned char *ber, int ber_len, int *len) long err; ret = asn1_get_length_der (ber, ber_len, len); - if (ret == -1) + if (ret == -1 && ber_len > 1) { /* indefinite length method */ - err = _asn1_get_indefinite_length_string (ber + 1, ber_len, &ret); + err = _asn1_get_indefinite_length_string (ber + 1, ber_len-1, &ret); if (err != ASN1_SUCCESS) return -3; } @@ -1141,8 +1141,8 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, if (result != ASN1_SUCCESS) { warn(); - goto cleanup; - } + goto cleanup; + } DECR_LEN(ider_len, len2); @@ -1186,15 +1186,15 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, dflags |= DECODE_FLAG_INDEFINITE; result = _asn1_decode_simple_ber(type_field (p->type), der+counter, ider_len, &ptmp, &vlen, &ber_len, dflags); - if (result != ASN1_SUCCESS) + if (result != ASN1_SUCCESS) { warn(); goto cleanup; } - DECR_LEN(ider_len, ber_len); + DECR_LEN(ider_len, ber_len); - _asn1_set_value_lv (p, ptmp, vlen); + _asn1_set_value_lv (p, ptmp, vlen); counter += ber_len; free(ptmp); @@ -1434,8 +1434,8 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, if (result != ASN1_SUCCESS) { warn(); - goto cleanup; - } + goto cleanup; + } DECR_LEN(ider_len, len2); _asn1_set_value_lv (p, der + counter, len2); @@ -1470,7 +1470,7 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, if (p) { - p->end = counter - 1; + p->end = counter - 1; } if (p == node && move != DOWN) @@ -2250,8 +2250,8 @@ _asn1_decode_simple_ber (unsigned int etype, const unsigned char *der, if (p[0] == 0 && p[1] == 0) /* EOC */ { if (ber_len) *ber_len += 2; - break; - } + break; + } /* no EOC */ der_len += 2; diff --git a/lib/element.c b/lib/element.c index b7a0905..756e41a 100644 --- a/lib/element.c +++ b/lib/element.c @@ -753,7 +753,8 @@ asn1_write_value (asn1_node node_root, const char *name, * %ASN1_VALUE_NOT_FOUND if there isn't any value for the element * selected, and %ASN1_MEM_ERROR if The value vector isn't big enough * to store the result, and in this case @len will contain the number of - * bytes needed. + * bytes needed. On the occasion that the stored data are of zero-length + * this function may return %ASN1_SUCCESS even if the provided @len is zero. **/ int asn1_read_value (asn1_node root, const char *name, void *ivalue, int *len) @@ -826,7 +827,8 @@ asn1_read_value (asn1_node root, const char *name, void *ivalue, int *len) * %ASN1_VALUE_NOT_FOUND if there isn't any value for the element * selected, and %ASN1_MEM_ERROR if The value vector isn't big enough * to store the result, and in this case @len will contain the number of - * bytes needed. + * bytes needed. On the occasion that the stored data are of zero-length + * this function may return %ASN1_SUCCESS even if the provided @len is zero. **/ int asn1_read_value_type (asn1_node root, const char *name, void *ivalue, @@ -932,7 +934,7 @@ asn1_read_value_type (asn1_node root, const char *name, void *ivalue, { *len = 0; if (value) - value[0] = 0; + value[0] = 0; p = node->down; while (p) { diff --git a/lib/gllib/Makefile.am b/lib/gllib/Makefile.am index 96932d1..d395304 100644 --- a/lib/gllib/Makefile.am +++ b/lib/gllib/Makefile.am @@ -1,6 +1,6 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib/gllib --m4-base=lib/glm4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=lgl --no-vc-files hash-pjw-bare intprops lib-symbol-versions lib-symbol-visibility minmax stdint strverscmp +# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib/gllib --m4-base=lib/glm4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=lgl --no-vc-files hash-pjw-bare intprops lib-symbol-versions lib-symbol-visibility minmax stdint strverscmp AUTOMAKE_OPTIONS = 1.9.6 gnits @@ -82,6 +82,34 @@ AM_CFLAGS += $(CFLAG_VISIBILITY) ## end gnulib module lib-symbol-visibility +## begin gnulib module limits-h + +BUILT_SOURCES += $(LIMITS_H) + +# We need the following in order to create <limits.h> when the system +# doesn't have one that is compatible with GNU. +if GL_GENERATE_LIMITS_H +limits.h: limits.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL_LGL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \ + < $(srcdir)/limits.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +limits.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += limits.h limits.h-t + +EXTRA_DIST += limits.in.h + +## end gnulib module limits-h + ## begin gnulib module minmax libgnu_la_SOURCES += minmax.h @@ -172,6 +200,7 @@ stddef.h: stddef.in.h $(top_builddir)/config.status -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ + -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ < $(srcdir)/stddef.in.h; \ @@ -203,6 +232,7 @@ stdint.h: stdint.in.h $(top_builddir)/config.status -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ + -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ @@ -224,6 +254,7 @@ stdint.h: stdint.in.h $(top_builddir)/config.status -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ + -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ < $(srcdir)/stdint.in.h; \ } > $@-t && \ mv $@-t $@ @@ -371,6 +402,13 @@ EXTRA_DIST += sys_types.in.h ## end gnulib module sys_types +## begin gnulib module verify + + +EXTRA_DIST += verify.h + +## end gnulib module verify + mostlyclean-local: mostlyclean-generic @for dir in '' $(MOSTLYCLEANDIRS); do \ diff --git a/lib/gllib/Makefile.in b/lib/gllib/Makefile.in index d6ecc9d..ba53d4f 100644 --- a/lib/gllib/Makefile.in +++ b/lib/gllib/Makefile.in @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib/gllib --m4-base=lib/glm4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=lgl --no-vc-files hash-pjw-bare intprops lib-symbol-versions lib-symbol-visibility minmax stdint strverscmp +# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib/gllib --m4-base=lib/glm4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=lgl --no-vc-files hash-pjw-bare intprops lib-symbol-versions lib-symbol-visibility minmax stdint strverscmp @@ -136,6 +136,7 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/largefile.m4 \ + $(top_srcdir)/gl/m4/limits-h.m4 \ $(top_srcdir)/gl/m4/longlong.m4 $(top_srcdir)/gl/m4/lseek.m4 \ $(top_srcdir)/gl/m4/malloc.m4 \ $(top_srcdir)/gl/m4/manywarnings.m4 \ @@ -158,10 +159,10 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/version-etc.m4 \ $(top_srcdir)/gl/m4/warn-on-use.m4 \ $(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ - $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/m4/gtk-doc.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/m4/update-header-version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -436,6 +437,7 @@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ @@ -452,6 +454,7 @@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ @@ -500,6 +503,7 @@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ @@ -528,6 +532,7 @@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ @@ -540,6 +545,7 @@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ @@ -593,6 +599,7 @@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ @@ -618,6 +625,7 @@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ @@ -657,6 +665,7 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ @@ -686,6 +695,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIMITS_H = @LIMITS_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBINTL = @LTLIBINTL@ @@ -698,6 +708,7 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ @@ -711,6 +722,7 @@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ @@ -804,9 +816,11 @@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ @@ -835,6 +849,7 @@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ @@ -863,13 +878,13 @@ STRIP = @STRIP@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VALGRIND = @VALGRIND@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ -WERROR_CFLAGS = @WERROR_CFLAGS@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ @@ -943,10 +958,11 @@ SUBDIRS = noinst_HEADERS = noinst_LIBRARIES = noinst_LTLIBRARIES = libgnu.la -EXTRA_DIST = intprops.h $(top_srcdir)/build-aux/snippet/arg-nonnull.h \ +EXTRA_DIST = intprops.h limits.in.h \ + $(top_srcdir)/build-aux/snippet/arg-nonnull.h \ $(top_srcdir)/build-aux/snippet/c++defs.h \ $(top_srcdir)/build-aux/snippet/warn-on-use.h stddef.in.h \ - stdint.in.h string.in.h strverscmp.c sys_types.in.h + stdint.in.h string.in.h strverscmp.c sys_types.in.h verify.h # The BUILT_SOURCES created by this Makefile snippet are not used via #include # statements but through direct file reference. Therefore this snippet must be @@ -957,13 +973,13 @@ EXTRA_DIST = intprops.h $(top_srcdir)/build-aux/snippet/arg-nonnull.h \ # statements but through direct file reference. Therefore this snippet must be # present in all Makefile.am that need it. This is ensured by the applicability # 'all' defined above. -BUILT_SOURCES = arg-nonnull.h c++defs.h warn-on-use.h $(STDDEF_H) \ - $(STDINT_H) string.h sys/types.h +BUILT_SOURCES = $(LIMITS_H) arg-nonnull.h c++defs.h warn-on-use.h \ + $(STDDEF_H) $(STDINT_H) string.h sys/types.h SUFFIXES = -MOSTLYCLEANFILES = core *.stackdump arg-nonnull.h arg-nonnull.h-t \ - c++defs.h c++defs.h-t warn-on-use.h warn-on-use.h-t stddef.h \ - stddef.h-t stdint.h stdint.h-t string.h string.h-t sys/types.h \ - sys/types.h-t +MOSTLYCLEANFILES = core *.stackdump limits.h limits.h-t arg-nonnull.h \ + arg-nonnull.h-t c++defs.h c++defs.h-t warn-on-use.h \ + warn-on-use.h-t stddef.h stddef.h-t stdint.h stdint.h-t \ + string.h string.h-t sys/types.h sys/types.h-t MOSTLYCLEANDIRS = CLEANFILES = DISTCLEANFILES = @@ -1363,6 +1379,22 @@ uninstall-am: .PRECIOUS: Makefile + +# We need the following in order to create <limits.h> when the system +# doesn't have one that is compatible with GNU. +@GL_GENERATE_LIMITS_H_TRUE@limits.h: limits.in.h $(top_builddir)/config.status +@GL_GENERATE_LIMITS_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_LIMITS_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_LIMITS_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL_LGL|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ < $(srcdir)/limits.in.h; \ +@GL_GENERATE_LIMITS_H_TRUE@ } > $@-t && \ +@GL_GENERATE_LIMITS_H_TRUE@ mv $@-t $@ +@GL_GENERATE_LIMITS_H_FALSE@limits.h: $(top_builddir)/config.status +@GL_GENERATE_LIMITS_H_FALSE@ rm -f $@ # The arg-nonnull.h that gets inserted into generated .h files is the same as # build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut # off. @@ -1400,6 +1432,7 @@ warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \ @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ @GL_GENERATE_STDDEF_H_TRUE@ < $(srcdir)/stddef.in.h; \ @@ -1419,6 +1452,7 @@ warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h @GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ @@ -1440,6 +1474,7 @@ warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ @GL_GENERATE_STDINT_H_TRUE@ < $(srcdir)/stdint.in.h; \ @GL_GENERATE_STDINT_H_TRUE@ } > $@-t && \ @GL_GENERATE_STDINT_H_TRUE@ mv $@-t $@ diff --git a/lib/gllib/hash-pjw-bare.c b/lib/gllib/hash-pjw-bare.c index 5634f49..df98147 100644 --- a/lib/gllib/hash-pjw-bare.c +++ b/lib/gllib/hash-pjw-bare.c @@ -1,6 +1,6 @@ /* hash-pjw-bare.c -- compute a hash value from a provided buffer. - Copyright (C) 2012-2014 Free Software Foundation, Inc. + Copyright (C) 2012-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published diff --git a/lib/gllib/hash-pjw-bare.h b/lib/gllib/hash-pjw-bare.h index f4b08fe..7b6d92e 100644 --- a/lib/gllib/hash-pjw-bare.h +++ b/lib/gllib/hash-pjw-bare.h @@ -1,5 +1,5 @@ /* hash-pjw-bare.h -- declaration for a simple hash function - Copyright (C) 2012-2014 Free Software Foundation, Inc. + Copyright (C) 2012-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -20,5 +20,5 @@ and return the hash code. Note that unlike hash_pjw(), it does not return it modulo a table size. The result is platform dependent: it depends on the size of the 'size_t' - type and on the signedness of the 'char' type. */ + type. */ extern size_t hash_pjw_bare (const void *x, size_t n) _GL_ATTRIBUTE_PURE; diff --git a/lib/gllib/intprops.h b/lib/gllib/intprops.h index 6936ad5..eb06b69 100644 --- a/lib/gllib/intprops.h +++ b/lib/gllib/intprops.h @@ -1,10 +1,10 @@ /* intprops.h -- properties of integer types - Copyright (C) 2001-2005, 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2017 Free Software Foundation, Inc. - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -21,9 +21,9 @@ #define _GL_INTPROPS_H #include <limits.h> +#include <verify.h> -/* Return an integer value, converted to the same type as the integer - expression E after integer type promotion. V is the unconverted value. */ +/* Return a value with the common real type of E and V and the value of V. */ #define _GL_INT_CONVERT(e, v) (0 * (e) + (v)) /* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see @@ -37,59 +37,72 @@ an integer. */ #define TYPE_IS_INTEGER(t) ((t) 1.5 == 1) -/* True if negative values of the signed integer type T use two's - complement, ones' complement, or signed magnitude representation, - respectively. Much GNU code assumes two's complement, but some - people like to be portable to all possible C hosts. */ -#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1) -#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0) -#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) - -/* True if the signed integer expression E uses two's complement. */ -#define _GL_INT_TWOS_COMPLEMENT(e) (~ _GL_INT_CONVERT (e, 0) == -1) - -/* True if the arithmetic type T is signed. */ +/* True if the real type T is signed. */ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) -/* Return 1 if the integer expression E, after integer promotion, has - a signed type. */ -#define _GL_INT_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) +/* Return 1 if the real expression E, after promotion, has a + signed or floating type. */ +#define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) -/* Minimum and maximum values for integer types and expressions. These - macros have undefined behavior if T is signed and has padding bits. - If this is a problem for you, please let us know how to fix it for - your host. */ +/* Minimum and maximum values for integer types and expressions. */ + +/* The width in bits of the integer type or expression T. + Padding bits are not supported; this is checked at compile-time below. */ +#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) /* The maximum and minimum values for the integer type T. */ -#define TYPE_MINIMUM(t) \ - ((t) (! TYPE_SIGNED (t) \ - ? (t) 0 \ - : TYPE_SIGNED_MAGNITUDE (t) \ - ? ~ (t) 0 \ - : ~ TYPE_MAXIMUM (t))) +#define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t)) #define TYPE_MAXIMUM(t) \ ((t) (! TYPE_SIGNED (t) \ ? (t) -1 \ - : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) + : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1))) /* The maximum and minimum values for the type of the expression E, after integer promotion. E should not have side effects. */ #define _GL_INT_MINIMUM(e) \ - (_GL_INT_SIGNED (e) \ - ? - _GL_INT_TWOS_COMPLEMENT (e) - _GL_SIGNED_INT_MAXIMUM (e) \ + (EXPR_SIGNED (e) \ + ? ~ _GL_SIGNED_INT_MAXIMUM (e) \ : _GL_INT_CONVERT (e, 0)) #define _GL_INT_MAXIMUM(e) \ - (_GL_INT_SIGNED (e) \ + (EXPR_SIGNED (e) \ ? _GL_SIGNED_INT_MAXIMUM (e) \ : _GL_INT_NEGATE_CONVERT (e, 1)) #define _GL_SIGNED_INT_MAXIMUM(e) \ - (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1) + (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1) +/* Work around OpenVMS incompatibility with C99. */ +#if !defined LLONG_MAX && defined __INT64_MAX +# define LLONG_MAX __INT64_MAX +# define LLONG_MIN __INT64_MIN +#endif + +/* This include file assumes that signed types are two's complement without + padding bits; the above macros have undefined behavior otherwise. + If this is a problem for you, please let us know how to fix it for your host. + As a sanity check, test the assumption for some signed types that + <limits.h> bounds. */ +verify (TYPE_MINIMUM (signed char) == SCHAR_MIN); +verify (TYPE_MAXIMUM (signed char) == SCHAR_MAX); +verify (TYPE_MINIMUM (short int) == SHRT_MIN); +verify (TYPE_MAXIMUM (short int) == SHRT_MAX); +verify (TYPE_MINIMUM (int) == INT_MIN); +verify (TYPE_MAXIMUM (int) == INT_MAX); +verify (TYPE_MINIMUM (long int) == LONG_MIN); +verify (TYPE_MAXIMUM (long int) == LONG_MAX); +#ifdef LLONG_MAX +verify (TYPE_MINIMUM (long long int) == LLONG_MIN); +verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); +#endif +/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined. */ +#ifdef UINT_WIDTH +verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH); +#endif -/* Return 1 if the __typeof__ keyword works. This could be done by +/* Does the __typeof__ keyword work? This could be done by 'configure', but for now it's easier to do it by hand. */ -#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ +#if (2 <= __GNUC__ \ + || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ || (0x5110 <= __SUNPRO_C && !__STDC__)) # define _GL_HAVE___TYPEOF__ 1 #else @@ -118,8 +131,7 @@ signed, this macro may overestimate the true bound by one byte when applied to unsigned types of size 2, 4, 16, ... bytes. */ #define INT_STRLEN_BOUND(t) \ - (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT \ - - _GL_SIGNED_TYPE_OR_EXPR (t)) \ + (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \ + _GL_SIGNED_TYPE_OR_EXPR (t)) /* Bound on buffer size needed to represent an integer type or expression T, @@ -224,24 +236,38 @@ ? (a) < (min) >> (b) \ : (max) >> (b) < (a)) +/* True if __builtin_add_overflow (A, B, P) works when P is non-null. */ +#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__) + +/* True if __builtin_add_overflow_p (A, B, C) works. */ +#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__) /* The _GL*_OVERFLOW macros have the same restrictions as the *_RANGE_OVERFLOW macros, except that they do not assume that operands (e.g., A and B) have the same type as MIN and MAX. Instead, they assume that the result (e.g., A + B) has that type. */ -#define _GL_ADD_OVERFLOW(a, b, min, max) \ - ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \ - : (a) < 0 ? (b) <= (a) + (b) \ - : (b) < 0 ? (a) <= (a) + (b) \ - : (a) + (b) < (b)) -#define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \ - ((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max) \ - : (a) < 0 ? 1 \ - : (b) < 0 ? (a) - (b) <= (a) \ - : (a) < (b)) -#define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \ - (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a)))) \ - || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max)) +#if _GL_HAS_BUILTIN_OVERFLOW_P +# define _GL_ADD_OVERFLOW(a, b, min, max) \ + __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0) +# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \ + __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0) +# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \ + __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0) +#else +# define _GL_ADD_OVERFLOW(a, b, min, max) \ + ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \ + : (a) < 0 ? (b) <= (a) + (b) \ + : (b) < 0 ? (a) <= (a) + (b) \ + : (a) + (b) < (b)) +# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \ + ((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max) \ + : (a) < 0 ? 1 \ + : (b) < 0 ? (a) - (b) <= (a) \ + : (a) < (b)) +# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \ + (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a)))) \ + || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max)) +#endif #define _GL_DIVIDE_OVERFLOW(a, b, min, max) \ ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \ : (a) < 0 ? (b) <= (a) + (b) - 1 \ @@ -263,22 +289,29 @@ : (a) % - (b)) \ == 0) - -/* Integer overflow checks. +/* Check for integer overflow, and report low order bits of answer. The INT_<op>_OVERFLOW macros return 1 if the corresponding C operators might not yield numerically correct answers due to arithmetic overflow. - They work correctly on all known practical hosts, and do not rely + The INT_<op>_WRAPV macros also store the low-order bits of the answer. + These macros work correctly on all known practical hosts, and do not rely on undefined behavior due to signed arithmetic overflow. - Example usage: + Example usage, assuming A and B are long int: - long int i = ...; - long int j = ...; - if (INT_MULTIPLY_OVERFLOW (i, j)) - printf ("multiply would overflow"); + if (INT_MULTIPLY_OVERFLOW (a, b)) + printf ("result would overflow\n"); else - printf ("product is %ld", i * j); + printf ("result is %ld (no overflow)\n", a * b); + + Example usage with WRAPV flavor: + + long int result; + bool overflow = INT_MULTIPLY_WRAPV (a, b, &result); + printf ("result is %ld (%s)\n", result, + overflow ? "after overflow" : "no overflow"); + + Restrictions on these macros: These macros do not check for all possible numerical problems or undefined or unspecified behavior: they do not check for division @@ -287,6 +320,9 @@ These macros may evaluate their arguments zero or multiple times, so the arguments should not have side effects. + The WRAPV macros are not constant expressions. They support only + +, binary -, and *. The result type must be signed. + These macros are tuned for their last argument being a constant. Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B, @@ -296,8 +332,12 @@ _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW) #define INT_SUBTRACT_OVERFLOW(a, b) \ _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW) -#define INT_NEGATE_OVERFLOW(a) \ - INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a)) +#if _GL_HAS_BUILTIN_OVERFLOW_P +# define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a) +#else +# define INT_NEGATE_OVERFLOW(a) \ + INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a)) +#endif #define INT_MULTIPLY_OVERFLOW(a, b) \ _GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW) #define INT_DIVIDE_OVERFLOW(a, b) \ @@ -317,4 +357,102 @@ _GL_INT_MINIMUM (0 * (b) + (a)), \ _GL_INT_MAXIMUM (0 * (b) + (a))) +/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R. + Return 1 if the result overflows. See above for restrictions. */ +#define INT_ADD_WRAPV(a, b, r) \ + _GL_INT_OP_WRAPV (a, b, r, +, __builtin_add_overflow, INT_ADD_OVERFLOW) +#define INT_SUBTRACT_WRAPV(a, b, r) \ + _GL_INT_OP_WRAPV (a, b, r, -, __builtin_sub_overflow, INT_SUBTRACT_OVERFLOW) +#define INT_MULTIPLY_WRAPV(a, b, r) \ + _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW) + +/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See: + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193 + https://llvm.org/bugs/show_bug.cgi?id=25390 + For now, assume all versions of GCC-like compilers generate bogus + warnings for _Generic. This matters only for older compilers that + lack __builtin_add_overflow. */ +#if __GNUC__ +# define _GL__GENERIC_BOGUS 1 +#else +# define _GL__GENERIC_BOGUS 0 +#endif + +/* Store the low-order bits of A <op> B into *R, where OP specifies + the operation. BUILTIN is the builtin operation, and OVERFLOW the + overflow predicate. Return 1 if the result overflows. See above + for restrictions. */ +#if _GL_HAS_BUILTIN_OVERFLOW +# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r) +#elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS +# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \ + (_Generic \ + (*(r), \ + signed char: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned char, \ + signed char, SCHAR_MIN, SCHAR_MAX), \ + short int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned short int, \ + short int, SHRT_MIN, SHRT_MAX), \ + int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + int, INT_MIN, INT_MAX), \ + long int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ + long int, LONG_MIN, LONG_MAX), \ + long long int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ + long long int, LLONG_MIN, LLONG_MAX))) +#else +# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \ + (sizeof *(r) == sizeof (signed char) \ + ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned char, \ + signed char, SCHAR_MIN, SCHAR_MAX) \ + : sizeof *(r) == sizeof (short int) \ + ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned short int, \ + short int, SHRT_MIN, SHRT_MAX) \ + : sizeof *(r) == sizeof (int) \ + ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + int, INT_MIN, INT_MAX) \ + : _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow)) +# ifdef LLONG_MAX +# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ + (sizeof *(r) == sizeof (long int) \ + ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ + long int, LONG_MIN, LONG_MAX) \ + : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ + long long int, LLONG_MIN, LLONG_MAX)) +# else +# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ + long int, LONG_MIN, LONG_MAX) +# endif +#endif + +/* Store the low-order bits of A <op> B into *R, where the operation + is given by OP. Use the unsigned type UT for calculation to avoid + overflow problems. *R's type is T, with extremal values TMIN and + TMAX. T must be a signed integer type. Return 1 if the result + overflows. */ +#define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \ + (sizeof ((a) op (b)) < sizeof (t) \ + ? _GL_INT_OP_CALC1 ((t) (a), (t) (b), r, op, overflow, ut, t, tmin, tmax) \ + : _GL_INT_OP_CALC1 (a, b, r, op, overflow, ut, t, tmin, tmax)) +#define _GL_INT_OP_CALC1(a, b, r, op, overflow, ut, t, tmin, tmax) \ + ((overflow (a, b) \ + || (EXPR_SIGNED ((a) op (b)) && ((a) op (b)) < (tmin)) \ + || (tmax) < ((a) op (b))) \ + ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 1) \ + : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 0)) + +/* Return A <op> B, where the operation is given by OP. Use the + unsigned type UT for calculation to avoid overflow problems. + Convert the result to type T without overflow by subtracting TMIN + from large values before converting, and adding it afterwards. + Compilers can optimize all the operations except OP. */ +#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t, tmin, tmax) \ + (((ut) (a) op (ut) (b)) <= (tmax) \ + ? (t) ((ut) (a) op (ut) (b)) \ + : ((t) (((ut) (a) op (ut) (b)) - (tmin)) + (tmin))) + #endif /* _GL_INTPROPS_H */ diff --git a/lib/gllib/limits.in.h b/lib/gllib/limits.in.h new file mode 100644 index 0000000..02faeb6 --- /dev/null +++ b/lib/gllib/limits.in.h @@ -0,0 +1,63 @@ +/* A GNU-like <limits.h>. + + Copyright 2016-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 2.1, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_LIMITS_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_LIMITS_H@ + +#ifndef _@GUARD_PREFIX@_LIMITS_H +#define _@GUARD_PREFIX@_LIMITS_H + +/* The number of usable bits in an unsigned or signed integer type + with minimum value MIN and maximum value MAX, as an int expression + suitable in #if. Cover all known practical hosts. This + implementation exploits the fact that MAX is 1 less than a power of + 2, and merely counts the number of 1 bits in MAX; "COBn" means + "count the number of 1 bits in the low-order n bits"). */ +#define _GL_INTEGER_WIDTH(min, max) (((min) < 0) + _GL_COB128 (max)) +#define _GL_COB128(n) (_GL_COB64 ((n) >> 31 >> 31 >> 2) + _GL_COB64 (n)) +#define _GL_COB64(n) (_GL_COB32 ((n) >> 31 >> 1) + _GL_COB32 (n)) +#define _GL_COB32(n) (_GL_COB16 ((n) >> 16) + _GL_COB16 (n)) +#define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n)) +#define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n)) +#define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1)) + +/* Macros specified by ISO/IEC TS 18661-1:2014. */ + +#if (! defined ULLONG_WIDTH \ + && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__)) +# define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX) +# define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX) +# define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX) +# define SHRT_WIDTH _GL_INTEGER_WIDTH (SHRT_MIN, SHRT_MAX) +# define USHRT_WIDTH _GL_INTEGER_WIDTH (0, USHRT_MAX) +# define INT_WIDTH _GL_INTEGER_WIDTH (INT_MIN, INT_MAX) +# define UINT_WIDTH _GL_INTEGER_WIDTH (0, UINT_MAX) +# define LONG_WIDTH _GL_INTEGER_WIDTH (LONG_MIN, LONG_MAX) +# define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX) +# define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX) +# define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX) +#endif /* !ULLONG_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */ + +#endif /* _@GUARD_PREFIX@_LIMITS_H */ +#endif /* _@GUARD_PREFIX@_LIMITS_H */ diff --git a/lib/gllib/minmax.h b/lib/gllib/minmax.h index 5a763f8..c5344c4 100644 --- a/lib/gllib/minmax.h +++ b/lib/gllib/minmax.h @@ -1,5 +1,5 @@ /* MIN, MAX macros. - Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2014 Free Software + Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/lib/gllib/stddef.in.h b/lib/gllib/stddef.in.h index ec944fd..c828192 100644 --- a/lib/gllib/stddef.in.h +++ b/lib/gllib/stddef.in.h @@ -1,6 +1,6 @@ /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -39,7 +39,6 @@ # if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T) # ifdef __need_wint_t -# undef _@GUARD_PREFIX@_STDDEF_H # define _GL_STDDEF_WINT_T # endif # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ @@ -54,33 +53,58 @@ # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ -# ifndef _@GUARD_PREFIX@_STDDEF_H -# define _@GUARD_PREFIX@_STDDEF_H - /* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */ -#if @REPLACE_NULL@ -# undef NULL -# ifdef __cplusplus +# if (@REPLACE_NULL@ \ + && (!defined _@GUARD_PREFIX@_STDDEF_H || defined _GL_STDDEF_WINT_T)) +# undef NULL +# ifdef __cplusplus /* ISO C++ says that the macro NULL must expand to an integer constant expression, hence '((void *) 0)' is not allowed in C++. */ -# if __GNUG__ >= 3 +# if __GNUG__ >= 3 /* GNU C++ has a __null macro that behaves like an integer ('int' or 'long') but has the same size as a pointer. Use that, to avoid warnings. */ -# define NULL __null -# else -# define NULL 0L +# define NULL __null +# else +# define NULL 0L +# endif +# else +# define NULL ((void *) 0) +# endif # endif -# else -# define NULL ((void *) 0) -# endif -#endif + +# ifndef _@GUARD_PREFIX@_STDDEF_H +# define _@GUARD_PREFIX@_STDDEF_H /* Some platforms lack wchar_t. */ #if !@HAVE_WCHAR_T@ # define wchar_t int #endif +/* Some platforms lack max_align_t. The check for _GCC_MAX_ALIGN_T is + a hack in case the configure-time test was done with g++ even though + we are currently compiling with gcc. */ +#if ! (@HAVE_MAX_ALIGN_T@ || defined _GCC_MAX_ALIGN_T) +/* On the x86, the maximum storage alignment of double, long, etc. is 4, + but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8, + and the C11 standard allows this. Work around this problem by + using __alignof__ (which returns 8 for double) rather than _Alignof + (which returns 4), and align each union member accordingly. */ +# ifdef __GNUC__ +# define _GL_STDDEF_ALIGNAS(type) \ + __attribute__ ((__aligned__ (__alignof__ (type)))) +# else +# define _GL_STDDEF_ALIGNAS(type) /* */ +# endif +typedef union +{ + char *__p _GL_STDDEF_ALIGNAS (char *); + double __d _GL_STDDEF_ALIGNAS (double); + long double __ld _GL_STDDEF_ALIGNAS (long double); + long int __i _GL_STDDEF_ALIGNAS (long int); +} max_align_t; +#endif + # endif /* _@GUARD_PREFIX@_STDDEF_H */ # endif /* _@GUARD_PREFIX@_STDDEF_H */ #endif /* __need_XXX */ diff --git a/lib/gllib/stdint.in.h b/lib/gllib/stdint.in.h index ef4cf91..1251a92 100644 --- a/lib/gllib/stdint.in.h +++ b/lib/gllib/stdint.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002, 2004-2014 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2017 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. @@ -79,54 +79,60 @@ #if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H #define _@GUARD_PREFIX@_STDINT_H +/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX, + LONG_MIN, LONG_MAX, ULONG_MAX, _GL_INTEGER_WIDTH. */ +#include <limits.h> + +/* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides + wint_t. */ +#if @GNULIB_OVERRIDES_WINT_T@ +# undef WINT_MIN +# undef WINT_MAX +# define WINT_MIN 0x0U +# define WINT_MAX 0xffffffffU +#endif + +#if ! @HAVE_C99_STDINT_H@ + /* <sys/types.h> defines some of the stdint.h types as well, on glibc, IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>). AIX 5.2 <sys/types.h> isn't needed and causes troubles. Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but relies on the system <stdint.h> definitions, so include <sys/types.h> after @NEXT_STDINT_H@. */ -#if @HAVE_SYS_TYPES_H@ && ! defined _AIX -# include <sys/types.h> -#endif - -/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX, - LONG_MIN, LONG_MAX, ULONG_MAX. */ -#include <limits.h> +# if @HAVE_SYS_TYPES_H@ && ! defined _AIX +# include <sys/types.h> +# endif -#if @HAVE_INTTYPES_H@ +# if @HAVE_INTTYPES_H@ /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. <inttypes.h> also defines intptr_t and uintptr_t. */ -# include <inttypes.h> -#elif @HAVE_SYS_INTTYPES_H@ +# include <inttypes.h> +# elif @HAVE_SYS_INTTYPES_H@ /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ -# include <sys/inttypes.h> -#endif +# include <sys/inttypes.h> +# endif -#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ +# if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is included by <sys/types.h>. */ -# include <sys/bitypes.h> -#endif +# include <sys/bitypes.h> +# endif -#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H +# undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H /* Minimum and maximum values for an integer type under the usual assumption. Return an unspecified value if BITS == 0, adding a check to pacify picky compilers. */ -#define _STDINT_MIN(signed, bits, zero) \ - ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero)) +# define _STDINT_MIN(signed, bits, zero) \ + ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero)) -#define _STDINT_MAX(signed, bits, zero) \ - ((signed) \ - ? ~ _STDINT_MIN (signed, bits, zero) \ - : /* The expression for the unsigned case. The subtraction of (signed) \ - is a nop in the unsigned case and avoids "signed integer overflow" \ - warnings in the signed case. */ \ - ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) +# define _STDINT_MAX(signed, bits, zero) \ + (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) #if !GNULIB_defined_stdint_types @@ -135,26 +141,26 @@ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. */ -#undef int8_t -#undef uint8_t +# undef int8_t +# undef uint8_t typedef signed char gl_int8_t; typedef unsigned char gl_uint8_t; -#define int8_t gl_int8_t -#define uint8_t gl_uint8_t +# define int8_t gl_int8_t +# define uint8_t gl_uint8_t -#undef int16_t -#undef uint16_t +# undef int16_t +# undef uint16_t typedef short int gl_int16_t; typedef unsigned short int gl_uint16_t; -#define int16_t gl_int16_t -#define uint16_t gl_uint16_t +# define int16_t gl_int16_t +# define uint16_t gl_uint16_t -#undef int32_t -#undef uint32_t +# undef int32_t +# undef uint32_t typedef int gl_int32_t; typedef unsigned int gl_uint32_t; -#define int32_t gl_int32_t -#define uint32_t gl_uint32_t +# define int32_t gl_int32_t +# define uint32_t gl_uint32_t /* If the system defines INT64_MAX, assume int64_t works. That way, if the underlying platform defines int64_t to be a 64-bit long long @@ -162,54 +168,54 @@ typedef unsigned int gl_uint32_t; int, which would mess up C++ name mangling. We must use #ifdef rather than #if, to avoid an error with HP-UX 10.20 cc. */ -#ifdef INT64_MAX -# define GL_INT64_T -#else +# ifdef INT64_MAX +# define GL_INT64_T +# else /* Do not undefine int64_t if gnulib is not being used with 64-bit types, since otherwise it breaks platforms like Tandem/NSK. */ -# if LONG_MAX >> 31 >> 31 == 1 -# undef int64_t +# if LONG_MAX >> 31 >> 31 == 1 +# undef int64_t typedef long int gl_int64_t; -# define int64_t gl_int64_t -# define GL_INT64_T -# elif defined _MSC_VER -# undef int64_t +# define int64_t gl_int64_t +# define GL_INT64_T +# elif defined _MSC_VER +# undef int64_t typedef __int64 gl_int64_t; -# define int64_t gl_int64_t -# define GL_INT64_T -# elif @HAVE_LONG_LONG_INT@ -# undef int64_t +# define int64_t gl_int64_t +# define GL_INT64_T +# elif @HAVE_LONG_LONG_INT@ +# undef int64_t typedef long long int gl_int64_t; -# define int64_t gl_int64_t -# define GL_INT64_T +# define int64_t gl_int64_t +# define GL_INT64_T +# endif # endif -#endif -#ifdef UINT64_MAX -# define GL_UINT64_T -#else -# if ULONG_MAX >> 31 >> 31 >> 1 == 1 -# undef uint64_t -typedef unsigned long int gl_uint64_t; -# define uint64_t gl_uint64_t +# ifdef UINT64_MAX # define GL_UINT64_T -# elif defined _MSC_VER -# undef uint64_t +# else +# if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# undef uint64_t +typedef unsigned long int gl_uint64_t; +# define uint64_t gl_uint64_t +# define GL_UINT64_T +# elif defined _MSC_VER +# undef uint64_t typedef unsigned __int64 gl_uint64_t; -# define uint64_t gl_uint64_t -# define GL_UINT64_T -# elif @HAVE_UNSIGNED_LONG_LONG_INT@ -# undef uint64_t +# define uint64_t gl_uint64_t +# define GL_UINT64_T +# elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# undef uint64_t typedef unsigned long long int gl_uint64_t; -# define uint64_t gl_uint64_t -# define GL_UINT64_T +# define uint64_t gl_uint64_t +# define GL_UINT64_T +# endif # endif -#endif /* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */ -#define _UINT8_T -#define _UINT32_T -#define _UINT64_T +# define _UINT8_T +# define _UINT32_T +# define _UINT64_T /* 7.18.1.2. Minimum-width integer types */ @@ -218,26 +224,26 @@ typedef unsigned long long int gl_uint64_t; types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types are the same as the corresponding N_t types. */ -#undef int_least8_t -#undef uint_least8_t -#undef int_least16_t -#undef uint_least16_t -#undef int_least32_t -#undef uint_least32_t -#undef int_least64_t -#undef uint_least64_t -#define int_least8_t int8_t -#define uint_least8_t uint8_t -#define int_least16_t int16_t -#define uint_least16_t uint16_t -#define int_least32_t int32_t -#define uint_least32_t uint32_t -#ifdef GL_INT64_T -# define int_least64_t int64_t -#endif -#ifdef GL_UINT64_T -# define uint_least64_t uint64_t -#endif +# undef int_least8_t +# undef uint_least8_t +# undef int_least16_t +# undef uint_least16_t +# undef int_least32_t +# undef uint_least32_t +# undef int_least64_t +# undef uint_least64_t +# define int_least8_t int8_t +# define uint_least8_t uint8_t +# define int_least16_t int16_t +# define uint_least16_t uint16_t +# define int_least32_t int32_t +# define uint_least32_t uint32_t +# ifdef GL_INT64_T +# define int_least64_t int64_t +# endif +# ifdef GL_UINT64_T +# define uint_least64_t uint64_t +# endif /* 7.18.1.3. Fastest minimum-width integer types */ @@ -250,50 +256,55 @@ typedef unsigned long long int gl_uint64_t; uses types consistent with glibc, as that lessens the chance of incompatibility with older GNU hosts. */ -#undef int_fast8_t -#undef uint_fast8_t -#undef int_fast16_t -#undef uint_fast16_t -#undef int_fast32_t -#undef uint_fast32_t -#undef int_fast64_t -#undef uint_fast64_t +# undef int_fast8_t +# undef uint_fast8_t +# undef int_fast16_t +# undef uint_fast16_t +# undef int_fast32_t +# undef uint_fast32_t +# undef int_fast64_t +# undef uint_fast64_t typedef signed char gl_int_fast8_t; typedef unsigned char gl_uint_fast8_t; -#ifdef __sun +# ifdef __sun /* Define types compatible with SunOS 5.10, so that code compiled under earlier SunOS versions works with code compiled under SunOS 5.10. */ typedef int gl_int_fast32_t; typedef unsigned int gl_uint_fast32_t; -#else +# else typedef long int gl_int_fast32_t; typedef unsigned long int gl_uint_fast32_t; -#endif +# endif typedef gl_int_fast32_t gl_int_fast16_t; typedef gl_uint_fast32_t gl_uint_fast16_t; -#define int_fast8_t gl_int_fast8_t -#define uint_fast8_t gl_uint_fast8_t -#define int_fast16_t gl_int_fast16_t -#define uint_fast16_t gl_uint_fast16_t -#define int_fast32_t gl_int_fast32_t -#define uint_fast32_t gl_uint_fast32_t -#ifdef GL_INT64_T -# define int_fast64_t int64_t -#endif -#ifdef GL_UINT64_T -# define uint_fast64_t uint64_t -#endif +# define int_fast8_t gl_int_fast8_t +# define uint_fast8_t gl_uint_fast8_t +# define int_fast16_t gl_int_fast16_t +# define uint_fast16_t gl_uint_fast16_t +# define int_fast32_t gl_int_fast32_t +# define uint_fast32_t gl_uint_fast32_t +# ifdef GL_INT64_T +# define int_fast64_t int64_t +# endif +# ifdef GL_UINT64_T +# define uint_fast64_t uint64_t +# endif /* 7.18.1.4. Integer types capable of holding object pointers */ -#undef intptr_t -#undef uintptr_t +/* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own + definitions of intptr_t and uintptr_t (which use int and unsigned) + to avoid clashes with declarations of system functions like sbrk. */ +# ifndef _INTPTR_T_DECLARED +# undef intptr_t +# undef uintptr_t typedef long int gl_intptr_t; typedef unsigned long int gl_uintptr_t; -#define intptr_t gl_intptr_t -#define uintptr_t gl_uintptr_t +# define intptr_t gl_intptr_t +# define uintptr_t gl_uintptr_t +# endif /* 7.18.1.5. Greatest-width integer types */ @@ -304,33 +315,33 @@ typedef unsigned long int gl_uintptr_t; similarly for UINTMAX_MAX and uintmax_t. This avoids problems with assuming one type where another is used by the system. */ -#ifndef INTMAX_MAX -# undef INTMAX_C -# undef intmax_t -# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# ifndef INTMAX_MAX +# undef INTMAX_C +# undef intmax_t +# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 typedef long long int gl_intmax_t; -# define intmax_t gl_intmax_t -# elif defined GL_INT64_T -# define intmax_t int64_t -# else +# define intmax_t gl_intmax_t +# elif defined GL_INT64_T +# define intmax_t int64_t +# else typedef long int gl_intmax_t; -# define intmax_t gl_intmax_t +# define intmax_t gl_intmax_t +# endif # endif -#endif -#ifndef UINTMAX_MAX -# undef UINTMAX_C -# undef uintmax_t -# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# ifndef UINTMAX_MAX +# undef UINTMAX_C +# undef uintmax_t +# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 typedef unsigned long long int gl_uintmax_t; -# define uintmax_t gl_uintmax_t -# elif defined GL_UINT64_T -# define uintmax_t uint64_t -# else +# define uintmax_t gl_uintmax_t +# elif defined GL_UINT64_T +# define uintmax_t uint64_t +# else typedef unsigned long int gl_uintmax_t; -# define uintmax_t gl_uintmax_t +# define uintmax_t gl_uintmax_t +# endif # endif -#endif /* Verify that intmax_t and uintmax_t have the same size. Too much code breaks if this is not the case. If this check fails, the reason is likely @@ -338,8 +349,8 @@ typedef unsigned long int gl_uintmax_t; typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) ? 1 : -1]; -#define GNULIB_defined_stdint_types 1 -#endif /* !GNULIB_defined_stdint_types */ +# define GNULIB_defined_stdint_types 1 +# endif /* !GNULIB_defined_stdint_types */ /* 7.18.2. Limits of specified-width integer types */ @@ -348,37 +359,37 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. */ -#undef INT8_MIN -#undef INT8_MAX -#undef UINT8_MAX -#define INT8_MIN (~ INT8_MAX) -#define INT8_MAX 127 -#define UINT8_MAX 255 - -#undef INT16_MIN -#undef INT16_MAX -#undef UINT16_MAX -#define INT16_MIN (~ INT16_MAX) -#define INT16_MAX 32767 -#define UINT16_MAX 65535 - -#undef INT32_MIN -#undef INT32_MAX -#undef UINT32_MAX -#define INT32_MIN (~ INT32_MAX) -#define INT32_MAX 2147483647 -#define UINT32_MAX 4294967295U - -#if defined GL_INT64_T && ! defined INT64_MAX +# undef INT8_MIN +# undef INT8_MAX +# undef UINT8_MAX +# define INT8_MIN (~ INT8_MAX) +# define INT8_MAX 127 +# define UINT8_MAX 255 + +# undef INT16_MIN +# undef INT16_MAX +# undef UINT16_MAX +# define INT16_MIN (~ INT16_MAX) +# define INT16_MAX 32767 +# define UINT16_MAX 65535 + +# undef INT32_MIN +# undef INT32_MAX +# undef UINT32_MAX +# define INT32_MIN (~ INT32_MAX) +# define INT32_MAX 2147483647 +# define UINT32_MAX 4294967295U + +# if defined GL_INT64_T && ! defined INT64_MAX /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0 evaluates the latter incorrectly in preprocessor expressions. */ -# define INT64_MIN (- INTMAX_C (1) << 63) -# define INT64_MAX INTMAX_C (9223372036854775807) -#endif +# define INT64_MIN (- INTMAX_C (1) << 63) +# define INT64_MAX INTMAX_C (9223372036854775807) +# endif -#if defined GL_UINT64_T && ! defined UINT64_MAX -# define UINT64_MAX UINTMAX_C (18446744073709551615) -#endif +# if defined GL_UINT64_T && ! defined UINT64_MAX +# define UINT64_MAX UINTMAX_C (18446744073709551615) +# endif /* 7.18.2.2. Limits of minimum-width integer types */ @@ -386,38 +397,38 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types are the same as the corresponding N_t types. */ -#undef INT_LEAST8_MIN -#undef INT_LEAST8_MAX -#undef UINT_LEAST8_MAX -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST8_MAX INT8_MAX -#define UINT_LEAST8_MAX UINT8_MAX - -#undef INT_LEAST16_MIN -#undef INT_LEAST16_MAX -#undef UINT_LEAST16_MAX -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST16_MAX INT16_MAX -#define UINT_LEAST16_MAX UINT16_MAX - -#undef INT_LEAST32_MIN -#undef INT_LEAST32_MAX -#undef UINT_LEAST32_MAX -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST32_MAX INT32_MAX -#define UINT_LEAST32_MAX UINT32_MAX - -#undef INT_LEAST64_MIN -#undef INT_LEAST64_MAX -#ifdef GL_INT64_T -# define INT_LEAST64_MIN INT64_MIN -# define INT_LEAST64_MAX INT64_MAX -#endif +# undef INT_LEAST8_MIN +# undef INT_LEAST8_MAX +# undef UINT_LEAST8_MAX +# define INT_LEAST8_MIN INT8_MIN +# define INT_LEAST8_MAX INT8_MAX +# define UINT_LEAST8_MAX UINT8_MAX + +# undef INT_LEAST16_MIN +# undef INT_LEAST16_MAX +# undef UINT_LEAST16_MAX +# define INT_LEAST16_MIN INT16_MIN +# define INT_LEAST16_MAX INT16_MAX +# define UINT_LEAST16_MAX UINT16_MAX + +# undef INT_LEAST32_MIN +# undef INT_LEAST32_MAX +# undef UINT_LEAST32_MAX +# define INT_LEAST32_MIN INT32_MIN +# define INT_LEAST32_MAX INT32_MAX +# define UINT_LEAST32_MAX UINT32_MAX + +# undef INT_LEAST64_MIN +# undef INT_LEAST64_MAX +# ifdef GL_INT64_T +# define INT_LEAST64_MIN INT64_MIN +# define INT_LEAST64_MAX INT64_MAX +# endif -#undef UINT_LEAST64_MAX -#ifdef GL_UINT64_T -# define UINT_LEAST64_MAX UINT64_MAX -#endif +# undef UINT_LEAST64_MAX +# ifdef GL_UINT64_T +# define UINT_LEAST64_MAX UINT64_MAX +# endif /* 7.18.2.3. Limits of fastest minimum-width integer types */ @@ -425,117 +436,117 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types are taken from the same list of types. */ -#undef INT_FAST8_MIN -#undef INT_FAST8_MAX -#undef UINT_FAST8_MAX -#define INT_FAST8_MIN SCHAR_MIN -#define INT_FAST8_MAX SCHAR_MAX -#define UINT_FAST8_MAX UCHAR_MAX - -#undef INT_FAST16_MIN -#undef INT_FAST16_MAX -#undef UINT_FAST16_MAX -#define INT_FAST16_MIN INT_FAST32_MIN -#define INT_FAST16_MAX INT_FAST32_MAX -#define UINT_FAST16_MAX UINT_FAST32_MAX - -#undef INT_FAST32_MIN -#undef INT_FAST32_MAX -#undef UINT_FAST32_MAX -#ifdef __sun -# define INT_FAST32_MIN INT_MIN -# define INT_FAST32_MAX INT_MAX -# define UINT_FAST32_MAX UINT_MAX -#else -# define INT_FAST32_MIN LONG_MIN -# define INT_FAST32_MAX LONG_MAX -# define UINT_FAST32_MAX ULONG_MAX -#endif +# undef INT_FAST8_MIN +# undef INT_FAST8_MAX +# undef UINT_FAST8_MAX +# define INT_FAST8_MIN SCHAR_MIN +# define INT_FAST8_MAX SCHAR_MAX +# define UINT_FAST8_MAX UCHAR_MAX + +# undef INT_FAST16_MIN +# undef INT_FAST16_MAX +# undef UINT_FAST16_MAX +# define INT_FAST16_MIN INT_FAST32_MIN +# define INT_FAST16_MAX INT_FAST32_MAX +# define UINT_FAST16_MAX UINT_FAST32_MAX + +# undef INT_FAST32_MIN +# undef INT_FAST32_MAX +# undef UINT_FAST32_MAX +# ifdef __sun +# define INT_FAST32_MIN INT_MIN +# define INT_FAST32_MAX INT_MAX +# define UINT_FAST32_MAX UINT_MAX +# else +# define INT_FAST32_MIN LONG_MIN +# define INT_FAST32_MAX LONG_MAX +# define UINT_FAST32_MAX ULONG_MAX +# endif -#undef INT_FAST64_MIN -#undef INT_FAST64_MAX -#ifdef GL_INT64_T -# define INT_FAST64_MIN INT64_MIN -# define INT_FAST64_MAX INT64_MAX -#endif +# undef INT_FAST64_MIN +# undef INT_FAST64_MAX +# ifdef GL_INT64_T +# define INT_FAST64_MIN INT64_MIN +# define INT_FAST64_MAX INT64_MAX +# endif -#undef UINT_FAST64_MAX -#ifdef GL_UINT64_T -# define UINT_FAST64_MAX UINT64_MAX -#endif +# undef UINT_FAST64_MAX +# ifdef GL_UINT64_T +# define UINT_FAST64_MAX UINT64_MAX +# endif /* 7.18.2.4. Limits of integer types capable of holding object pointers */ -#undef INTPTR_MIN -#undef INTPTR_MAX -#undef UINTPTR_MAX -#define INTPTR_MIN LONG_MIN -#define INTPTR_MAX LONG_MAX -#define UINTPTR_MAX ULONG_MAX +# undef INTPTR_MIN +# undef INTPTR_MAX +# undef UINTPTR_MAX +# define INTPTR_MIN LONG_MIN +# define INTPTR_MAX LONG_MAX +# define UINTPTR_MAX ULONG_MAX /* 7.18.2.5. Limits of greatest-width integer types */ -#ifndef INTMAX_MAX -# undef INTMAX_MIN -# ifdef INT64_MAX -# define INTMAX_MIN INT64_MIN -# define INTMAX_MAX INT64_MAX -# else -# define INTMAX_MIN INT32_MIN -# define INTMAX_MAX INT32_MAX +# ifndef INTMAX_MAX +# undef INTMAX_MIN +# ifdef INT64_MAX +# define INTMAX_MIN INT64_MIN +# define INTMAX_MAX INT64_MAX +# else +# define INTMAX_MIN INT32_MIN +# define INTMAX_MAX INT32_MAX +# endif # endif -#endif -#ifndef UINTMAX_MAX -# ifdef UINT64_MAX -# define UINTMAX_MAX UINT64_MAX -# else -# define UINTMAX_MAX UINT32_MAX +# ifndef UINTMAX_MAX +# ifdef UINT64_MAX +# define UINTMAX_MAX UINT64_MAX +# else +# define UINTMAX_MAX UINT32_MAX +# endif # endif -#endif /* 7.18.3. Limits of other integer types */ /* ptrdiff_t limits */ -#undef PTRDIFF_MIN -#undef PTRDIFF_MAX -#if @APPLE_UNIVERSAL_BUILD@ -# ifdef _LP64 -# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l) -# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) +# undef PTRDIFF_MIN +# undef PTRDIFF_MAX +# if @APPLE_UNIVERSAL_BUILD@ +# ifdef _LP64 +# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l) +# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) +# else +# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0) +# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) +# endif # else -# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0) -# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) -# endif -#else -# define PTRDIFF_MIN \ +# define PTRDIFF_MIN \ _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) -# define PTRDIFF_MAX \ +# define PTRDIFF_MAX \ _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) -#endif +# endif /* sig_atomic_t limits */ -#undef SIG_ATOMIC_MIN -#undef SIG_ATOMIC_MAX -#define SIG_ATOMIC_MIN \ +# undef SIG_ATOMIC_MIN +# undef SIG_ATOMIC_MAX +# define SIG_ATOMIC_MIN \ _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ 0@SIG_ATOMIC_T_SUFFIX@) -#define SIG_ATOMIC_MAX \ +# define SIG_ATOMIC_MAX \ _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ 0@SIG_ATOMIC_T_SUFFIX@) /* size_t limit */ -#undef SIZE_MAX -#if @APPLE_UNIVERSAL_BUILD@ -# ifdef _LP64 -# define SIZE_MAX _STDINT_MAX (0, 64, 0ul) +# undef SIZE_MAX +# if @APPLE_UNIVERSAL_BUILD@ +# ifdef _LP64 +# define SIZE_MAX _STDINT_MAX (0, 64, 0ul) +# else +# define SIZE_MAX _STDINT_MAX (0, 32, 0ul) +# endif # else -# define SIZE_MAX _STDINT_MAX (0, 32, 0ul) +# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) # endif -#else -# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) -#endif /* wchar_t limits */ /* Get WCHAR_MIN, WCHAR_MAX. @@ -543,29 +554,29 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) sequence of nested includes <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes <stdint.h> and assumes its types are already defined. */ -#if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) +# if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included before <wchar.h>. */ -# include <stddef.h> -# include <stdio.h> -# include <time.h> -# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H -# include <wchar.h> -# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H -#endif -#undef WCHAR_MIN -#undef WCHAR_MAX -#define WCHAR_MIN \ +# include <stddef.h> +# include <stdio.h> +# include <time.h> +# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +# include <wchar.h> +# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +# endif +# undef WCHAR_MIN +# undef WCHAR_MAX +# define WCHAR_MIN \ _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) -#define WCHAR_MAX \ +# define WCHAR_MAX \ _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) /* wint_t limits */ -#undef WINT_MIN -#undef WINT_MAX -#define WINT_MIN \ +# undef WINT_MIN +# undef WINT_MAX +# define WINT_MIN \ _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) -#define WINT_MAX \ +# define WINT_MAX \ _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) /* 7.18.4. Macros for integer constants */ @@ -576,59 +587,120 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */ -#undef INT8_C -#undef UINT8_C -#define INT8_C(x) x -#define UINT8_C(x) x - -#undef INT16_C -#undef UINT16_C -#define INT16_C(x) x -#define UINT16_C(x) x - -#undef INT32_C -#undef UINT32_C -#define INT32_C(x) x -#define UINT32_C(x) x ## U - -#undef INT64_C -#undef UINT64_C -#if LONG_MAX >> 31 >> 31 == 1 -# define INT64_C(x) x##L -#elif defined _MSC_VER -# define INT64_C(x) x##i64 -#elif @HAVE_LONG_LONG_INT@ -# define INT64_C(x) x##LL -#endif -#if ULONG_MAX >> 31 >> 31 >> 1 == 1 -# define UINT64_C(x) x##UL -#elif defined _MSC_VER -# define UINT64_C(x) x##ui64 -#elif @HAVE_UNSIGNED_LONG_LONG_INT@ -# define UINT64_C(x) x##ULL -#endif +# undef INT8_C +# undef UINT8_C +# define INT8_C(x) x +# define UINT8_C(x) x + +# undef INT16_C +# undef UINT16_C +# define INT16_C(x) x +# define UINT16_C(x) x + +# undef INT32_C +# undef UINT32_C +# define INT32_C(x) x +# define UINT32_C(x) x ## U + +# undef INT64_C +# undef UINT64_C +# if LONG_MAX >> 31 >> 31 == 1 +# define INT64_C(x) x##L +# elif defined _MSC_VER +# define INT64_C(x) x##i64 +# elif @HAVE_LONG_LONG_INT@ +# define INT64_C(x) x##LL +# endif +# if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# define UINT64_C(x) x##UL +# elif defined _MSC_VER +# define UINT64_C(x) x##ui64 +# elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# define UINT64_C(x) x##ULL +# endif /* 7.18.4.2. Macros for greatest-width integer constants */ -#ifndef INTMAX_C -# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define INTMAX_C(x) x##LL -# elif defined GL_INT64_T -# define INTMAX_C(x) INT64_C(x) -# else -# define INTMAX_C(x) x##L +# ifndef INTMAX_C +# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# define INTMAX_C(x) x##LL +# elif defined GL_INT64_T +# define INTMAX_C(x) INT64_C(x) +# else +# define INTMAX_C(x) x##L +# endif # endif -#endif -#ifndef UINTMAX_C -# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 -# define UINTMAX_C(x) x##ULL -# elif defined GL_UINT64_T -# define UINTMAX_C(x) UINT64_C(x) -# else -# define UINTMAX_C(x) x##UL +# ifndef UINTMAX_C +# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define UINTMAX_C(x) x##ULL +# elif defined GL_UINT64_T +# define UINTMAX_C(x) UINT64_C(x) +# else +# define UINTMAX_C(x) x##UL +# endif # endif -#endif + +#endif /* !@HAVE_C99_STDINT_H@ */ + +/* Macros specified by ISO/IEC TS 18661-1:2014. */ + +#if (!defined UINTMAX_WIDTH \ + && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__)) +# ifdef INT8_MAX +# define INT8_WIDTH _GL_INTEGER_WIDTH (INT8_MIN, INT8_MAX) +# endif +# ifdef UINT8_MAX +# define UINT8_WIDTH _GL_INTEGER_WIDTH (0, UINT8_MAX) +# endif +# ifdef INT16_MAX +# define INT16_WIDTH _GL_INTEGER_WIDTH (INT16_MIN, INT16_MAX) +# endif +# ifdef UINT16_MAX +# define UINT16_WIDTH _GL_INTEGER_WIDTH (0, UINT16_MAX) +# endif +# ifdef INT32_MAX +# define INT32_WIDTH _GL_INTEGER_WIDTH (INT32_MIN, INT32_MAX) +# endif +# ifdef UINT32_MAX +# define UINT32_WIDTH _GL_INTEGER_WIDTH (0, UINT32_MAX) +# endif +# ifdef INT64_MAX +# define INT64_WIDTH _GL_INTEGER_WIDTH (INT64_MIN, INT64_MAX) +# endif +# ifdef UINT64_MAX +# define UINT64_WIDTH _GL_INTEGER_WIDTH (0, UINT64_MAX) +# endif +# define INT_LEAST8_WIDTH _GL_INTEGER_WIDTH (INT_LEAST8_MIN, INT_LEAST8_MAX) +# define UINT_LEAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST8_MAX) +# define INT_LEAST16_WIDTH _GL_INTEGER_WIDTH (INT_LEAST16_MIN, INT_LEAST16_MAX) +# define UINT_LEAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST16_MAX) +# define INT_LEAST32_WIDTH _GL_INTEGER_WIDTH (INT_LEAST32_MIN, INT_LEAST32_MAX) +# define UINT_LEAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST32_MAX) +# define INT_LEAST64_WIDTH _GL_INTEGER_WIDTH (INT_LEAST64_MIN, INT_LEAST64_MAX) +# define UINT_LEAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST64_MAX) +# define INT_FAST8_WIDTH _GL_INTEGER_WIDTH (INT_FAST8_MIN, INT_FAST8_MAX) +# define UINT_FAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST8_MAX) +# define INT_FAST16_WIDTH _GL_INTEGER_WIDTH (INT_FAST16_MIN, INT_FAST16_MAX) +# define UINT_FAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST16_MAX) +# define INT_FAST32_WIDTH _GL_INTEGER_WIDTH (INT_FAST32_MIN, INT_FAST32_MAX) +# define UINT_FAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST32_MAX) +# define INT_FAST64_WIDTH _GL_INTEGER_WIDTH (INT_FAST64_MIN, INT_FAST64_MAX) +# define UINT_FAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST64_MAX) +# define INTPTR_WIDTH _GL_INTEGER_WIDTH (INTPTR_MIN, INTPTR_MAX) +# define UINTPTR_WIDTH _GL_INTEGER_WIDTH (0, UINTPTR_MAX) +# define INTMAX_WIDTH _GL_INTEGER_WIDTH (INTMAX_MIN, INTMAX_MAX) +# define UINTMAX_WIDTH _GL_INTEGER_WIDTH (0, UINTMAX_MAX) +# define PTRDIFF_WIDTH _GL_INTEGER_WIDTH (PTRDIFF_MIN, PTRDIFF_MAX) +# define SIZE_WIDTH _GL_INTEGER_WIDTH (0, SIZE_MAX) +# define WCHAR_WIDTH _GL_INTEGER_WIDTH (WCHAR_MIN, WCHAR_MAX) +# ifdef WINT_MAX +# define WINT_WIDTH _GL_INTEGER_WIDTH (WINT_MIN, WINT_MAX) +# endif +# ifdef SIG_ATOMIC_MAX +# define SIG_ATOMIC_WIDTH _GL_INTEGER_WIDTH (SIG_ATOMIC_MIN, SIG_ATOMIC_MAX) +# endif +#endif /* !WINT_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */ #endif /* _@GUARD_PREFIX@_STDINT_H */ #endif /* !(defined __ANDROID__ && ...) */ diff --git a/lib/gllib/string.in.h b/lib/gllib/string.in.h index 1d063ba..259ccdf 100644 --- a/lib/gllib/string.in.h +++ b/lib/gllib/string.in.h @@ -1,6 +1,6 @@ /* A GNU-like <string.h>. - Copyright (C) 1995-1996, 2001-2014 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 2001-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -15,16 +15,32 @@ You should have received a copy of the GNU Lesser General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef _@GUARD_PREFIX@_STRING_H - #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif @PRAGMA_COLUMNS@ +#if defined _GL_ALREADY_INCLUDING_STRING_H +/* Special invocation convention: + - On OS X/NetBSD we have a sequence of nested includes + <string.h> -> <strings.h> -> "string.h" + In this situation system _chk variants due to -D_FORTIFY_SOURCE + might be used after any replacements defined here. */ + +#@INCLUDE_NEXT@ @NEXT_STRING_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_STRING_H + +#define _GL_ALREADY_INCLUDING_STRING_H + /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_STRING_H@ +#undef _GL_ALREADY_INCLUDING_STRING_H + #ifndef _@GUARD_PREFIX@_STRING_H #define _@GUARD_PREFIX@_STRING_H @@ -400,15 +416,15 @@ _GL_WARN_ON_USE (strncat, "strncat is unportable - " # undef strndup # define strndup rpl_strndup # endif -_GL_FUNCDECL_RPL (strndup, char *, (char const *__string, size_t __n) +_GL_FUNCDECL_RPL (strndup, char *, (char const *__s, size_t __n) _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (strndup, char *, (char const *__string, size_t __n)); +_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); # else # if ! @HAVE_DECL_STRNDUP@ -_GL_FUNCDECL_SYS (strndup, char *, (char const *__string, size_t __n) +_GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n) _GL_ARG_NONNULL ((1))); # endif -_GL_CXXALIAS_SYS (strndup, char *, (char const *__string, size_t __n)); +_GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n)); # endif _GL_CXXALIASWARN (strndup); #elif defined GNULIB_POSIXCHECK @@ -428,17 +444,17 @@ _GL_WARN_ON_USE (strndup, "strndup is unportable - " # undef strnlen # define strnlen rpl_strnlen # endif -_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__string, size_t __maxlen) +_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen) _GL_ATTRIBUTE_PURE _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen)); +_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__s, size_t __maxlen)); # else # if ! @HAVE_DECL_STRNLEN@ -_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen) +_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen) _GL_ATTRIBUTE_PURE _GL_ARG_NONNULL ((1))); # endif -_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)); +_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__s, size_t __maxlen)); # endif _GL_CXXALIASWARN (strnlen); #elif defined GNULIB_POSIXCHECK @@ -1027,3 +1043,4 @@ _GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - " #endif /* _@GUARD_PREFIX@_STRING_H */ #endif /* _@GUARD_PREFIX@_STRING_H */ +#endif diff --git a/lib/gllib/strverscmp.c b/lib/gllib/strverscmp.c index 0abc1fe..0d8ac1c 100644 --- a/lib/gllib/strverscmp.c +++ b/lib/gllib/strverscmp.c @@ -1,21 +1,21 @@ /* Compare strings while treating digits characters numerically. - Copyright (C) 1997, 2000, 2002, 2004, 2006, 2009-2014 Free Software - Foundation, Inc. + Copyright (C) 1997-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1, or (at your option) - any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public License along - with this program; if not, see <http://www.gnu.org/licenses/>. */ + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #if !_LIBC # include <config.h> @@ -26,27 +26,14 @@ /* states: S_N: normal, S_I: comparing integral part, S_F: comparing fractional parts, S_Z: idem but with leading Zeroes only */ -#define S_N 0x0 -#define S_I 0x4 -#define S_F 0x8 -#define S_Z 0xC +#define S_N 0x0 +#define S_I 0x3 +#define S_F 0x6 +#define S_Z 0x9 /* result_type: CMP: return diff; LEN: compare using len_diff/diff */ -#define CMP 2 -#define LEN 3 - - -/* ISDIGIT differs from isdigit, as follows: - - Its arg may be any int or unsigned int; it need not be an unsigned char - or EOF. - - It's typically faster. - POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to - isdigit unless it's important to use the locale's definition - of "digit" even when the host does not conform to POSIX. */ -#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9) - -#undef __strverscmp -#undef strverscmp +#define CMP 2 +#define LEN 3 #ifndef weak_alias # define __strverscmp strverscmp @@ -66,30 +53,25 @@ __strverscmp (const char *s1, const char *s2) int state; int diff; - /* Symbol(s) 0 [1-9] others (padding) - Transition (10) 0 (01) d (00) x (11) - */ - static const unsigned int next_state[] = + /* Symbol(s) 0 [1-9] others + Transition (10) 0 (01) d (00) x */ + static const unsigned char next_state[] = { - /* state x d 0 - */ - /* S_N */ S_N, S_I, S_Z, S_N, - /* S_I */ S_N, S_I, S_I, S_I, - /* S_F */ S_N, S_F, S_F, S_F, - /* S_Z */ S_N, S_F, S_Z, S_Z + /* state x d 0 */ + /* S_N */ S_N, S_I, S_Z, + /* S_I */ S_N, S_I, S_I, + /* S_F */ S_N, S_F, S_F, + /* S_Z */ S_N, S_F, S_Z }; - static const int result_type[] = + static const signed char result_type[] = { - /* state x/x x/d x/0 x/- d/x d/d d/0 d/- - 0/x 0/d 0/0 0/- -/x -/d -/0 -/- */ - - /* S_N */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, - CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, - /* S_I */ CMP, -1, -1, CMP, 1, LEN, LEN, CMP, - 1, LEN, LEN, CMP, CMP, CMP, CMP, CMP, - /* S_F */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, - CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, - /* S_Z */ CMP, 1, 1, CMP, -1, CMP, CMP, CMP, - -1, CMP, CMP, CMP + /* state x/x x/d x/0 d/x d/d d/0 0/x 0/d 0/0 */ + + /* S_N */ CMP, CMP, CMP, CMP, LEN, CMP, CMP, CMP, CMP, + /* S_I */ CMP, -1, -1, +1, LEN, LEN, +1, LEN, LEN, + /* S_F */ CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, + /* S_Z */ CMP, +1, +1, -1, CMP, CMP, -1, CMP, CMP }; if (p1 == p2) @@ -98,17 +80,20 @@ __strverscmp (const char *s1, const char *s2) c1 = *p1++; c2 = *p2++; /* Hint: '0' is a digit too. */ - state = S_N | ((c1 == '0') + (ISDIGIT (c1) != 0)); + state = S_N + ((c1 == '0') + (isdigit (c1) != 0)); - while ((diff = c1 - c2) == 0 && c1 != '\0') + while ((diff = c1 - c2) == 0) { + if (c1 == '\0') + return diff; + state = next_state[state]; c1 = *p1++; c2 = *p2++; - state |= (c1 == '0') + (ISDIGIT (c1) != 0); + state += (c1 == '0') + (isdigit (c1) != 0); } - state = result_type[state << 2 | ((c2 == '0') + (ISDIGIT (c2) != 0))]; + state = result_type[state * 3 + (((c2 == '0') + (isdigit (c2) != 0)))]; switch (state) { @@ -116,16 +101,17 @@ __strverscmp (const char *s1, const char *s2) return diff; case LEN: - while (ISDIGIT (*p1++)) - if (!ISDIGIT (*p2++)) + while (isdigit (*p1++)) + if (!isdigit (*p2++)) return 1; - return ISDIGIT (*p2) ? -1 : diff; + return isdigit (*p2) ? -1 : diff; default: return state; } } #ifdef weak_alias +libc_hidden_def (__strverscmp) weak_alias (__strverscmp, strverscmp) #endif diff --git a/lib/gllib/sys_types.in.h b/lib/gllib/sys_types.in.h index 40c8d57..abdd7f0 100644 --- a/lib/gllib/sys_types.in.h +++ b/lib/gllib/sys_types.in.h @@ -1,6 +1,6 @@ /* Provide a more complete sys/types.h. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/lib/gllib/verify.h b/lib/gllib/verify.h new file mode 100644 index 0000000..a9ef798 --- /dev/null +++ b/lib/gllib/verify.h @@ -0,0 +1,279 @@ +/* Compile-time assert-like macros. + + Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */ + +#ifndef _GL_VERIFY_H +#define _GL_VERIFY_H + + +/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per C11. + This is supported by GCC 4.6.0 and later, in C mode, and its use + here generates easier-to-read diagnostics when verify (R) fails. + + Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11. + This will likely be supported by future GCC versions, in C++ mode. + + Use this only with GCC. If we were willing to slow 'configure' + down we could also use it with other compilers, but since this + affects only the quality of diagnostics, why bother? */ +#if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \ + && (201112L <= __STDC_VERSION__ || !defined __STRICT_ANSI__) \ + && !defined __cplusplus) +# define _GL_HAVE__STATIC_ASSERT 1 +#endif +/* The condition (99 < __GNUC__) is temporary, until we know about the + first G++ release that supports static_assert. */ +#if (99 < __GNUC__) && defined __cplusplus +# define _GL_HAVE_STATIC_ASSERT 1 +#endif + +/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other + system headers, defines a conflicting _Static_assert that is no + better than ours; override it. */ +#ifndef _GL_HAVE_STATIC_ASSERT +# include <stddef.h> +# undef _Static_assert +#endif + +/* Each of these macros verifies that its argument R is nonzero. To + be portable, R should be an integer constant expression. Unlike + assert (R), there is no run-time overhead. + + If _Static_assert works, verify (R) uses it directly. Similarly, + _GL_VERIFY_TRUE works by packaging a _Static_assert inside a struct + that is an operand of sizeof. + + The code below uses several ideas for C++ compilers, and for C + compilers that do not support _Static_assert: + + * The first step is ((R) ? 1 : -1). Given an expression R, of + integral or boolean or floating-point type, this yields an + expression of integral type, whose value is later verified to be + constant and nonnegative. + + * Next this expression W is wrapped in a type + struct _gl_verify_type { + unsigned int _gl_verify_error_if_negative: W; + }. + If W is negative, this yields a compile-time error. No compiler can + deal with a bit-field of negative size. + + One might think that an array size check would have the same + effect, that is, that the type struct { unsigned int dummy[W]; } + would work as well. However, inside a function, some compilers + (such as C++ compilers and GNU C) allow local parameters and + variables inside array size expressions. With these compilers, + an array size check would not properly diagnose this misuse of + the verify macro: + + void function (int n) { verify (n < 0); } + + * For the verify macro, the struct _gl_verify_type will need to + somehow be embedded into a declaration. To be portable, this + declaration must declare an object, a constant, a function, or a + typedef name. If the declared entity uses the type directly, + such as in + + struct dummy {...}; + typedef struct {...} dummy; + extern struct {...} *dummy; + extern void dummy (struct {...} *); + extern struct {...} *dummy (void); + + two uses of the verify macro would yield colliding declarations + if the entity names are not disambiguated. A workaround is to + attach the current line number to the entity name: + + #define _GL_CONCAT0(x, y) x##y + #define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y) + extern struct {...} * _GL_CONCAT (dummy, __LINE__); + + But this has the problem that two invocations of verify from + within the same macro would collide, since the __LINE__ value + would be the same for both invocations. (The GCC __COUNTER__ + macro solves this problem, but is not portable.) + + A solution is to use the sizeof operator. It yields a number, + getting rid of the identity of the type. Declarations like + + extern int dummy [sizeof (struct {...})]; + extern void dummy (int [sizeof (struct {...})]); + extern int (*dummy (void)) [sizeof (struct {...})]; + + can be repeated. + + * Should the implementation use a named struct or an unnamed struct? + Which of the following alternatives can be used? + + extern int dummy [sizeof (struct {...})]; + extern int dummy [sizeof (struct _gl_verify_type {...})]; + extern void dummy (int [sizeof (struct {...})]); + extern void dummy (int [sizeof (struct _gl_verify_type {...})]); + extern int (*dummy (void)) [sizeof (struct {...})]; + extern int (*dummy (void)) [sizeof (struct _gl_verify_type {...})]; + + In the second and sixth case, the struct type is exported to the + outer scope; two such declarations therefore collide. GCC warns + about the first, third, and fourth cases. So the only remaining + possibility is the fifth case: + + extern int (*dummy (void)) [sizeof (struct {...})]; + + * GCC warns about duplicate declarations of the dummy function if + -Wredundant-decls is used. GCC 4.3 and later have a builtin + __COUNTER__ macro that can let us generate unique identifiers for + each dummy function, to suppress this warning. + + * This implementation exploits the fact that older versions of GCC, + which do not support _Static_assert, also do not warn about the + last declaration mentioned above. + + * GCC warns if -Wnested-externs is enabled and verify() is used + within a function body; but inside a function, you can always + arrange to use verify_expr() instead. + + * In C++, any struct definition inside sizeof is invalid. + Use a template type to work around the problem. */ + +/* Concatenate two preprocessor tokens. */ +#define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y) +#define _GL_CONCAT0(x, y) x##y + +/* _GL_COUNTER is an integer, preferably one that changes each time we + use it. Use __COUNTER__ if it works, falling back on __LINE__ + otherwise. __LINE__ isn't perfect, but it's better than a + constant. */ +#if defined __COUNTER__ && __COUNTER__ != __COUNTER__ +# define _GL_COUNTER __COUNTER__ +#else +# define _GL_COUNTER __LINE__ +#endif + +/* Generate a symbol with the given prefix, making it unique if + possible. */ +#define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER) + +/* Verify requirement R at compile-time, as an integer constant expression + that returns 1. If R is false, fail at compile-time, preferably + with a diagnostic that includes the string-literal DIAGNOSTIC. */ + +#define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \ + (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC))) + +#ifdef __cplusplus +# if !GNULIB_defined_struct__gl_verify_type +template <int w> + struct _gl_verify_type { + unsigned int _gl_verify_error_if_negative: w; + }; +# define GNULIB_defined_struct__gl_verify_type 1 +# endif +# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ + _gl_verify_type<(R) ? 1 : -1> +#elif defined _GL_HAVE__STATIC_ASSERT +# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ + struct { \ + _Static_assert (R, DIAGNOSTIC); \ + int _gl_dummy; \ + } +#else +# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ + struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; } +#endif + +/* Verify requirement R at compile-time, as a declaration without a + trailing ';'. If R is false, fail at compile-time, preferably + with a diagnostic that includes the string-literal DIAGNOSTIC. + + Unfortunately, unlike C11, this implementation must appear as an + ordinary declaration, and cannot appear inside struct { ... }. */ + +#ifdef _GL_HAVE__STATIC_ASSERT +# define _GL_VERIFY _Static_assert +#else +# define _GL_VERIFY(R, DIAGNOSTIC) \ + extern int (*_GL_GENSYM (_gl_verify_function) (void)) \ + [_GL_VERIFY_TRUE (R, DIAGNOSTIC)] +#endif + +/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */ +#ifdef _GL_STATIC_ASSERT_H +# if !defined _GL_HAVE__STATIC_ASSERT && !defined _Static_assert +# define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC) +# endif +# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert +# define static_assert _Static_assert /* C11 requires this #define. */ +# endif +#endif + +/* @assert.h omit start@ */ + +/* Each of these macros verifies that its argument R is nonzero. To + be portable, R should be an integer constant expression. Unlike + assert (R), there is no run-time overhead. + + There are two macros, since no single macro can be used in all + contexts in C. verify_true (R) is for scalar contexts, including + integer constant expression contexts. verify (R) is for declaration + contexts, e.g., the top level. */ + +/* Verify requirement R at compile-time, as an integer constant expression. + Return 1. This is equivalent to verify_expr (R, 1). + + verify_true is obsolescent; please use verify_expr instead. */ + +#define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")") + +/* Verify requirement R at compile-time. Return the value of the + expression E. */ + +#define verify_expr(R, E) \ + (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E)) + +/* Verify requirement R at compile-time, as a declaration without a + trailing ';'. */ + +#define verify(R) _GL_VERIFY (R, "verify (" #R ")") + +#ifndef __has_builtin +# define __has_builtin(x) 0 +#endif + +/* Assume that R always holds. This lets the compiler optimize + accordingly. R should not have side-effects; it may or may not be + evaluated. Behavior is undefined if R is false. */ + +#if (__has_builtin (__builtin_unreachable) \ + || 4 < __GNUC__ + (5 <= __GNUC_MINOR__)) +# define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) +#elif 1200 <= _MSC_VER +# define assume(R) __assume (R) +#elif ((defined GCC_LINT || defined lint) \ + && (__has_builtin (__builtin_trap) \ + || 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__)))) + /* Doing it this way helps various packages when configured with + --enable-gcc-warnings, which compiles with -Dlint. It's nicer + when 'assume' silences warnings even with older GCCs. */ +# define assume(R) ((R) ? (void) 0 : __builtin_trap ()) +#else +# define assume(R) ((void) (0 && (R))) +#endif + +/* @assert.h omit end@ */ + +#endif diff --git a/lib/glm4/gnulib-comp.m4 b/lib/glm4/gnulib-comp.m4 index 3af169f..38f4c34 100644 --- a/lib/glm4/gnulib-comp.m4 +++ b/lib/glm4/gnulib-comp.m4 @@ -1,5 +1,5 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -37,16 +37,20 @@ AC_DEFUN([lgl_EARLY], m4_pattern_allow([^gl_ES$])dnl a valid locale name m4_pattern_allow([^gl_LIBOBJS$])dnl a variable m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable + + # Pre-early section. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_PROG_AR_RANLIB]) + # Code from module absolute-header: # Code from module extensions: - AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) # Code from module extern-inline: # Code from module hash-pjw-bare: # Code from module include_next: # Code from module intprops: # Code from module lib-symbol-versions: # Code from module lib-symbol-visibility: + # Code from module limits-h: # Code from module minmax: # Code from module multiarch: # Code from module snippet/arg-nonnull: @@ -58,6 +62,7 @@ AC_DEFUN([lgl_EARLY], # Code from module string: # Code from module strverscmp: # Code from module sys_types: + # Code from module verify: ]) # This macro should be invoked from ./configure.ac, in the section @@ -77,6 +82,7 @@ AC_DEFUN([lgl_INIT], AC_REQUIRE([gl_EXTERN_INLINE]) gl_LD_VERSION_SCRIPT gl_VISIBILITY + gl_LIMITS_H gl_MINMAX gl_MULTIARCH gt_TYPE_SSIZE_T @@ -233,12 +239,14 @@ AC_DEFUN([lgl_FILE_LIST], [ lib/hash-pjw-bare.c lib/hash-pjw-bare.h lib/intprops.h + lib/limits.in.h lib/minmax.h lib/stddef.in.h lib/stdint.in.h lib/string.in.h lib/strverscmp.c lib/sys_types.in.h + lib/verify.h m4/00gnulib.m4 m4/absolute-header.m4 m4/extensions.m4 @@ -246,6 +254,7 @@ AC_DEFUN([lgl_FILE_LIST], [ m4/gnulib-common.m4 m4/include_next.m4 m4/ld-version-script.m4 + m4/limits-h.m4 m4/longlong.m4 m4/minmax.m4 m4/multiarch.m4 @@ -259,4 +268,5 @@ AC_DEFUN([lgl_FILE_LIST], [ m4/visibility.m4 m4/warn-on-use.m4 m4/wchar_t.m4 + m4/wint_t.m4 ]) diff --git a/lib/glm4/ld-version-script.m4 b/lib/glm4/ld-version-script.m4 index f8b4a5c..caccec1 100644 --- a/lib/glm4/ld-version-script.m4 +++ b/lib/glm4/ld-version-script.m4 @@ -1,5 +1,5 @@ -# ld-version-script.m4 serial 3 -dnl Copyright (C) 2008-2014 Free Software Foundation, Inc. +# ld-version-script.m4 serial 4 +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -18,20 +18,18 @@ dnl From Simon Josefsson AC_DEFUN([gl_LD_VERSION_SCRIPT], [ AC_ARG_ENABLE([ld-version-script], - AS_HELP_STRING([--enable-ld-version-script], - [enable linker version script (default is enabled when possible)]), - [have_ld_version_script=$enableval], []) - if test -z "$have_ld_version_script"; then - AC_MSG_CHECKING([if LD -Wl,--version-script works]) - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" - cat > conftest.map <<EOF -foo -EOF - AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], - [accepts_syntax_errors=yes], [accepts_syntax_errors=no]) - if test "$accepts_syntax_errors" = no; then - cat > conftest.map <<EOF + [AS_HELP_STRING([--enable-ld-version-script], + [enable linker version script (default is enabled when possible)])], + [have_ld_version_script=$enableval], + [AC_CACHE_CHECK([if LD -Wl,--version-script works], + [gl_cv_sys_ld_version_script], + [gl_cv_sys_ld_version_script=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" + echo foo >conftest.map + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + [], + [cat > conftest.map <<EOF VERS_1 { global: sym; }; @@ -40,14 +38,11 @@ VERS_2 { global: sym; } VERS_1; EOF - AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], - [have_ld_version_script=yes], [have_ld_version_script=no]) - else - have_ld_version_script=no - fi - rm -f conftest.map - LDFLAGS="$save_LDFLAGS" - AC_MSG_RESULT($have_ld_version_script) - fi - AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + [gl_cv_sys_ld_version_script=yes])]) + rm -f conftest.map + LDFLAGS=$save_LDFLAGS]) + have_ld_version_script=$gl_cv_sys_ld_version_script]) + AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT], + [test "$have_ld_version_script" = yes]) ]) diff --git a/lib/glm4/minmax.m4 b/lib/glm4/minmax.m4 index edbeb43..6845fce 100644 --- a/lib/glm4/minmax.m4 +++ b/lib/glm4/minmax.m4 @@ -1,5 +1,5 @@ # minmax.m4 serial 4 -dnl Copyright (C) 2005, 2009-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/lib/glm4/string_h.m4 b/lib/glm4/string_h.m4 index 64e683f..3d2ad22 100644 --- a/lib/glm4/string_h.m4 +++ b/lib/glm4/string_h.m4 @@ -1,6 +1,6 @@ # Configure a GNU-like replacement for <string.h>. -# Copyright (C) 2007-2014 Free Software Foundation, Inc. +# Copyright (C) 2007-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/lib/glm4/strverscmp.m4 b/lib/glm4/strverscmp.m4 index aca1d54..cbcca3f 100644 --- a/lib/glm4/strverscmp.m4 +++ b/lib/glm4/strverscmp.m4 @@ -1,5 +1,5 @@ # strverscmp.m4 serial 8 -dnl Copyright (C) 2002, 2005-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2005-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/lib/glm4/visibility.m4 b/lib/glm4/visibility.m4 index 552e397..ce00e72 100644 --- a/lib/glm4/visibility.m4 +++ b/lib/glm4/visibility.m4 @@ -1,5 +1,5 @@ # visibility.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2005, 2008, 2010-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008, 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/lib/libtasn1.h b/lib/libtasn1.h index 5c4340f..4ad01e7 100644 --- a/lib/libtasn1.h +++ b/lib/libtasn1.h @@ -44,7 +44,7 @@ extern "C" { #endif -#define ASN1_VERSION "4.9" +#define ASN1_VERSION "4.10" #if defined(__GNUC__) && !defined(ASN1_INTERNAL_BUILD) # define _ASN1_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) @@ -377,7 +377,7 @@ extern "C" extern ASN1_API int asn1_get_object_id_der (const unsigned char *der, int der_len, int *ret_len, - char *str, int str_size); + char *str, int str_size); /* Compatibility types */ diff --git a/lib/parser_aux.c b/lib/parser_aux.c index 2285b20..b4a7370 100644 --- a/lib/parser_aux.c +++ b/lib/parser_aux.c @@ -84,7 +84,7 @@ _asn1_add_static_node (unsigned int type) * @name: null terminated string with the element's name to find. * * Searches for an element called @name starting from @pointer. The - * name is composed by differents identifiers separated by dots. When + * name is composed by different identifiers separated by dots. When * *@pointer has a name, the first identifier must be the name of * *@pointer, otherwise it must be the name of one child of *@pointer. * @@ -551,29 +551,33 @@ _asn1_delete_list_and_nodes (void) char * _asn1_ltostr (int64_t v, char str[LTOSTR_MAX_SIZE]) { - int64_t d, r; + uint64_t d, r; char temp[LTOSTR_MAX_SIZE]; int count, k, start; + uint64_t val; if (v < 0) { str[0] = '-'; start = 1; - v = -v; + val = -((uint64_t)v); } else - start = 0; + { + val = v; + start = 0; + } count = 0; do { - d = v / 10; - r = v - d * 10; + d = val / 10; + r = val - d * 10; temp[start + count] = '0' + (char) r; count++; - v = d; + val = d; } - while (v && ((start+count) < LTOSTR_MAX_SIZE-1)); + while (val && ((start+count) < LTOSTR_MAX_SIZE-1)); for (k = 0; k < count; k++) str[k + start] = temp[start + count - k - 1]; @@ -637,7 +641,7 @@ _asn1_change_integer_value (asn1_node node) p = NULL; break; } - if (p->right) + if (p && p->right) { p = p->right; break; @@ -753,7 +757,7 @@ _asn1_expand_object_id (asn1_node node) if (move == RIGHT) { - if (p->right) + if (p && p->right) p = p->right; else move = UP; @@ -828,7 +832,7 @@ _asn1_expand_object_id (asn1_node node) if (move == RIGHT) { - if (p->right) + if (p && p->right) p = p->right; else move = UP; @@ -898,7 +902,7 @@ _asn1_type_set_config (asn1_node node) if (move == RIGHT) { - if (p->right) + if (p && p->right) p = p->right; else move = UP; @@ -1007,7 +1011,7 @@ _asn1_check_identifier (asn1_node node) p = NULL; break; } - if (p->right) + if (p && p->right) { p = p->right; break; @@ -1067,7 +1071,7 @@ _asn1_set_default_tag (asn1_node node) p = NULL; break; } - if (p->right) + if (p && p->right) { p = p->right; break; @@ -2,7 +2,7 @@ # This Makefile fragment tries to be general-purpose enough to be # used by many projects via the gnulib maintainer-makefile module. -## Copyright (C) 2001-2014 Free Software Foundation, Inc. +## Copyright (C) 2001-2017 Free Software Foundation, Inc. ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -21,13 +21,6 @@ # ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) ME := maint.mk -# Diagnostic for continued use of deprecated variable. -# Remove in 2013 -ifneq ($(build_aux),) - $(error "$(ME): \ -set $$(_build-aux) relative to $$(srcdir) instead of $$(build_aux)") -endif - # Helper variables. _empty = _sp = $(_empty) $(_empty) @@ -62,6 +55,10 @@ VC = $(GIT) VC_LIST = $(srcdir)/$(_build-aux)/vc-list-files -C $(srcdir) +# You can override this variable in cfg.mk if your gnulib submodule lives +# in a different location. +gnulib_dir ?= $(srcdir)/gnulib + # You can override this variable in cfg.mk to set your own regexp # matching files to ignore. VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$ @@ -155,6 +152,7 @@ export LC_ALL = C ## Sanity checks. ## ## --------------- ## +ifneq ($(_gl-Makefile),) _cfg_mk := $(wildcard $(srcdir)/cfg.mk) # Collect the names of rules starting with 'sc_'. @@ -196,6 +194,7 @@ local-check := \ $(filter-out $(local-checks-to-skip), $(local-checks-available))) syntax-check: $(local-check) +endif # _sc_search_regexp # @@ -442,17 +441,26 @@ sc_require_config_h: halt='the above files do not include <config.h>' \ $(_sc_search_regexp) +# Print each file name for which the first #include does not match +# $(config_h_header). Like grep -m 1, this only looks at the first match. +perl_config_h_first_ = \ + -e 'BEGIN {$$ret = 0}' \ + -e 'if (/^\# *include\b/) {' \ + -e ' if (not m{^\# *include $(config_h_header)}) {' \ + -e ' print "$$ARGV\n";' \ + -e ' $$ret = 1;' \ + -e ' }' \ + -e ' \# Move on to next file after first include' \ + -e ' close ARGV;' \ + -e '}' \ + -e 'END {exit $$ret}' + # You must include <config.h> before including any other header file. # This can possibly be via a package-specific header, if given by cfg.mk. sc_require_config_h_first: - @if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \ - fail=0; \ - for i in $$($(VC_LIST_EXCEPT) | grep '\.c$$'); do \ - grep '^# *include\>' $$i | $(SED) 1q \ - | grep -E '^# *include $(config_h_header)' > /dev/null \ - || { echo $$i; fail=1; }; \ - done; \ - test $$fail = 1 && \ + @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \ + files=$$($(VC_LIST_EXCEPT) | grep '\.c$$') && \ + perl -n $(perl_config_h_first_) $$files || \ { echo '$(ME): the above files include some other header' \ 'before <config.h>' 1>&2; exit 1; } || :; \ else :; \ @@ -469,7 +477,7 @@ sc_prohibit_HAVE_MBRTOWC: define _sc_header_without_use dummy=; : so we do not need a semicolon before each use; \ h_esc=`echo '[<"]'"$$h"'[">]'|$(SED) 's/\./\\\\./g'`; \ - if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \ + if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \ files=$$(grep -l '^# *include '"$$h_esc" \ $$($(VC_LIST_EXCEPT) | grep '\.c$$')) && \ grep -LE "$$re" $$files | grep . && \ @@ -653,18 +661,14 @@ sc_prohibit_strings_without_use: re='\<(strn?casecmp|ffs(ll)?)\>' \ $(_sc_header_without_use) -# Get the list of symbol names with this: -# perl -lne '/^# *define ([A-Z]\w+)\(/ and print $1' lib/intprops.h|fmt -_intprops_names = \ - TYPE_IS_INTEGER TYPE_TWOS_COMPLEMENT TYPE_ONES_COMPLEMENT \ - TYPE_SIGNED_MAGNITUDE TYPE_SIGNED TYPE_MINIMUM TYPE_MAXIMUM \ - INT_BITS_STRLEN_BOUND INT_STRLEN_BOUND INT_BUFSIZE_BOUND \ - INT_ADD_RANGE_OVERFLOW INT_SUBTRACT_RANGE_OVERFLOW \ - INT_NEGATE_RANGE_OVERFLOW INT_MULTIPLY_RANGE_OVERFLOW \ - INT_DIVIDE_RANGE_OVERFLOW INT_REMAINDER_RANGE_OVERFLOW \ - INT_LEFT_SHIFT_RANGE_OVERFLOW INT_ADD_OVERFLOW INT_SUBTRACT_OVERFLOW \ - INT_NEGATE_OVERFLOW INT_MULTIPLY_OVERFLOW INT_DIVIDE_OVERFLOW \ - INT_REMAINDER_OVERFLOW INT_LEFT_SHIFT_OVERFLOW +# Extract the raw list of symbol names with this: +gl_extract_define_simple = \ + /^\# *define ([A-Z]\w+)\(/ and print $$1 +# Filter out duplicates and convert to a space-separated list: +_intprops_names = \ + $(shell f=$(gnulib_dir)/lib/intprops.h; \ + perl -lne '$(gl_extract_define_simple)' $$f | sort -u | tr '\n' ' ') +# Remove trailing space and convert to a regular expression: _intprops_syms_re = $(subst $(_sp),|,$(strip $(_intprops_names))) # Prohibit the inclusion of intprops.h without an actual use. sc_prohibit_intprops_without_use: @@ -714,15 +718,6 @@ sc_changelog: $(_sc_search_regexp) # Ensure that each .c file containing a "main" function also -# calls set_program_name. -sc_program_name: - @require='set_program_name *\(m?argv\[0\]\);' \ - in_vc_files='\.c$$' \ - containing='\<main *(' \ - halt='the above files do not call set_program_name' \ - $(_sc_search_regexp) - -# Ensure that each .c file containing a "main" function also # calls bindtextdomain. sc_bindtextdomain: @require='bindtextdomain *\(' \ @@ -959,8 +954,13 @@ perl_filename_lineno_text_ = \ -e ' print "$$ARGV:$$n:$$v\n";' \ -e ' }' +prohibit_doubled_words_ = \ + the then in an on if is it but for or at and do to +# expand the regex before running the check to avoid using expensive captures +prohibit_doubled_word_expanded_ = \ + $(join $(prohibit_doubled_words_),$(addprefix \s+,$(prohibit_doubled_words_))) prohibit_doubled_word_RE_ ?= \ - /\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims + /\b(?:$(subst $(_sp),|,$(prohibit_doubled_word_expanded_)))\b/gims prohibit_doubled_word_ = \ -e 'while ($(prohibit_doubled_word_RE_))' \ $(perl_filename_lineno_text_) @@ -983,10 +983,11 @@ sc_prohibit_doubled_word: # Also prohibit a prefix matching "\w+ +". # @pxref gets the same see/also treatment and should be parenthesized; # presume it must *not* start a sentence. +# POSIX spells it "timestamp" rather than "time\s+stamp", so we do, too. bad_xref_re_ ?= (?:[\w,:;] +|(?:see|also)\s+)\@xref\{ bad_pxref_re_ ?= (?:[.!?]|(?:see|also))\s+\@pxref\{ prohibit_undesirable_word_seq_RE_ ?= \ - /(?:\bcan\s+not\b|$(bad_xref_re_)|$(bad_pxref_re_))/gims + /(?:\bcan\s+not\b|\btime\s+stamps?\b|$(bad_xref_re_)|$(bad_pxref_re_))/gims prohibit_undesirable_word_seq_ = \ -e 'while ($(prohibit_undesirable_word_seq_RE_))' \ $(perl_filename_lineno_text_) @@ -1001,6 +1002,14 @@ sc_prohibit_undesirable_word_seq: | grep -vE '$(ignore_undesirable_word_sequence_RE_)' | grep . \ && { echo '$(ME): undesirable word sequence' >&2; exit 1; } || : +# Except for shell files and for loops, double semicolon is probably a mistake +sc_prohibit_double_semicolon: + @prohibit='; *;[ {} \]*(/[/*]|$$)' \ + in_vc_files='\.[chly]$$' \ + exclude='\bfor *\(.*\)' \ + halt="Double semicolon detected" \ + $(_sc_search_regexp) + _ptm1 = use "test C1 && test C2", not "test C1 -''a C2" _ptm2 = use "test C1 || test C2", not "test C1 -''o C2" # Using test's -a and -o operators is not portable. @@ -1121,6 +1130,21 @@ fix_po_file_diag = \ 'you have changed the set of files with translatable diagnostics;\n\ apply the above patch\n' +# Generate a list of files in which to search for translatable strings. +perl_translatable_files_list_ = \ + -e 'foreach $$file (@ARGV) {' \ + -e ' \# Consider only file extensions with one or two letters' \ + -e ' $$file =~ /\...?$$/ or next;' \ + -e ' \# Ignore m4 and mk files' \ + -e ' $$file =~ /\.m[4k]$$/ and next;' \ + -e ' \# Ignore a .c or .h file with a corresponding .l or .y file' \ + -e ' $$file =~ /(.+)\.[ch]$$/ && (-e "$${1}.l" || -e "$${1}.y")' \ + -e ' and next;' \ + -e ' \# Skip unreadable files' \ + -e ' -r $$file or next;' \ + -e ' print "$$file ";' \ + -e '}' + # Verify that all source files using _() (more specifically, files that # match $(_gl_translatable_string_re)) are listed in po/POTFILES.in. po_file ?= $(srcdir)/po/POTFILES.in @@ -1130,21 +1154,8 @@ sc_po_check: @if test -f $(po_file); then \ grep -E -v '^(#|$$)' $(po_file) \ | grep -v '^src/false\.c$$' | sort > $@-1; \ - files=; \ - for file in $$($(VC_LIST_EXCEPT)) $(generated_files); do \ - test -r $$file || continue; \ - case $$file in \ - *.m4|*.mk) continue ;; \ - *.?|*.??) ;; \ - *) continue;; \ - esac; \ - case $$file in \ - *.[ch]) \ - base=`expr " $$file" : ' \(.*\)\..'`; \ - { test -f $$base.l || test -f $$base.y; } && continue;; \ - esac; \ - files="$$files $$file"; \ - done; \ + files=$$(perl $(perl_translatable_files_list_) \ + $$($(VC_LIST_EXCEPT)) $(generated_files)); \ grep -E -l '$(_gl_translatable_string_re)' $$files \ | $(SED) 's|^$(_dot_escaped_srcdir)/||' | sort -u > $@-2; \ diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \ @@ -1282,7 +1293,6 @@ vc-diff-check: rel-files = $(DIST_ARCHIVES) -gnulib_dir ?= $(srcdir)/gnulib gnulib-version = $$(cd $(gnulib_dir) \ && { git describe || git rev-parse --short=10 HEAD; } ) bootstrap-tools ?= autoconf,automake,gnulib @@ -1492,7 +1502,10 @@ gen-coverage: --highlight --frames --legend \ --title "$(PACKAGE_NAME)" -coverage: init-coverage build-coverage gen-coverage +coverage: + $(MAKE) init-coverage + $(MAKE) build-coverage + $(MAKE) gen-coverage # Some projects carry local adjustments for gnulib modules via patches in # a gnulib patch directory whose default name is gl/ (defined in bootstrap @@ -1597,7 +1610,7 @@ ifeq (a,b) # do not need to be marked. Symbols matching '__.*' are # reserved by the compiler, so are automatically excluded below. _gl_TS_unmarked_extern_functions ?= main usage -_gl_TS_function_match ?= /^(?:$(_gl_TS_extern)) +.*?(\S+) *\(/ +_gl_TS_function_match ?= /^(?:$(_gl_TS_extern)) +.*?(\w+) *\(/ # If your project uses a macro like "XTERN", then put # the following in cfg.mk to override this default: @@ -1630,6 +1643,7 @@ _gl_TS_other_headers ?= *.h .PHONY: _gl_tight_scope _gl_tight_scope: $(bin_PROGRAMS) + sed_wrap='s/^/^_?/;s/$$/$$/'; \ t=exceptions-$$$$; \ trap 's=$$?; rm -f $$t; exit $$s' 0; \ for sig in 1 2 3 13 15; do \ @@ -1639,20 +1653,20 @@ _gl_tight_scope: $(bin_PROGRAMS) test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \ hdr=`for f in $(_gl_TS_headers); do \ test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \ - ( printf '^%s$$\n' '__.*' $(_gl_TS_unmarked_extern_functions); \ + ( printf '%s\n' '__.*' $(_gl_TS_unmarked_extern_functions); \ grep -h -A1 '^extern .*[^;]$$' $$src \ - | grep -vE '^(extern |--)' | $(SED) 's/ .*//'; \ + | grep -vE '^(extern |--|#)' | $(SED) 's/ .*//; /^$$/d'; \ perl -lne \ - '$(_gl_TS_function_match) and print "^$$1\$$"' $$hdr; \ - ) | sort -u > $$t; \ - nm -e $(_gl_TS_obj_files)|$(SED) -n 's/.* T //p'|grep -Ev -f $$t \ + '$(_gl_TS_function_match) and print $$1' $$hdr; \ + ) | sort -u | $(SED) "$$sed_wrap" > $$t; \ + nm -g $(_gl_TS_obj_files)|$(SED) -n 's/.* T //p'|grep -Ev -f $$t \ && { echo the above functions should have static scope >&2; \ exit 1; } || : ; \ - ( printf '^%s$$\n' '__.*' $(_gl_TS_unmarked_extern_vars); \ - perl -lne '$(_gl_TS_var_match) and print "^$$1\$$"' \ + ( printf '%s\n' '__.*' main $(_gl_TS_unmarked_extern_vars); \ + perl -lne '$(_gl_TS_var_match) and print $$1' \ $$hdr $(_gl_TS_other_headers) \ - ) | sort -u > $$t; \ - nm -e $(_gl_TS_obj_files) | $(SED) -n 's/.* [BCDGRS] //p' \ + ) | sort -u | $(SED) "$$sed_wrap" > $$t; \ + nm -g $(_gl_TS_obj_files) | $(SED) -n 's/.* [BCDGRS] //p' \ | sort -u | grep -Ev -f $$t \ && { echo the above variables should have static scope >&2; \ exit 1; } || : diff --git a/src/Makefile.in b/src/Makefile.in index 0999657..9b270e8 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -130,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/largefile.m4 \ + $(top_srcdir)/gl/m4/limits-h.m4 \ $(top_srcdir)/gl/m4/longlong.m4 $(top_srcdir)/gl/m4/lseek.m4 \ $(top_srcdir)/gl/m4/malloc.m4 \ $(top_srcdir)/gl/m4/manywarnings.m4 \ @@ -152,10 +153,10 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/version-etc.m4 \ $(top_srcdir)/gl/m4/warn-on-use.m4 \ $(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ - $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/m4/gtk-doc.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/m4/update-header-version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -394,6 +395,7 @@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ @@ -410,6 +412,7 @@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ @@ -458,6 +461,7 @@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ @@ -486,6 +490,7 @@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ @@ -498,6 +503,7 @@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ @@ -551,6 +557,7 @@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ @@ -576,6 +583,7 @@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ @@ -615,6 +623,7 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ @@ -644,6 +653,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIMITS_H = @LIMITS_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBINTL = @LTLIBINTL@ @@ -656,6 +666,7 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ @@ -669,6 +680,7 @@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ @@ -762,9 +774,11 @@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ @@ -793,6 +807,7 @@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ @@ -821,13 +836,13 @@ STRIP = @STRIP@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VALGRIND = @VALGRIND@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ -WERROR_CFLAGS = @WERROR_CFLAGS@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ diff --git a/src/asn1Coding.c b/src/asn1Coding.c index d4df593..b516bfe 100644 --- a/src/asn1Coding.c +++ b/src/asn1Coding.c @@ -188,7 +188,7 @@ main (int argc, char *argv[]) default: fprintf (stderr, "asn1Coding: ?? getopt returned character code Ox%x ??\n", - option_result); + (unsigned)option_result); } } diff --git a/src/asn1Decoding.c b/src/asn1Decoding.c index 078963e..20f91ac 100644 --- a/src/asn1Decoding.c +++ b/src/asn1Decoding.c @@ -131,7 +131,7 @@ main (int argc, char *argv[]) default: fprintf (stderr, "asn1Decoding: ?? getopt returned character code Ox%x ??\n", - option_result); + (unsigned)option_result); } } diff --git a/src/asn1Parser.c b/src/asn1Parser.c index 7a3ae67..475bfc9 100644 --- a/src/asn1Parser.c +++ b/src/asn1Parser.c @@ -139,7 +139,7 @@ main (int argc, char *argv[]) default: fprintf (stderr, "asn1Parser: ?? getopt returned character code Ox%x ??\n", - option_result); + (unsigned)option_result); } } diff --git a/src/benchmark.c b/src/benchmark.c index 751586b..f36115b 100644 --- a/src/benchmark.c +++ b/src/benchmark.c @@ -30,7 +30,7 @@ int benchmark_must_finish = 0; #if defined _WIN32 #include <windows.h> -DWORD WINAPI +static DWORD WINAPI alarm_handler (LPVOID lpParameter) { HANDLE wtimer = *((HANDLE *) lpParameter); diff --git a/tests/Makefile.am b/tests/Makefile.am index 379525e..bea3310 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -22,10 +22,10 @@ AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I../gl AM_LDFLAGS = -no-install LDADD = ../lib/libtasn1.la ../gl/libgnu.la -EXTRA_DIST = Test_parser.asn Test_tree.asn Test_tree_asn1_tab.c \ +EXTRA_DIST = Test_parser.asn Test_tree.asn Test_tree_asn1_tab.c mscat.asn \ Test_encoding.asn pkix.asn TestIndef.p12 choice.asn coding-decoding2.asn \ TestIndef2.p12 TestIndef3.der TestCertOctetOverflow.der \ - libtasn1.supp ocsp-basic-response.der \ + libtasn1.supp ocsp-basic-response.der spc_pe_image_data.der \ invalid-x509/id-000000.der invalid-x509/id-000001.der \ invalid-x509/id-000002.der invalid-x509/id-000003.der \ invalid-x509/id-000004.der invalid-x509/id-000005.der \ @@ -43,24 +43,29 @@ EXTRA_DIST = Test_parser.asn Test_tree.asn Test_tree_asn1_tab.c \ invalid-x509/id-000028.der invalid-x509/id-000029.der \ invalid-x509/id-000030.der invalid-x509/id-000031.der \ invalid-x509/id-000032.der invalid-x509/id-000033.der \ - invalid-x509/id-000034.der invalid-x509/id-000035.der + invalid-x509/id-000034.der invalid-x509/id-000035.der \ + invalid-pkcs7/id-000001.der invalid-pkcs7/id-000002.der \ + invalid-pkcs7/id-000003.der # For crlf. EXTRA_DIST += crlf.cer crl.der ocsp.der -dist_check_SCRIPTS = crlf benchmark threadsafety decoding decoding-invalid-x509 +dist_check_SCRIPTS = crlf benchmark threadsafety decoding decoding-invalid-x509 \ + decoding-invalid-pkcs7 MOSTLYCLEANFILES = Test_parser_ERROR.asn check_PROGRAMS = Test_parser Test_tree Test_encoding Test_indefinite \ Test_errors Test_simple Test_overflow Test_strings Test_choice \ Test_encdec copynode coding-decoding2 strict-der Test_choice_ocsp \ - ocsp-basic-response octet-string coding-long-oid object-id-decoding + ocsp-basic-response octet-string coding-long-oid object-id-decoding \ + spc_pe_image_data TESTS = Test_parser Test_tree Test_encoding Test_indefinite \ Test_errors Test_simple Test_overflow crlf threadsafety \ Test_strings Test_choice Test_encdec copynode coding-decoding2 \ strict-der Test_choice_ocsp decoding decoding-invalid-x509 \ - ocsp-basic-response octet-string coding-long-oid object-id-decoding + ocsp-basic-response octet-string coding-long-oid object-id-decoding \ + spc_pe_image_data decoding-invalid-pkcs7 TESTS_ENVIRONMENT = \ ASN1PARSER=$(srcdir)/Test_parser.asn \ @@ -76,6 +81,9 @@ TESTS_ENVIRONMENT = \ ASN1CHOICE_OCSP=$(srcdir)/pkix.asn \ ASN1CHOICE_OCSP_DATA=$(srcdir)/ocsp.der \ ASN1_RESPONSE_OCSP_DATA=$(srcdir)/ocsp-basic-response.der \ + ASN1_MSCAT=$(srcdir)/mscat.asn \ + ASN1_SPC_PE_IMAGE_DATA=$(srcdir)/spc_pe_image_data.der \ + ASAN_OPTIONS="detect_leaks=0:exitcode=6" \ THREADSAFETY_FILES=`find $(top_srcdir)/lib -name \*.c` \ EXEEXT=$(EXEEXT) \ LSAN_OPTIONS=suppressions=libtasn1.supp \ diff --git a/tests/Makefile.in b/tests/Makefile.in index f51866d..fdc6452 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -112,7 +112,7 @@ check_PROGRAMS = Test_parser$(EXEEXT) Test_tree$(EXEEXT) \ coding-decoding2$(EXEEXT) strict-der$(EXEEXT) \ Test_choice_ocsp$(EXEEXT) ocsp-basic-response$(EXEEXT) \ octet-string$(EXEEXT) coding-long-oid$(EXEEXT) \ - object-id-decoding$(EXEEXT) + object-id-decoding$(EXEEXT) spc_pe_image_data$(EXEEXT) TESTS = Test_parser$(EXEEXT) Test_tree$(EXEEXT) Test_encoding$(EXEEXT) \ Test_indefinite$(EXEEXT) Test_errors$(EXEEXT) \ Test_simple$(EXEEXT) Test_overflow$(EXEEXT) crlf threadsafety \ @@ -121,7 +121,8 @@ TESTS = Test_parser$(EXEEXT) Test_tree$(EXEEXT) Test_encoding$(EXEEXT) \ coding-decoding2$(EXEEXT) strict-der$(EXEEXT) \ Test_choice_ocsp$(EXEEXT) decoding decoding-invalid-x509 \ ocsp-basic-response$(EXEEXT) octet-string$(EXEEXT) \ - coding-long-oid$(EXEEXT) object-id-decoding$(EXEEXT) + coding-long-oid$(EXEEXT) object-id-decoding$(EXEEXT) \ + spc_pe_image_data$(EXEEXT) decoding-invalid-pkcs7 subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ @@ -145,6 +146,7 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/largefile.m4 \ + $(top_srcdir)/gl/m4/limits-h.m4 \ $(top_srcdir)/gl/m4/longlong.m4 $(top_srcdir)/gl/m4/lseek.m4 \ $(top_srcdir)/gl/m4/malloc.m4 \ $(top_srcdir)/gl/m4/manywarnings.m4 \ @@ -167,10 +169,10 @@ am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \ $(top_srcdir)/gl/m4/version-etc.m4 \ $(top_srcdir)/gl/m4/warn-on-use.m4 \ $(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ - $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/m4/gtk-doc.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/m4/update-header-version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -253,6 +255,10 @@ octet_string_SOURCES = octet-string.c octet_string_OBJECTS = octet-string.$(OBJEXT) octet_string_LDADD = $(LDADD) octet_string_DEPENDENCIES = ../lib/libtasn1.la ../gl/libgnu.la +spc_pe_image_data_SOURCES = spc_pe_image_data.c +spc_pe_image_data_OBJECTS = spc_pe_image_data.$(OBJEXT) +spc_pe_image_data_LDADD = $(LDADD) +spc_pe_image_data_DEPENDENCIES = ../lib/libtasn1.la ../gl/libgnu.la strict_der_SOURCES = strict-der.c strict_der_OBJECTS = strict-der.$(OBJEXT) strict_der_LDADD = $(LDADD) @@ -296,13 +302,13 @@ SOURCES = Test_choice.c Test_choice_ocsp.c Test_encdec.c \ Test_overflow.c Test_parser.c Test_simple.c Test_strings.c \ Test_tree.c coding-decoding2.c coding-long-oid.c copynode.c \ object-id-decoding.c ocsp-basic-response.c octet-string.c \ - strict-der.c + spc_pe_image_data.c strict-der.c DIST_SOURCES = Test_choice.c Test_choice_ocsp.c Test_encdec.c \ Test_encoding.c Test_errors.c Test_indefinite.c \ Test_overflow.c Test_parser.c Test_simple.c Test_strings.c \ Test_tree.c coding-decoding2.c coding-long-oid.c copynode.c \ object-id-decoding.c ocsp-basic-response.c octet-string.c \ - strict-der.c + spc_pe_image_data.c strict-der.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -681,6 +687,7 @@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ @@ -697,6 +704,7 @@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ @@ -745,6 +753,7 @@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ @@ -773,6 +782,7 @@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ @@ -785,6 +795,7 @@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ @@ -838,6 +849,7 @@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ @@ -863,6 +875,7 @@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ @@ -902,6 +915,7 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ @@ -931,6 +945,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIMITS_H = @LIMITS_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBINTL = @LTLIBINTL@ @@ -943,6 +958,7 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ @@ -956,6 +972,7 @@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ @@ -1049,9 +1066,11 @@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ @@ -1080,6 +1099,7 @@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ @@ -1108,13 +1128,13 @@ STRIP = @STRIP@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VALGRIND = @VALGRIND@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ -WERROR_CFLAGS = @WERROR_CFLAGS@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ @@ -1190,29 +1210,33 @@ LDADD = ../lib/libtasn1.la ../gl/libgnu.la # For crlf. EXTRA_DIST = Test_parser.asn Test_tree.asn Test_tree_asn1_tab.c \ - Test_encoding.asn pkix.asn TestIndef.p12 choice.asn \ + mscat.asn Test_encoding.asn pkix.asn TestIndef.p12 choice.asn \ coding-decoding2.asn TestIndef2.p12 TestIndef3.der \ TestCertOctetOverflow.der libtasn1.supp \ - ocsp-basic-response.der invalid-x509/id-000000.der \ - invalid-x509/id-000001.der invalid-x509/id-000002.der \ - invalid-x509/id-000003.der invalid-x509/id-000004.der \ - invalid-x509/id-000005.der invalid-x509/id-000006.der \ - invalid-x509/id-000007.der invalid-x509/id-000008.der \ - invalid-x509/id-000009.der invalid-x509/id-000010.der \ - invalid-x509/id-000011.der invalid-x509/id-000012.der \ - invalid-x509/id-000013.der invalid-x509/id-000014.der \ - invalid-x509/id-000015.der invalid-x509/id-000016.der \ - invalid-x509/id-000017.der invalid-x509/id-000018.der \ - invalid-x509/id-000019.der invalid-x509/id-000020.der \ - invalid-x509/id-000021.der invalid-x509/id-000022.der \ - invalid-x509/id-000023.der invalid-x509/id-000024.der \ - invalid-x509/id-000025.der invalid-x509/id-000026.der \ - invalid-x509/id-000027.der invalid-x509/id-000028.der \ - invalid-x509/id-000029.der invalid-x509/id-000030.der \ - invalid-x509/id-000031.der invalid-x509/id-000032.der \ - invalid-x509/id-000033.der invalid-x509/id-000034.der \ - invalid-x509/id-000035.der crlf.cer crl.der ocsp.der -dist_check_SCRIPTS = crlf benchmark threadsafety decoding decoding-invalid-x509 + ocsp-basic-response.der spc_pe_image_data.der \ + invalid-x509/id-000000.der invalid-x509/id-000001.der \ + invalid-x509/id-000002.der invalid-x509/id-000003.der \ + invalid-x509/id-000004.der invalid-x509/id-000005.der \ + invalid-x509/id-000006.der invalid-x509/id-000007.der \ + invalid-x509/id-000008.der invalid-x509/id-000009.der \ + invalid-x509/id-000010.der invalid-x509/id-000011.der \ + invalid-x509/id-000012.der invalid-x509/id-000013.der \ + invalid-x509/id-000014.der invalid-x509/id-000015.der \ + invalid-x509/id-000016.der invalid-x509/id-000017.der \ + invalid-x509/id-000018.der invalid-x509/id-000019.der \ + invalid-x509/id-000020.der invalid-x509/id-000021.der \ + invalid-x509/id-000022.der invalid-x509/id-000023.der \ + invalid-x509/id-000024.der invalid-x509/id-000025.der \ + invalid-x509/id-000026.der invalid-x509/id-000027.der \ + invalid-x509/id-000028.der invalid-x509/id-000029.der \ + invalid-x509/id-000030.der invalid-x509/id-000031.der \ + invalid-x509/id-000032.der invalid-x509/id-000033.der \ + invalid-x509/id-000034.der invalid-x509/id-000035.der \ + invalid-pkcs7/id-000001.der invalid-pkcs7/id-000002.der \ + invalid-pkcs7/id-000003.der crlf.cer crl.der ocsp.der +dist_check_SCRIPTS = crlf benchmark threadsafety decoding decoding-invalid-x509 \ + decoding-invalid-pkcs7 + MOSTLYCLEANFILES = Test_parser_ERROR.asn TESTS_ENVIRONMENT = \ ASN1PARSER=$(srcdir)/Test_parser.asn \ @@ -1228,6 +1252,9 @@ TESTS_ENVIRONMENT = \ ASN1CHOICE_OCSP=$(srcdir)/pkix.asn \ ASN1CHOICE_OCSP_DATA=$(srcdir)/ocsp.der \ ASN1_RESPONSE_OCSP_DATA=$(srcdir)/ocsp-basic-response.der \ + ASN1_MSCAT=$(srcdir)/mscat.asn \ + ASN1_SPC_PE_IMAGE_DATA=$(srcdir)/spc_pe_image_data.der \ + ASAN_OPTIONS="detect_leaks=0:exitcode=6" \ THREADSAFETY_FILES=`find $(top_srcdir)/lib -name \*.c` \ EXEEXT=$(EXEEXT) \ LSAN_OPTIONS=suppressions=libtasn1.supp \ @@ -1344,6 +1371,10 @@ octet-string$(EXEEXT): $(octet_string_OBJECTS) $(octet_string_DEPENDENCIES) $(EX @rm -f octet-string$(EXEEXT) $(AM_V_CCLD)$(LINK) $(octet_string_OBJECTS) $(octet_string_LDADD) $(LIBS) +spc_pe_image_data$(EXEEXT): $(spc_pe_image_data_OBJECTS) $(spc_pe_image_data_DEPENDENCIES) $(EXTRA_spc_pe_image_data_DEPENDENCIES) + @rm -f spc_pe_image_data$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(spc_pe_image_data_OBJECTS) $(spc_pe_image_data_LDADD) $(LIBS) + strict-der$(EXEEXT): $(strict_der_OBJECTS) $(strict_der_DEPENDENCIES) $(EXTRA_strict_der_DEPENDENCIES) @rm -f strict-der$(EXEEXT) $(AM_V_CCLD)$(LINK) $(strict_der_OBJECTS) $(strict_der_LDADD) $(LIBS) @@ -1371,6 +1402,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object-id-decoding.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ocsp-basic-response.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/octet-string.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spc_pe_image_data.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strict-der.Po@am__quote@ .c.o: @@ -1747,6 +1779,20 @@ object-id-decoding.log: object-id-decoding$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +spc_pe_image_data.log: spc_pe_image_data$(EXEEXT) + @p='spc_pe_image_data$(EXEEXT)'; \ + b='spc_pe_image_data'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +decoding-invalid-pkcs7.log: decoding-invalid-pkcs7 + @p='decoding-invalid-pkcs7'; \ + b='decoding-invalid-pkcs7'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ diff --git a/tests/Test_choice_ocsp.c b/tests/Test_choice_ocsp.c index d4183b6..33c17fc 100644 --- a/tests/Test_choice_ocsp.c +++ b/tests/Test_choice_ocsp.c @@ -37,7 +37,7 @@ main (int argc, char** argv) exit (1); } - fp = fopen(datafile, "r"); + fp = fopen(datafile, "rb"); if (fp == NULL) { printf ("error in %d\n", __LINE__); diff --git a/tests/coding-long-oid.c b/tests/coding-long-oid.c index bc2cd56..6031cf2 100644 --- a/tests/coding-long-oid.c +++ b/tests/coding-long-oid.c @@ -159,7 +159,7 @@ main (int argc, char** argv) result = asn1_parser2tree (pkixfile, &definitions, errorDescription); if (result != ASN1_SUCCESS) { - printf ("error in %d\n", __LINE__); + printf ("error in %d: %s\n", __LINE__, errorDescription); exit (1); } diff --git a/tests/decoding-invalid-pkcs7 b/tests/decoding-invalid-pkcs7 new file mode 100755 index 0000000..b91d725 --- /dev/null +++ b/tests/decoding-invalid-pkcs7 @@ -0,0 +1,43 @@ +#!/bin/sh + +# Copyright (C) 2017 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +srcdir="${srcdir:-.}" + +if ! test -z "${VALGRIND}";then +VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=7 --leak-check=no" +fi +TMPFILE=decoding-invalid.$$.tmp +ASN1DECODING="${ASN1DECODING:-../src/asn1Decoding$EXEEXT}" +ASN1PKIX="${ASN1PKIX:-pkix.asn}" + +# This tests an invalid input which caused an infinite recursion +# to certain libtasn1 versions. + +for i in "${srcdir}/invalid-pkcs7/"*.der;do +$VALGRIND $ASN1DECODING "$ASN1PKIX" "$i" PKIX1.pkcs-7-ContentInfo >$TMPFILE 2>&1 +ret=$? +if test $ret != 1;then + echo "Decoding failed for $i" + cat $TMPFILE + exit 1 +fi +echo "$(basename $i): ok" +done + +rm -f $TMPFILE + +exit 0 diff --git a/tests/decoding-invalid-x509 b/tests/decoding-invalid-x509 index 01d9cb0..904cda7 100755 --- a/tests/decoding-invalid-x509 +++ b/tests/decoding-invalid-x509 @@ -20,7 +20,7 @@ srcdir="${srcdir:-.}" if ! test -z "${VALGRIND}";then VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=7 --leak-check=no" fi - +TMPFILE=decoding-invalid.$$.tmp ASN1DECODING="${ASN1DECODING:-../src/asn1Decoding$EXEEXT}" ASN1PKIX="${ASN1PKIX:-pkix.asn}" @@ -28,13 +28,16 @@ ASN1PKIX="${ASN1PKIX:-pkix.asn}" # to certain libtasn1 versions. for i in "${srcdir}/invalid-x509/"*.der;do -$VALGRIND $ASN1DECODING "$ASN1PKIX" "$i" PKIX1.Certificate >/dev/null 2>&1 +$VALGRIND $ASN1DECODING "$ASN1PKIX" "$i" PKIX1.Certificate >$TMPFILE 2>&1 ret=$? if test $ret != 1;then echo "Decoding failed for $i" + cat $TMPFILE exit 1 fi echo "$(basename $i): ok" done +rm -f $TMPFILE + exit 0 diff --git a/tests/invalid-pkcs7/id-000001.der b/tests/invalid-pkcs7/id-000001.der Binary files differnew file mode 100644 index 0000000..6c91a25 --- /dev/null +++ b/tests/invalid-pkcs7/id-000001.der diff --git a/tests/invalid-pkcs7/id-000002.der b/tests/invalid-pkcs7/id-000002.der Binary files differnew file mode 100644 index 0000000..9c38f9f --- /dev/null +++ b/tests/invalid-pkcs7/id-000002.der diff --git a/tests/invalid-pkcs7/id-000003.der b/tests/invalid-pkcs7/id-000003.der Binary files differnew file mode 100644 index 0000000..06f6f9c --- /dev/null +++ b/tests/invalid-pkcs7/id-000003.der diff --git a/tests/mscat.asn b/tests/mscat.asn new file mode 100644 index 0000000..beb69f7 --- /dev/null +++ b/tests/mscat.asn @@ -0,0 +1,34 @@ +CATALOG {} +DEFINITIONS IMPLICIT TAGS ::= -- assuming implicit tags, should try explicit too + +BEGIN + +-- SPC_PE_IMAGE_DATA +SpcPEImageData ::= SEQUENCE { + flags SpcPeImageFlags DEFAULT includeResources, + link [0] EXPLICIT SpcLink OPTIONAL +} + +SpcPeImageFlags ::= BIT STRING { + includeResources (0), + includeDebugInfo (1), + includeImportAddressTable (2) +} + +SpcLink ::= CHOICE { + url [0] IMPLICIT IA5String, + moniker [1] IMPLICIT SpcSerializedObject, + file [2] EXPLICIT SpcString +} + +SpcSerializedObject ::= SEQUENCE { + classId OCTET STRING, -- GUID + data OCTET STRING -- Binary structure +} + +SpcString ::= CHOICE { + unicode [0] IMPLICIT BMPString, + ascii [1] IMPLICIT IA5String +} + +END diff --git a/tests/ocsp-basic-response.c b/tests/ocsp-basic-response.c index 701ed53..18ec394 100644 --- a/tests/ocsp-basic-response.c +++ b/tests/ocsp-basic-response.c @@ -1,3 +1,23 @@ +/* + * Copyright (C) 2016 Red Hat, Inc. + * + * This file is part of LIBTASN1. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -36,7 +56,7 @@ main (int argc, char** argv) exit (1); } - fp = fopen(datafile, "r"); + fp = fopen(datafile, "rb"); if (fp == NULL) { fprintf (stderr, "error in %d\n", __LINE__); diff --git a/tests/pkix.asn b/tests/pkix.asn index f5dc6b9..efdf95e 100644 --- a/tests/pkix.asn +++ b/tests/pkix.asn @@ -934,36 +934,31 @@ ub-x121-address-length INTEGER ::= 16 -- Cryptographic Message Syntax pkcs-7-ContentInfo ::= SEQUENCE { - contentType pkcs-7-ContentType, + contentType OBJECT IDENTIFIER, content [0] EXPLICIT ANY DEFINED BY contentType } pkcs-7-DigestInfo ::= SEQUENCE { - digestAlgorithm pkcs-7-DigestAlgorithmIdentifier, - digest pkcs-7-Digest + digestAlgorithm AlgorithmIdentifier, + digest OCTET STRING } -pkcs-7-Digest ::= OCTET STRING - -pkcs-7-ContentType ::= OBJECT IDENTIFIER - pkcs-7-SignedData ::= SEQUENCE { - version pkcs-7-CMSVersion, + version INTEGER, digestAlgorithms pkcs-7-DigestAlgorithmIdentifiers, encapContentInfo pkcs-7-EncapsulatedContentInfo, certificates [0] IMPLICIT pkcs-7-CertificateSet OPTIONAL, crls [1] IMPLICIT pkcs-7-CertificateRevocationLists OPTIONAL, - signerInfos pkcs-7-SignerInfos + signerInfos pkcs-7-SignerInfos } -pkcs-7-CMSVersion ::= INTEGER { v0(0), v1(1), v2(2), v3(3), v4(4) } +pkcs-7-DigestAlgorithmIdentifiers ::= SET OF AlgorithmIdentifier -pkcs-7-DigestAlgorithmIdentifiers ::= SET OF pkcs-7-DigestAlgorithmIdentifier - -pkcs-7-DigestAlgorithmIdentifier ::= AlgorithmIdentifier +-- rfc5652: eContent [0] EXPLICIT OCTET STRING OPTIONAL +-- rfc2315: content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL pkcs-7-EncapsulatedContentInfo ::= SEQUENCE { - eContentType pkcs-7-ContentType, - eContent [0] EXPLICIT OCTET STRING OPTIONAL } + eContentType OBJECT IDENTIFIER, + eContent [0] EXPLICIT ANY OPTIONAL } -- We don't use CertificateList here since we only want -- to read the raw data. @@ -978,8 +973,28 @@ pkcs-7-CertificateChoices ::= CHOICE { pkcs-7-CertificateSet ::= SET OF pkcs-7-CertificateChoices -pkcs-7-SignerInfos ::= SET OF ANY -- this is not correct but we don't use it - -- anyway +IssuerAndSerialNumber ::= SEQUENCE { + issuer Name, + serialNumber CertificateSerialNumber +} + +pkcs-7-SignerInfo ::= SEQUENCE { + version INTEGER, + sid SignerIdentifier, + digestAlgorithm AlgorithmIdentifier, + signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL, + signatureAlgorithm AlgorithmIdentifier, + signature OCTET STRING, + unsignedAttrs [1] IMPLICIT SignedAttributes OPTIONAL } + +SignedAttributes ::= SET SIZE (1..MAX) OF Attribute + +SignerIdentifier ::= CHOICE { + issuerAndSerialNumber IssuerAndSerialNumber, + subjectKeyIdentifier [0] SubjectKeyIdentifier +} + +pkcs-7-SignerInfos ::= SET OF pkcs-7-SignerInfo -- BEGIN of RFC2986 @@ -1158,28 +1173,20 @@ pkcs-12-PKCS12Attribute ::= Attribute -- PKCS #7 stuff (needed in PKCS 12) -pkcs-7-data OBJECT IDENTIFIER ::= { iso(1) member-body(2) - us(840) rsadsi(113549) pkcs(1) pkcs7(7) 1 } - -pkcs-7-encryptedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) - us(840) rsadsi(113549) pkcs(1) pkcs7(7) 6 } - pkcs-7-Data ::= OCTET STRING pkcs-7-EncryptedData ::= SEQUENCE { - version pkcs-7-CMSVersion, + version INTEGER, encryptedContentInfo pkcs-7-EncryptedContentInfo, unprotectedAttrs [1] IMPLICIT pkcs-7-UnprotectedAttributes OPTIONAL } pkcs-7-EncryptedContentInfo ::= SEQUENCE { - contentType pkcs-7-ContentType, + contentType OBJECT IDENTIFIER, contentEncryptionAlgorithm pkcs-7-ContentEncryptionAlgorithmIdentifier, - encryptedContent [0] IMPLICIT pkcs-7-EncryptedContent OPTIONAL } + encryptedContent [0] IMPLICIT OCTET STRING OPTIONAL } pkcs-7-ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier -pkcs-7-EncryptedContent ::= OCTET STRING - pkcs-7-UnprotectedAttributes ::= SET SIZE (1..MAX) OF Attribute -- LDAP stuff diff --git a/tests/spc_pe_image_data.c b/tests/spc_pe_image_data.c new file mode 100644 index 0000000..a6bff0c --- /dev/null +++ b/tests/spc_pe_image_data.c @@ -0,0 +1,148 @@ +/* + * Copyright (C) 2016 Red Hat, Inc. + * + * This file is part of LIBTASN1. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <libtasn1.h> + +int main (int argc, char** argv) +{ + int result = 0, len; + asn1_node definitions = NULL, node1 = NULL; + char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; + const char *choicefile = getenv ("ASN1_MSCAT"); + const char *datafile = getenv ("ASN1_SPC_PE_IMAGE_DATA"); + FILE *fp; + char data[1024]; + int data_size = sizeof (data); + unsigned etype; + int cmp; + + if (choicefile == NULL) { + choicefile = "mscat.asn"; + } + + if (datafile == NULL) { + datafile = "spc_pe_image_data.der"; + } + + result = asn1_parser2tree(choicefile, &definitions, errorDescription); + if (result != ASN1_SUCCESS) { + fprintf(stderr, "error in %d: %s\n", __LINE__, errorDescription); + exit (1); + } + + result = asn1_create_element(definitions, + "CATALOG.SpcPEImageData", + &node1); + if (result != ASN1_SUCCESS) { + fprintf(stderr, "error in %d\n", __LINE__); + exit (1); + } + + fp = fopen(datafile, "rb"); + if (fp == NULL) { + fprintf (stderr, "error in %d\n", __LINE__); + exit(1); + } + data_size = fread(data, 1, sizeof(data), fp); + fclose(fp); + + result = asn1_der_decoding2(&node1, + data, + &data_size, + ASN1_DECODE_FLAG_STRICT_DER, + errorDescription); + if (result != ASN1_SUCCESS) { + fprintf(stderr, "error in %d: decoding: %s\n", __LINE__, errorDescription); + exit(1); + } + + len = 0; + result = asn1_read_value_type(node1, + "flags", + NULL, + &len, + &etype); + if (result != ASN1_MEM_ERROR) { + fprintf(stderr, "error in %d: %s\n", __LINE__, errorDescription); + exit(1); + } + + if ((size_t)len >= sizeof(data)) { + fprintf(stderr, + "error len=%d, sizeof(data)=%zu\n", + len, + sizeof(data)); + exit(1); + } + + result = asn1_read_value(node1, "flags", data, &len); + if (result != ASN1_SUCCESS) { + fprintf(stderr, "error in %d: %s\n", __LINE__, errorDescription); + exit (1); + } + + etype = 0; + len = 0; + result = asn1_read_value_type(node1, "link", NULL, &len, &etype); + if (result != ASN1_MEM_ERROR) + { + fprintf(stderr, + "error in %d: result is: %s\n", + __LINE__, + asn1_strerror(result)); + exit(1); + } + + if (etype != ASN1_ETYPE_CHOICE) { + fprintf(stderr, + "error in %d: The type (%u) doesn't match choice.\n", + __LINE__, + etype); + exit(1); + } + + if (len != 5) { + fprintf (stderr, "length doesn't match the expected (got: %d, should be: 20)\n", len); + exit (1); + } + + len = sizeof(data); + result = asn1_read_value(node1, "link", data, &len); + if (result != ASN1_SUCCESS) { + fprintf(stderr, "error in %d: %s\n", __LINE__, errorDescription); + exit (1); + } + + cmp = memcmp(data, "file", len); + if (cmp != 0) { + fprintf(stderr, "contents don't match\n"); + exit(1); + } + + printf("SUCCESS\n"); + + asn1_delete_structure (&node1); + asn1_delete_structure (&definitions); + + return 0; +} diff --git a/tests/spc_pe_image_data.der b/tests/spc_pe_image_data.der Binary files differnew file mode 100644 index 0000000..0e72dfa --- /dev/null +++ b/tests/spc_pe_image_data.der |