; Update from Gnulib

* configure.ac:

* src/conf_post.h: Remove workarounds now rendered redundant by
Gnulib.
This commit is contained in:
Po Lu 2024-09-05 08:41:11 +08:00
parent a13eef1fae
commit 1a13c5e63e
57 changed files with 2048 additions and 925 deletions

View file

@ -54,7 +54,8 @@ GNULIB_MODULES='
AVOIDED_MODULES=' AVOIDED_MODULES='
access btowc chmod close crypto/af_alg dup fchdir fstat access btowc chmod close crypto/af_alg dup fchdir fstat
iswblank iswctype iswdigit iswxdigit langinfo localename-unsafe-limited lock iswblank iswctype iswdigit iswxdigit langinfo libgmp-mpq
localename-unsafe-limited lock
mbrtowc mbsinit memchr mkdir msvc-inval msvc-nothrow nl_langinfo mbrtowc mbsinit memchr mkdir msvc-inval msvc-nothrow nl_langinfo
openat-die opendir pthread-h raise openat-die opendir pthread-h raise
save-cwd select setenv sigprocmask stat stdarg save-cwd select setenv sigprocmask stat stdarg
@ -125,7 +126,6 @@ rm -- "$src"lib/gl_openssl.h \
"$src"m4/fcntl-o.m4 \ "$src"m4/fcntl-o.m4 \
"$src"m4/gl-openssl.m4 \ "$src"m4/gl-openssl.m4 \
"$src"m4/gnulib-cache.m4 "$src"m4/gnulib-tool.m4 \ "$src"m4/gnulib-cache.m4 "$src"m4/gnulib-tool.m4 \
"$src"m4/locale-fr.m4 \
"$src"m4/manywarnings-c++.m4 \ "$src"m4/manywarnings-c++.m4 \
"$src"m4/off64_t.m4 \ "$src"m4/off64_t.m4 \
"$src"m4/warn-on-use.m4 "$src"m4/wint_t.m4 && "$src"m4/warn-on-use.m4 "$src"m4/wint_t.m4 &&

View file

@ -4,7 +4,7 @@
# shellcheck disable=SC2006,SC2268 # see below for rationale # shellcheck disable=SC2006,SC2268 # see below for rationale
timestamp='2024-01-01' timestamp='2024-07-27'
# This file is free software; you can redistribute it and/or modify it # 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 # under the terms of the GNU General Public License as published by
@ -123,7 +123,7 @@ set_cc_for_build() {
dummy=$tmp/dummy dummy=$tmp/dummy
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
,,) echo "int x;" > "$dummy.c" ,,) echo "int x;" > "$dummy.c"
for driver in cc gcc c89 c99 ; do for driver in cc gcc c17 c99 c89 ; do
if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
CC_FOR_BUILD=$driver CC_FOR_BUILD=$driver
break break
@ -634,7 +634,8 @@ EOF
sed 's/^ //' << EOF > "$dummy.c" sed 's/^ //' << EOF > "$dummy.c"
#include <sys/systemcfg.h> #include <sys/systemcfg.h>
main() int
main ()
{ {
if (!__power_pc()) if (!__power_pc())
exit(1); exit(1);
@ -718,7 +719,8 @@ EOF
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
int main () int
main ()
{ {
#if defined(_SC_KERNEL_BITS) #if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS); long bits = sysconf(_SC_KERNEL_BITS);
@ -1621,6 +1623,7 @@ cat > "$dummy.c" <<EOF
#endif #endif
#endif #endif
#endif #endif
int
main () main ()
{ {
#if defined (sony) #if defined (sony)

729
build-aux/config.sub vendored
View file

@ -2,9 +2,9 @@
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright 1992-2024 Free Software Foundation, Inc. # Copyright 1992-2024 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale # shellcheck disable=SC2006,SC2268,SC2162 # see below for rationale
timestamp='2024-01-01' timestamp='2024-05-27'
# This file is free software; you can redistribute it and/or modify it # 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 # under the terms of the GNU General Public License as published by
@ -120,7 +120,6 @@ case $# in
esac esac
# Split fields of configuration type # Split fields of configuration type
# shellcheck disable=SC2162
saved_IFS=$IFS saved_IFS=$IFS
IFS="-" read field1 field2 field3 field4 <<EOF IFS="-" read field1 field2 field3 field4 <<EOF
$1 $1
@ -142,10 +141,20 @@ case $1 in
# parts # parts
maybe_os=$field2-$field3 maybe_os=$field2-$field3
case $maybe_os in case $maybe_os in
nto-qnx* | linux-* | uclinux-uclibc* \ cloudabi*-eabi* \
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | kfreebsd*-gnu* \
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | knetbsd*-gnu* \
| storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \ | kopensolaris*-gnu* \
| linux-* \
| managarm-* \
| netbsd*-eabi* \
| netbsd*-gnu* \
| nto-qnx* \
| os2-emx* \
| rtmk-nova* \
| storm-chaos* \
| uclinux-gnu* \
| uclinux-uclibc* \
| windows-* ) | windows-* )
basic_machine=$field1 basic_machine=$field1
basic_os=$maybe_os basic_os=$maybe_os
@ -161,8 +170,12 @@ case $1 in
esac esac
;; ;;
*-*) *-*)
# A lone config we happen to match not fitting any pattern
case $field1-$field2 in case $field1-$field2 in
# Shorthands that happen to contain a single dash
convex-c[12] | convex-c3[248])
basic_machine=$field2-convex
basic_os=
;;
decstation-3100) decstation-3100)
basic_machine=mips-dec basic_machine=mips-dec
basic_os= basic_os=
@ -170,28 +183,88 @@ case $1 in
*-*) *-*)
# Second component is usually, but not always the OS # Second component is usually, but not always the OS
case $field2 in case $field2 in
# Prevent following clause from handling this valid os # Do not treat sunos as a manufacturer
sun*os*) sun*os*)
basic_machine=$field1 basic_machine=$field1
basic_os=$field2 basic_os=$field2
;; ;;
# Manufacturers
3100* \
| 32* \
| 3300* \
| 3600* \
| 7300* \
| acorn \
| altos* \
| apollo \
| apple \
| atari \
| att* \
| axis \
| be \
| bull \
| cbm \
| ccur \
| cisco \
| commodore \
| convergent* \
| convex* \
| cray \
| crds \
| dec* \
| delta* \
| dg \
| digital \
| dolphin \
| encore* \
| gould \
| harris \
| highlevel \
| hitachi* \
| hp \
| ibm* \
| intergraph \
| isi* \
| knuth \
| masscomp \
| microblaze* \
| mips* \
| motorola* \
| ncr* \
| news \
| next \
| ns \
| oki \
| omron* \
| pc533* \
| rebel \
| rom68k \
| rombug \
| semi \
| sequent* \
| siemens \
| sgi* \
| siemens \
| sim \
| sni \
| sony* \
| stratus \
| sun \
| sun[234]* \
| tektronix \
| tti* \
| ultra \
| unicom* \
| wec \
| winbond \
| wrs)
basic_machine=$field1-$field2
basic_os=
;;
zephyr*) zephyr*)
basic_machine=$field1-unknown basic_machine=$field1-unknown
basic_os=$field2 basic_os=$field2
;; ;;
# Manufacturers
dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
| unicom* | ibm* | next | hp | isi* | apollo | altos* \
| convergent* | ncr* | news | 32* | 3600* | 3100* \
| hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
| ultra | tti* | harris | dolphin | highlevel | gould \
| cbm | ns | masscomp | apple | axis | knuth | cray \
| microblaze* | sim | cisco \
| oki | wec | wrs | winbond)
basic_machine=$field1-$field2
basic_os=
;;
*) *)
basic_machine=$field1 basic_machine=$field1
basic_os=$field2 basic_os=$field2
@ -272,26 +345,6 @@ case $1 in
basic_machine=arm-unknown basic_machine=arm-unknown
basic_os=cegcc basic_os=cegcc
;; ;;
convex-c1)
basic_machine=c1-convex
basic_os=bsd
;;
convex-c2)
basic_machine=c2-convex
basic_os=bsd
;;
convex-c32)
basic_machine=c32-convex
basic_os=bsd
;;
convex-c34)
basic_machine=c34-convex
basic_os=bsd
;;
convex-c38)
basic_machine=c38-convex
basic_os=bsd
;;
cray) cray)
basic_machine=j90-cray basic_machine=j90-cray
basic_os=unicos basic_os=unicos
@ -714,15 +767,26 @@ case $basic_machine in
vendor=dec vendor=dec
basic_os=tops20 basic_os=tops20
;; ;;
delta | 3300 | motorola-3300 | motorola-delta \ delta | 3300 | delta-motorola | 3300-motorola | motorola-delta | motorola-3300)
| 3300-motorola | delta-motorola)
cpu=m68k cpu=m68k
vendor=motorola vendor=motorola
;; ;;
dpx2*) # This used to be dpx2*, but that gets the RS6000-based
# DPX/20 and the x86-based DPX/2-100 wrong. See
# https://oldskool.silicium.org/stations/bull_dpx20.htm
# https://www.feb-patrimoine.com/english/bull_dpx2.htm
# https://www.feb-patrimoine.com/english/unix_and_bull.htm
dpx2 | dpx2[23]00 | dpx2[23]xx)
cpu=m68k cpu=m68k
vendor=bull vendor=bull
basic_os=sysv3 ;;
dpx2100 | dpx21xx)
cpu=i386
vendor=bull
;;
dpx20)
cpu=rs6000
vendor=bull
;; ;;
encore | umax | mmax) encore | umax | mmax)
cpu=ns32k cpu=ns32k
@ -837,18 +901,6 @@ case $basic_machine in
next | m*-next) next | m*-next)
cpu=m68k cpu=m68k
vendor=next vendor=next
case $basic_os in
openstep*)
;;
nextstep*)
;;
ns2*)
basic_os=nextstep2
;;
*)
basic_os=nextstep3
;;
esac
;; ;;
np1) np1)
cpu=np1 cpu=np1
@ -937,7 +989,6 @@ case $basic_machine in
;; ;;
*-*) *-*)
# shellcheck disable=SC2162
saved_IFS=$IFS saved_IFS=$IFS
IFS="-" read cpu vendor <<EOF IFS="-" read cpu vendor <<EOF
$basic_machine $basic_machine
@ -972,15 +1023,19 @@ unset -v basic_machine
# Decode basic machines in the full and proper CPU-Company form. # Decode basic machines in the full and proper CPU-Company form.
case $cpu-$vendor in case $cpu-$vendor in
# Here we handle the default manufacturer of certain CPU types in canonical form. It is in # Here we handle the default manufacturer of certain CPU types in canonical form.
# some cases the only manufacturer, in others, it is the most popular. # It is in some cases the only manufacturer, in others, it is the most popular.
c[12]-convex | c[12]-unknown | c3[248]-convex | c3[248]-unknown)
vendor=convex
basic_os=${basic_os:-bsd}
;;
craynv-unknown) craynv-unknown)
vendor=cray vendor=cray
basic_os=${basic_os:-unicosmp} basic_os=${basic_os:-unicosmp}
;; ;;
c90-unknown | c90-cray) c90-unknown | c90-cray)
vendor=cray vendor=cray
basic_os=${Basic_os:-unicos} basic_os=${basic_os:-unicos}
;; ;;
fx80-unknown) fx80-unknown)
vendor=alliant vendor=alliant
@ -1026,11 +1081,29 @@ case $cpu-$vendor in
vendor=alt vendor=alt
basic_os=${basic_os:-linux-gnueabihf} basic_os=${basic_os:-linux-gnueabihf}
;; ;;
dpx20-unknown | dpx20-bull)
cpu=rs6000 # Normalized CPU+vendor pairs that imply an OS, if not otherwise specified
vendor=bull m68k-isi)
basic_os=${basic_os:-sysv}
;;
m68k-sony)
basic_os=${basic_os:-newsos}
;;
m68k-tektronix)
basic_os=${basic_os:-bsd}
;;
m88k-harris)
basic_os=${basic_os:-sysv3}
;;
i386-bull | m68k-bull)
basic_os=${basic_os:-sysv3}
;;
rs6000-bull)
basic_os=${basic_os:-bosx} basic_os=${basic_os:-bosx}
;; ;;
mips-sni)
basic_os=${basic_os:-sysv4}
;;
# Here we normalize CPU types irrespective of the vendor # Here we normalize CPU types irrespective of the vendor
amd64-*) amd64-*)
@ -1038,7 +1111,7 @@ case $cpu-$vendor in
;; ;;
blackfin-*) blackfin-*)
cpu=bfin cpu=bfin
basic_os=linux basic_os=${basic_os:-linux}
;; ;;
c54x-*) c54x-*)
cpu=tic54x cpu=tic54x
@ -1061,7 +1134,7 @@ case $cpu-$vendor in
;; ;;
m68knommu-*) m68knommu-*)
cpu=m68k cpu=m68k
basic_os=linux basic_os=${basic_os:-linux}
;; ;;
m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*) m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
cpu=s12z cpu=s12z
@ -1071,7 +1144,7 @@ case $cpu-$vendor in
;; ;;
parisc-*) parisc-*)
cpu=hppa cpu=hppa
basic_os=linux basic_os=${basic_os:-linux}
;; ;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
cpu=i586 cpu=i586
@ -1085,9 +1158,6 @@ case $cpu-$vendor in
pentium4-*) pentium4-*)
cpu=i786 cpu=i786
;; ;;
pc98-*)
cpu=i386
;;
ppc-* | ppcbe-*) ppc-* | ppcbe-*)
cpu=powerpc cpu=powerpc
;; ;;
@ -1121,9 +1191,6 @@ case $cpu-$vendor in
tx39el-*) tx39el-*)
cpu=mipstx39el cpu=mipstx39el
;; ;;
x64-*)
cpu=x86_64
;;
xscale-* | xscalee[bl]-*) xscale-* | xscalee[bl]-*)
cpu=`echo "$cpu" | sed 's/^xscale/arm/'` cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
;; ;;
@ -1179,90 +1246,227 @@ case $cpu-$vendor in
# Recognize the canonical CPU types that are allowed with any # Recognize the canonical CPU types that are allowed with any
# company name. # company name.
case $cpu in case $cpu in
1750a | 580 \ 1750a \
| 580 \
| [cjt]90 \
| a29k \ | a29k \
| aarch64 | aarch64_be | aarch64c | arm64ec \ | aarch64 \
| aarch64_be \
| aarch64c \
| abacus \ | abacus \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ | alpha \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ | alpha64 \
| alphapca5[67] | alpha64pca5[67] \ | alpha64ev56 \
| alpha64ev6[78] \
| alpha64ev[4-8] \
| alpha64pca5[67] \
| alphaev56 \
| alphaev6[78] \
| alphaev[4-8] \
| alphapca5[67] \
| am33_2.0 \ | am33_2.0 \
| amdgcn \ | amdgcn \
| arc | arceb | arc32 | arc64 \ | arc \
| arm | arm[lb]e | arme[lb] | armv* \ | arc32 \
| avr | avr32 \ | arc64 \
| arceb \
| arm \
| arm64e \
| arm64ec \
| arm[lb]e \
| arme[lb] \
| armv* \
| asmjs \ | asmjs \
| avr \
| avr32 \
| ba \ | ba \
| be32 | be64 \ | be32 \
| bfin | bpf | bs2000 \ | be64 \
| c[123]* | c30 | [cjt]90 | c4x \ | bfin \
| c8051 | clipper | craynv | csky | cydra \ | bpf \
| d10v | d30v | dlx | dsp16xx \ | bs2000 \
| e2k | elxsi | epiphany \ | c30 \
| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ | c4x \
| javascript \ | c8051 \
| h8300 | h8500 \ | c[123]* \
| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | clipper \
| craynv \
| csky \
| cydra \
| d10v \
| d30v \
| dlx \
| dsp16xx \
| e2k \
| elxsi \
| epiphany \
| f30[01] \
| f700 \
| fido \
| fr30 \
| frv \
| ft32 \
| fx80 \
| h8300 \
| h8500 \
| hexagon \ | hexagon \
| i370 | i*86 | i860 | i960 | ia16 | ia64 \ | hppa \
| ip2k | iq2000 \ | hppa1.[01] \
| hppa2.0 \
| hppa2.0[nw] \
| hppa64 \
| i*86 \
| i370 \
| i860 \
| i960 \
| ia16 \
| ia64 \
| ip2k \
| iq2000 \
| javascript \
| k1om \ | k1om \
| kvx \ | kvx \
| le32 | le64 \ | le32 \
| le64 \
| lm32 \ | lm32 \
| loongarch32 | loongarch64 \ | loongarch32 \
| m32c | m32r | m32rle \ | loongarch64 \
| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ | m32c \
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ | m32r \
| m88110 | m88k | maxq | mb | mcore | mep | metag \ | m32rle \
| microblaze | microblazeel \ | m5200 \
| m68000 \
| m680[012346]0 \
| m6811 \
| m6812 \
| m68360 \
| m683?2 \
| m68hc11 \
| m68hc12 \
| m68hcs12x \
| m68k \
| m88110 \
| m88k \
| maxq \
| mb \
| mcore \
| mep \
| metag \
| microblaze \
| microblazeel \
| mips* \ | mips* \
| mmix \ | mmix \
| mn10200 | mn10300 \ | mn10200 \
| mn10300 \
| moxie \ | moxie \
| mt \
| msp430 \ | msp430 \
| mt \
| nanomips* \ | nanomips* \
| nds32 | nds32le | nds32be \ | nds32 \
| nds32be \
| nds32le \
| nfp \ | nfp \
| nios | nios2 | nios2eb | nios2el \ | nios \
| none | np1 | ns16k | ns32k | nvptx \ | nios2 \
| nios2eb \
| nios2el \
| none \
| np1 \
| ns16k \
| ns32k \
| nvptx \
| open8 \ | open8 \
| or1k* \ | or1k* \
| or32 \ | or32 \
| orion \ | orion \
| pdp10 \
| pdp11 \
| picochip \ | picochip \
| pdp10 | pdp11 | pj | pjl | pn | power \ | pj \
| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ | pjl \
| pn \
| power \
| powerpc \
| powerpc64 \
| powerpc64le \
| powerpcle \
| powerpcspe \
| pru \ | pru \
| pyramid \ | pyramid \
| riscv | riscv32 | riscv32be | riscv64 | riscv64be \ | riscv \
| rl78 | romp | rs6000 | rx \ | riscv32 \
| s390 | s390x \ | riscv32be \
| riscv64 \
| riscv64be \
| rl78 \
| romp \
| rs6000 \
| rx \
| s390 \
| s390x \
| score \ | score \
| sh | shl \ | sh \
| sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ | sh64 \
| sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ | sh[12345][lb]e \
| sh[1234] \
| sh[1234]e[lb] \
| sh[23]e \
| sh[23]ele \
| sh[24]a \
| sh[24]ae[lb] \
| sh[lb]e \
| she[lb] \
| shl \
| sparc \
| sparc64 \
| sparc64b \
| sparc64v \
| sparc86x \
| sparclet \
| sparclite \ | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ | sparcv8 \
| sparcv9 \
| sparcv9b \
| sparcv9v \
| spu \ | spu \
| sv1 \
| sx* \
| tahoe \ | tahoe \
| thumbv7* \ | thumbv7* \
| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ | tic30 \
| tic4x \
| tic54x \
| tic55x \
| tic6x \
| tic80 \
| tron \ | tron \
| ubicom32 \ | ubicom32 \
| v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ | v70 \
| v810 \
| v850 \
| v850e \
| v850e1 \
| v850e2 \
| v850e2v3 \
| v850es \
| vax \ | vax \
| vc4 \ | vc4 \
| visium \ | visium \
| w65 \ | w65 \
| wasm32 | wasm64 \ | wasm32 \
| wasm64 \
| we32k \ | we32k \
| x86 | x86_64 | xc16x | xgate | xps100 \ | x86 \
| xstormy16 | xtensa* \ | x86_64 \
| xc16x \
| xgate \
| xps100 \
| xstormy16 \
| xtensa* \
| ymp \ | ymp \
| z8k | z80) | z80 \
| z8k)
;; ;;
*) *)
@ -1307,7 +1511,6 @@ case $basic_os in
os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
;; ;;
*-*) *-*)
# shellcheck disable=SC2162
saved_IFS=$IFS saved_IFS=$IFS
IFS="-" read kernel os <<EOF IFS="-" read kernel os <<EOF
$basic_os $basic_os
@ -1354,6 +1557,23 @@ case $os in
unixware*) unixware*)
os=sysv4.2uw os=sysv4.2uw
;; ;;
# The marketing names for NeXT's operating systems were
# NeXTSTEP, NeXTSTEP 2, OpenSTEP 3, OpenSTEP 4. 'openstep' is
# mapped to 'openstep3', but 'openstep1' and 'openstep2' are
# mapped to 'nextstep' and 'nextstep2', consistent with the
# treatment of SunOS/Solaris.
ns | ns1 | nextstep | nextstep1 | openstep1)
os=nextstep
;;
ns2 | nextstep2 | openstep2)
os=nextstep2
;;
ns3 | nextstep3 | openstep | openstep3)
os=openstep3
;;
ns4 | nextstep4 | openstep4)
os=openstep4
;;
# es1800 is here to avoid being matched by es* (a different OS) # es1800 is here to avoid being matched by es* (a different OS)
es1800*) es1800*)
os=ose os=ose
@ -1424,6 +1644,7 @@ case $os in
;; ;;
utek*) utek*)
os=bsd os=bsd
vendor=`echo "$vendor" | sed -e 's|^unknown$|tektronix|'`
;; ;;
dynix*) dynix*)
os=bsd os=bsd
@ -1440,21 +1661,25 @@ case $os in
386bsd) 386bsd)
os=bsd os=bsd
;; ;;
ctix* | uts*) ctix*)
os=sysv
vendor=`echo "$vendor" | sed -e 's|^unknown$|convergent|'`
;;
uts*)
os=sysv os=sysv
;; ;;
nova*) nova*)
os=rtmk-nova kernel=rtmk
;; os=nova
ns2)
os=nextstep2
;; ;;
# Preserve the version number of sinix5. # Preserve the version number of sinix5.
sinix5.*) sinix5.*)
os=`echo "$os" | sed -e 's|sinix|sysv|'` os=`echo "$os" | sed -e 's|sinix|sysv|'`
vendor=`echo "$vendor" | sed -e 's|^unknown$|sni|'`
;; ;;
sinix*) sinix*)
os=sysv4 os=sysv4
vendor=`echo "$vendor" | sed -e 's|^unknown$|sni|'`
;; ;;
tpf*) tpf*)
os=tpf os=tpf
@ -1595,6 +1820,14 @@ case $cpu-$vendor in
os= os=
obj=elf obj=elf
;; ;;
# The -sgi and -siemens entries must be before the mips- entry
# or we get the wrong os.
*-sgi)
os=irix
;;
*-siemens)
os=sysv4
;;
mips*-cisco) mips*-cisco)
os= os=
obj=elf obj=elf
@ -1607,7 +1840,8 @@ case $cpu-$vendor in
os= os=
obj=coff obj=coff
;; ;;
*-tti) # must be before sparc entry or we get the wrong os. # This must be before the sparc-* entry or we get the wrong os.
*-tti)
os=sysv3 os=sysv3
;; ;;
sparc-* | *-sun) sparc-* | *-sun)
@ -1639,7 +1873,7 @@ case $cpu-$vendor in
os=hpux os=hpux
;; ;;
*-hitachi) *-hitachi)
os=hiux os=hiuxwe2
;; ;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=sysv os=sysv
@ -1683,12 +1917,6 @@ case $cpu-$vendor in
*-encore) *-encore)
os=bsd os=bsd
;; ;;
*-sgi)
os=irix
;;
*-siemens)
os=sysv4
;;
*-masscomp) *-masscomp)
os=rtu os=rtu
;; ;;
@ -1735,40 +1963,193 @@ case $os in
ghcjs) ghcjs)
;; ;;
# Now accept the basic system types. # Now accept the basic system types.
# The portable systems comes first.
# Each alternative MUST end in a * to match a version number. # Each alternative MUST end in a * to match a version number.
gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ abug \
| *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ | aix* \
| hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ | amdhsa* \
| sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ | amigados* \
| hiux* | abug | nacl* | netware* | windows* \ | amigaos* \
| os9* | macos* | osx* | ios* | tvos* | watchos* \ | android* \
| mpw* | magic* | mmixware* | mon960* | lnews* \ | aof* \
| amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ | aos* \
| aos* | aros* | cloudabi* | sortix* | twizzler* \ | aros* \
| nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ | atheos* \
| clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ | auroraux* \
| mirbsd* | netbsd* | dicos* | openedition* | ose* \ | aux* \
| bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ | beos* \
| ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ | bitrig* \
| bosx* | nextstep* | cxux* | oabi* \ | bme* \
| ptx* | ecoff* | winnt* | domain* | vsta* \ | bosx* \
| udi* | lites* | ieee* | go32* | aux* | hcos* \ | bsd* \
| chorusrdb* | cegcc* | glidix* | serenity* \ | cegcc* \
| cygwin* | msys* | moss* | proelf* | rtems* \ | chorusos* \
| midipix* | mingw32* | mingw64* | mint* \ | chorusrdb* \
| uxpv* | beos* | mpeix* | udk* | moxiebox* \ | clix* \
| interix* | uwin* | mks* | rhapsody* | darwin* \ | cloudabi* \
| openstep* | oskit* | conix* | pw32* | nonstopux* \ | cnk* \
| storm-chaos* | tops10* | tenex* | tops20* | its* \ | conix* \
| os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ | cos* \
| scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ | cxux* \
| powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ | cygwin* \
| skyos* | haiku* | rdos* | toppers* | drops* | es* \ | darwin* \
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | dgux* \
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ | dicos* \
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ | dnix* \
| fiwix* | mlibc* | cos* | mbr* | ironclad* ) | domain* \
| dragonfly* \
| drops* \
| ebmon* \
| ecoff* \
| ekkobsd* \
| emscripten* \
| emx* \
| es* \
| fiwix* \
| freebsd* \
| fuchsia* \
| genix* \
| genode* \
| glidix* \
| gnu* \
| go32* \
| haiku* \
| hcos* \
| hiux* \
| hms* \
| hpux* \
| ieee* \
| interix* \
| ios* \
| iris* \
| irix* \
| ironclad* \
| isc* \
| its* \
| l4re* \
| libertybsd* \
| lites* \
| lnews* \
| luna* \
| lynxos* \
| mach* \
| macos* \
| magic* \
| mbr* \
| midipix* \
| midnightbsd* \
| mingw32* \
| mingw64* \
| minix* \
| mint* \
| mirbsd* \
| mks* \
| mlibc* \
| mmixware* \
| mon960* \
| morphos* \
| moss* \
| moxiebox* \
| mpeix* \
| mpw* \
| msdos* \
| msys* \
| mvs* \
| nacl* \
| netbsd* \
| netware* \
| newsos* \
| nextstep* \
| nindy* \
| nonstopux* \
| nova* \
| nsk* \
| nucleus* \
| nx6 \
| nx7 \
| oabi* \
| ohos* \
| onefs* \
| openbsd* \
| openedition* \
| openstep* \
| os108* \
| os2* \
| os400* \
| os68k* \
| os9* \
| ose* \
| osf* \
| oskit* \
| osx* \
| palmos* \
| phoenix* \
| plan9* \
| powermax* \
| powerunix* \
| proelf* \
| psos* \
| psp* \
| ptx* \
| pw32* \
| qnx* \
| rdos* \
| redox* \
| rhapsody* \
| riscix* \
| riscos* \
| rtems* \
| rtmk* \
| rtu* \
| scout* \
| secbsd* \
| sei* \
| serenity* \
| sim* \
| skyos* \
| solaris* \
| solidbsd* \
| sortix* \
| storm-chaos* \
| sunos \
| sunos[34]* \
| superux* \
| syllable* \
| sym* \
| sysv* \
| tenex* \
| tirtos* \
| toppers* \
| tops10* \
| tops20* \
| tpf* \
| tvos* \
| twizzler* \
| uclinux* \
| udi* \
| udk* \
| ultrix* \
| unicos* \
| uniplus* \
| unleashed* \
| unos* \
| uwin* \
| uxpv* \
| v88r* \
|*vms* \
| vos* \
| vsta* \
| vxsim* \
| vxworks* \
| wasi* \
| watchos* \
| wince* \
| windiss* \
| windows* \
| winnt* \
| xenix* \
| xray* \
| zephyr* \
| zvmoe* )
;; ;;
# This one is extra strict with allowed versions # This one is extra strict with allowed versions
sco3.2v2 | sco3.2v[4-9]* | sco5v6*) sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
@ -1829,9 +2210,9 @@ esac
case $kernel-$os-$obj in case $kernel-$os-$obj in
linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \
| linux-mlibc*- | linux-musl*- | linux-newlib*- \ | linux-mlibc*- | linux-musl*- | linux-newlib*- \
| linux-relibc*- | linux-uclibc*- ) | linux-relibc*- | linux-uclibc*- | linux-ohos*- )
;; ;;
uclinux-uclibc*- ) uclinux-uclibc*- | uclinux-gnu*- )
;; ;;
managarm-mlibc*- | managarm-kernel*- ) managarm-mlibc*- | managarm-kernel*- )
;; ;;
@ -1856,7 +2237,7 @@ case $kernel-$os-$obj in
echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2
exit 1 exit 1
;; ;;
kfreebsd*-gnu*- | kopensolaris*-gnu*-) kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-)
;; ;;
vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-)
;; ;;
@ -1864,6 +2245,8 @@ case $kernel-$os-$obj in
;; ;;
os2-emx-) os2-emx-)
;; ;;
rtmk-nova-)
;;
*-eabi*- | *-gnueabi*-) *-eabi*- | *-gnueabi*-)
;; ;;
none--*) none--*)
@ -1890,7 +2273,7 @@ case $vendor in
*-riscix*) *-riscix*)
vendor=acorn vendor=acorn
;; ;;
*-sunos*) *-sunos* | *-solaris*)
vendor=sun vendor=sun
;; ;;
*-cnk* | *-aix*) *-cnk* | *-aix*)

View file

@ -35,12 +35,14 @@
eval 'exec perl -wSx "$0" "$@"' eval 'exec perl -wSx "$0" "$@"'
if 0; if 0;
my $VERSION = '2024-07-04 10:56'; # UTC my $VERSION = '2024-07-17 02:20'; # UTC
# The definition above must lie within the first 8 lines in order # The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it. # for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook # If you change this file with Emacs, please let the write hook
# do its job. Otherwise, update this string manually. # do its job. Otherwise, update this string manually.
(my $copyright_year = $VERSION) =~ s/^(\d*)-.*$/$1/;
use strict; use strict;
use warnings; use warnings;
use Getopt::Long; use Getopt::Long;
@ -138,11 +140,24 @@ s/all tile types/all file types/
# Change the author to be Paul. Note the escaped "@": # Change the author to be Paul. Note the escaped "@":
s,Jim .*>,Paul Eggert <eggert\\\@cs.ucla.edu>, s,Jim .*>,Paul Eggert <eggert\\\@cs.ucla.edu>,
Send patches and bug reports to <bug-gnulib\@gnu.org>.
EOF EOF
} }
exit $exit_code; exit $exit_code;
} }
sub print_version ()
{
print "$ME version $VERSION\n";
print "Copyright (C) $copyright_year Free Software Foundation, Inc.\n";
print "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>\n"
. "This is free software: you are free to change and redistribute it.\n"
. "There is NO WARRANTY, to the extent permitted by law.\n";
print "\n";
my $author = "Jim Meyering";
print "Written by $author.\n";
}
# If the string $S is a well-behaved file name, simply return it. # If the string $S is a well-behaved file name, simply return it.
# If it contains white space, quotes, etc., quote it, and return the new string. # If it contains white space, quotes, etc., quote it, and return the new string.
sub shell_quote($) sub shell_quote($)
@ -253,7 +268,7 @@ sub git_dir_option($)
GetOptions GetOptions
( (
help => sub { usage 0 }, help => sub { usage 0 },
version => sub { print "$ME version $VERSION\n"; exit }, version => sub { print_version; exit },
'since=s' => \$since_date, 'since=s' => \$since_date,
'until=s' => \$until_date, 'until=s' => \$until_date,
'format=s' => \$format_string, 'format=s' => \$format_string,

View file

@ -49,10 +49,6 @@ if test "$XCONFIGURE" = "android"; then
CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=32" CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=32"
enable_largefile=no enable_largefile=no
enable_year2038=no]) enable_year2038=no])
# Prevent Gnulib from enabling time_rz.c on old Android releases, till
# Gnulib itself is fixed.
AS_IF([test "$ANDROID_SDK" -lt "35"],
[ac_cv_type_timezone_t=no])
fi fi
dnl Set emacs_config_options to the options of 'configure', quoted for the shell, dnl Set emacs_config_options to the options of 'configure', quoted for the shell,

View file

@ -34,7 +34,7 @@
# elif ((!defined __cplusplus || defined __clang__) \ # elif ((!defined __cplusplus || defined __clang__) \
&& (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
|| (!defined __STRICT_ANSI__ \ || (!defined __STRICT_ANSI__ \
&& (4 < __GNUC__ + (7 <= __GNUC_MINOR__) \ && (4 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __clang__ \
|| (defined __apple_build_version__ \ || (defined __apple_build_version__ \
? 6000000 <= __apple_build_version__ \ ? 6000000 <= __apple_build_version__ \
: 3 < __clang_major__ + (5 <= __clang_minor__)))))) : 3 < __clang_major__ + (5 <= __clang_minor__))))))

View file

@ -20,7 +20,7 @@
#ifndef _GL_ACL_H #ifndef _GL_ACL_H
#define _GL_ACL_H 1 #define _GL_ACL_H 1
/* This file uses _GL_ATTRIBUTE_CONST. */ /* This file uses _GL_ATTRIBUTE_CONST, _GL_ATTRIBUTE_DEPRECATED. */
#if !_GL_CONFIG_H_INCLUDED #if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first." #error "Please include config.h first."
#endif #endif
@ -35,10 +35,18 @@ extern "C" {
bool acl_errno_valid (int) _GL_ATTRIBUTE_CONST; bool acl_errno_valid (int) _GL_ATTRIBUTE_CONST;
int file_has_acl (char const *, struct stat const *); int file_has_acl (char const *, struct stat const *);
int qset_acl (char const *, int, mode_t); int qset_acl (char const *, int, mode_t);
int set_acl (char const *, int, mode_t); int xset_acl (char const *, int, mode_t);
/* Old name of xset_acl. */
_GL_ATTRIBUTE_DEPRECATED int set_acl (char const *, int, mode_t);
int qcopy_acl (char const *, int, char const *, int, mode_t); int qcopy_acl (char const *, int, char const *, int, mode_t);
int copy_acl (char const *, int, char const *, int, mode_t); int xcopy_acl (char const *, int, char const *, int, mode_t);
/* Old name of xcopy_acl. */
_GL_ATTRIBUTE_DEPRECATED int copy_acl (char const *, int, char const *, int,
mode_t);
int chmod_or_fchmod (char const *, int, mode_t); int chmod_or_fchmod (char const *, int, mode_t);

View file

@ -20,12 +20,49 @@
/* Provide public ATTRIBUTE_* names for the private _GL_ATTRIBUTE_* /* Provide public ATTRIBUTE_* names for the private _GL_ATTRIBUTE_*
macros used within Gnulib. */ macros used within Gnulib. */
/* These attributes can be placed in two ways: /* The placement of these attributes depends on the kind of declaration
- At the start of a declaration (i.e. even before storage-class and, in some cases, also on the programming language (C vs. C++).
specifiers!); then they apply to all entities that are declared
by the declaration. In function declarations and function definitions:
- Immediately after the name of an entity being declared by the
declaration; then they apply to that entity only. */ * ATTRIBUTE_NOTHROW must come after the parameter list.
* The macros
ATTRIBUTE_CONST
ATTRIBUTE_PURE
DEPRECATED
MAYBE_UNUSED
NODISCARD
REPRODUCIBLE
UNSEQUENCED
must come before the return type, and more precisely:
- In a function declaration/definition without a storage-class
specifier: at the beginning of the declaration/definition.
- In a function declaration/definition with a storage-class
specifier:
- In C: before the storage-class specifier.
- In C++: between the storage-class specifier and the return type.
* The other macros can be placed
- Either
- In a function declaration/definition without a storage-class
specifier: at the beginning of the declaration/definition.
- In a function declaration/definition with a storage-class
specifier: between the storage-class specifier and the return
type.
- Or after the parameter list,
but after ATTRIBUTE_NOTHROW if present.
In other declarations, such as variable declarations:
* Either
- In C: before the storage-class specifier.
- In C++: between the storage-class specifier and the return type.
Then they apply to all entities that are declared by the declaration.
* Or immediately after the name of an entity being declared by the
declaration. Then they apply to that entity only.
*/
#ifndef _GL_ATTRIBUTE_H #ifndef _GL_ATTRIBUTE_H
#define _GL_ATTRIBUTE_H #define _GL_ATTRIBUTE_H

View file

@ -93,11 +93,22 @@
# define _GL_EXTERN_C extern # define _GL_EXTERN_C extern
#endif #endif
/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes); /* _GL_EXTERN_C_FUNC declaration;
performs the declaration of a function with C linkage. */
#if defined __cplusplus
# define _GL_EXTERN_C_FUNC extern "C"
#else
/* In C mode, omit the 'extern' keyword, because attributes in bracket syntax
are not allowed between 'extern' and the return type (see gnulib-common.m4).
*/
# define _GL_EXTERN_C_FUNC
#endif
/* _GL_FUNCDECL_RPL (func, rettype, parameters[, attributes]);
declares a replacement function, named rpl_func, with the given prototype, declares a replacement function, named rpl_func, with the given prototype,
consisting of return type, parameters, and attributes. consisting of return type, parameters, and attributes.
Example: Example:
_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
Note: Attributes, such as _GL_ATTRIBUTE_DEPRECATED, are supported in front Note: Attributes, such as _GL_ATTRIBUTE_DEPRECATED, are supported in front
@ -105,21 +116,27 @@
because because
[[...]] extern "C" <declaration>; [[...]] extern "C" <declaration>;
is invalid syntax in C++.) is invalid syntax in C++.)
*/
#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
_GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
_GL_EXTERN_C rettype rpl_func parameters_and_attributes
/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes); Note: The attribute _GL_ATTRIBUTE_NOTHROW, if needed, must be placed outside
of the _GL_FUNCDECL_RPL invocation, at the end of the declaration.
*/
#define _GL_FUNCDECL_RPL(func,rettype,parameters,...) \
_GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters, __VA_ARGS__)
#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \
_GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters
/* _GL_FUNCDECL_SYS (func, rettype, parameters[, attributes]);
declares the system function, named func, with the given prototype, declares the system function, named func, with the given prototype,
consisting of return type, parameters, and attributes. consisting of return type, parameters, and attributes.
Example: Example:
_GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...) _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
Note: The attribute _GL_ATTRIBUTE_NOTHROW, if needed, must be placed outside
of the _GL_FUNCDECL_SYS invocation, at the end of the declaration.
*/ */
#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ #define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \
_GL_EXTERN_C rettype func parameters_and_attributes _GL_EXTERN_C_FUNC __VA_ARGS__ rettype func parameters
/* _GL_CXXALIAS_RPL (func, rettype, parameters); /* _GL_CXXALIAS_RPL (func, rettype, parameters);
declares a C++ alias called GNULIB_NAMESPACE::func declares a C++ alias called GNULIB_NAMESPACE::func
@ -297,7 +314,7 @@
_GL_WARN_ON_USE (func, \ _GL_WARN_ON_USE (func, \
"The symbol ::" #func " refers to the system function. " \ "The symbol ::" #func " refers to the system function. " \
"Use " #namespace "::" #func " instead.") "Use " #namespace "::" #func " instead.")
# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING # elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
# define _GL_CXXALIASWARN_2(func,namespace) \ # define _GL_CXXALIASWARN_2(func,namespace) \
extern __typeof__ (func) func extern __typeof__ (func) func
# else # else

View file

@ -83,7 +83,7 @@
# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
# define __NTHNL(fct) __attribute__ ((__nothrow__)) fct # define __NTHNL(fct) __attribute__ ((__nothrow__)) fct
# else # else
# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4) # if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4)
# if __cplusplus >= 201103L # if __cplusplus >= 201103L
# define __THROW noexcept (true) # define __THROW noexcept (true)
# else # else
@ -497,7 +497,7 @@
# endif # endif
#endif #endif
/* ISO C99 also allows declaring arrays as non-overlapping. The syntax is /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
array_name[restrict] array_name[restrict]
GCC 3.1 and clang support this. GCC 3.1 and clang support this.
This syntax is not usable in C++ mode. */ This syntax is not usable in C++ mode. */

View file

@ -93,10 +93,14 @@
#endif #endif
/* Suppress gcc's "...may be used before initialized" warnings, /* Suppress gcc's "...may be used before initialized" warnings,
generated by GCC versions up to at least GCC 13.2. */ generated by GCC versions up to at least GCC 14.2.
#if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4 Likewise for gcc -fanalyzer's "use of uninitialized value" warnings. */
#if _GL_GNUC_PREREQ (4, 7)
# pragma GCC diagnostic push # pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" # pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
# if _GL_GNUC_PREREQ (13, 0)
# pragma GCC diagnostic ignored "-Wanalyzer-use-of-uninitialized-value"
# endif
#endif #endif
/* /*
@ -554,7 +558,7 @@ compareseq (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim,
#undef XREF_YREF_EQUAL #undef XREF_YREF_EQUAL
} }
#if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4 #if _GL_GNUC_PREREQ (4, 7)
# pragma GCC diagnostic pop # pragma GCC diagnostic pop
#endif #endif

View file

@ -78,7 +78,7 @@ typedef struct gl_directory DIR;
that can be freed by passing them as the Ith argument to the that can be freed by passing them as the Ith argument to the
function F. */ function F. */
#ifndef _GL_ATTRIBUTE_DEALLOC #ifndef _GL_ATTRIBUTE_DEALLOC
# if __GNUC__ >= 11 # if __GNUC__ >= 11 && !defined __clang__
# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
# else # else
# define _GL_ATTRIBUTE_DEALLOC(f, i) # define _GL_ATTRIBUTE_DEALLOC(f, i)
@ -122,11 +122,11 @@ typedef struct gl_directory DIR;
# define closedir rpl_closedir # define closedir rpl_closedir
# define GNULIB_defined_closedir 1 # define GNULIB_defined_closedir 1
# endif # endif
_GL_FUNCDECL_RPL (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (closedir, int, (DIR *dirp), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (closedir, int, (DIR *dirp)); _GL_CXXALIAS_RPL (closedir, int, (DIR *dirp));
# else # else
# if !@HAVE_CLOSEDIR@ # if !@HAVE_CLOSEDIR@
_GL_FUNCDECL_SYS (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (closedir, int, (DIR *dirp), _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (closedir, int, (DIR *dirp)); _GL_CXXALIAS_SYS (closedir, int, (DIR *dirp));
# endif # endif
@ -147,14 +147,14 @@ _GL_WARN_ON_USE (closedir, "closedir is not portable - "
# define GNULIB_defined_opendir 1 # define GNULIB_defined_opendir 1
# endif # endif
_GL_FUNCDECL_RPL (opendir, DIR *, _GL_FUNCDECL_RPL (opendir, DIR *,
(const char *dir_name) (const char *dir_name),
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1)); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1));
_GL_CXXALIAS_RPL (opendir, DIR *, (const char *dir_name)); _GL_CXXALIAS_RPL (opendir, DIR *, (const char *dir_name));
# else # else
# if !@HAVE_OPENDIR@ || __GNUC__ >= 11 # if !@HAVE_OPENDIR@ || (__GNUC__ >= 11 && !defined __clang__)
_GL_FUNCDECL_SYS (opendir, DIR *, _GL_FUNCDECL_SYS (opendir, DIR *,
(const char *dir_name) (const char *dir_name),
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1)); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1));
# endif # endif
@ -162,11 +162,12 @@ _GL_CXXALIAS_SYS (opendir, DIR *, (const char *dir_name));
# endif # endif
_GL_CXXALIASWARN (opendir); _GL_CXXALIASWARN (opendir);
#else #else
# if @GNULIB_CLOSEDIR@ && !GNULIB_defined_DIR && __GNUC__ >= 11 && !defined opendir # if @GNULIB_CLOSEDIR@ && !GNULIB_defined_DIR \
&& (__GNUC__ >= 11 && !defined __clang__) && !defined opendir
/* For -Wmismatched-dealloc: Associate opendir with closedir or /* For -Wmismatched-dealloc: Associate opendir with closedir or
rpl_closedir. */ rpl_closedir. */
_GL_FUNCDECL_SYS (opendir, DIR *, _GL_FUNCDECL_SYS (opendir, DIR *,
(const char *dir_name) (const char *dir_name),
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1)); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1));
# endif # endif
@ -185,11 +186,11 @@ _GL_WARN_ON_USE (opendir, "opendir is not portable - "
# undef readdir # undef readdir
# define readdir rpl_readdir # define readdir rpl_readdir
# endif # endif
_GL_FUNCDECL_RPL (readdir, struct dirent *, (DIR *dirp) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (readdir, struct dirent *, (DIR *dirp), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (readdir, struct dirent *, (DIR *dirp)); _GL_CXXALIAS_RPL (readdir, struct dirent *, (DIR *dirp));
# else # else
# if !@HAVE_READDIR@ # if !@HAVE_READDIR@
_GL_FUNCDECL_SYS (readdir, struct dirent *, (DIR *dirp) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (readdir, struct dirent *, (DIR *dirp), _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (readdir, struct dirent *, (DIR *dirp)); _GL_CXXALIAS_SYS (readdir, struct dirent *, (DIR *dirp));
# endif # endif
@ -208,11 +209,11 @@ _GL_WARN_ON_USE (readdir, "readdir is not portable - "
# undef rewinddir # undef rewinddir
# define rewinddir rpl_rewinddir # define rewinddir rpl_rewinddir
# endif # endif
_GL_FUNCDECL_RPL (rewinddir, void, (DIR *dirp) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (rewinddir, void, (DIR *dirp), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (rewinddir, void, (DIR *dirp)); _GL_CXXALIAS_RPL (rewinddir, void, (DIR *dirp));
# else # else
# if !@HAVE_REWINDDIR@ # if !@HAVE_REWINDDIR@
_GL_FUNCDECL_SYS (rewinddir, void, (DIR *dirp) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (rewinddir, void, (DIR *dirp), _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (rewinddir, void, (DIR *dirp)); _GL_CXXALIAS_SYS (rewinddir, void, (DIR *dirp));
# endif # endif
@ -234,7 +235,7 @@ _GL_WARN_ON_USE (rewinddir, "rewinddir is not portable - "
# undef dirfd # undef dirfd
# define dirfd rpl_dirfd # define dirfd rpl_dirfd
# endif # endif
_GL_FUNCDECL_RPL (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (dirfd, int, (DIR *), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (dirfd, int, (DIR *)); _GL_CXXALIAS_RPL (dirfd, int, (DIR *));
# else # else
@ -245,7 +246,7 @@ static inline int (dirfd) (DIR *dp) { return dirfd (dp); }
# undef dirfd # undef dirfd
# endif # endif
# if !(@HAVE_DECL_DIRFD@ || defined dirfd) # if !(@HAVE_DECL_DIRFD@ || defined dirfd)
_GL_FUNCDECL_SYS (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (dirfd, int, (DIR *), _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (dirfd, int, (DIR *)); _GL_CXXALIAS_SYS (dirfd, int, (DIR *));
# endif # endif
@ -270,24 +271,26 @@ _GL_WARN_ON_USE (dirfd, "dirfd is unportable - "
# define fdopendir rpl_fdopendir # define fdopendir rpl_fdopendir
# endif # endif
_GL_FUNCDECL_RPL (fdopendir, DIR *, _GL_FUNCDECL_RPL (fdopendir, DIR *,
(int fd) (int fd),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1)); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1));
_GL_CXXALIAS_RPL (fdopendir, DIR *, (int fd)); _GL_CXXALIAS_RPL (fdopendir, DIR *, (int fd));
# else # else
# if !@HAVE_FDOPENDIR@ || !@HAVE_DECL_FDOPENDIR@ || __GNUC__ >= 11 # if !@HAVE_FDOPENDIR@ || !@HAVE_DECL_FDOPENDIR@ \
|| (__GNUC__ >= 11 && !defined __clang__)
_GL_FUNCDECL_SYS (fdopendir, DIR *, _GL_FUNCDECL_SYS (fdopendir, DIR *,
(int fd) (int fd),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1)); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1));
# endif # endif
_GL_CXXALIAS_SYS (fdopendir, DIR *, (int fd)); _GL_CXXALIAS_SYS (fdopendir, DIR *, (int fd));
# endif # endif
_GL_CXXALIASWARN (fdopendir); _GL_CXXALIASWARN (fdopendir);
#else #else
# if @GNULIB_CLOSEDIR@ && __GNUC__ >= 11 && !defined fdopendir # if @GNULIB_CLOSEDIR@ \
&& (__GNUC__ >= 11 && !defined __clang__) && !defined fdopendir
/* For -Wmismatched-dealloc: Associate fdopendir with closedir or /* For -Wmismatched-dealloc: Associate fdopendir with closedir or
rpl_closedir. */ rpl_closedir. */
_GL_FUNCDECL_SYS (fdopendir, DIR *, _GL_FUNCDECL_SYS (fdopendir, DIR *,
(int fd) (int fd),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1)); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1));
# endif # endif
# if defined GNULIB_POSIXCHECK # if defined GNULIB_POSIXCHECK
@ -308,7 +311,7 @@ _GL_WARN_ON_USE (fdopendir, "fdopendir is unportable - "
_GL_FUNCDECL_SYS (scandir, int, _GL_FUNCDECL_SYS (scandir, int,
(const char *dir, struct dirent ***namelist, (const char *dir, struct dirent ***namelist,
int (*filter) (const struct dirent *), int (*filter) (const struct dirent *),
int (*cmp) (const struct dirent **, const struct dirent **)) int (*cmp) (const struct dirent **, const struct dirent **)),
_GL_ARG_NONNULL ((1, 2, 4))); _GL_ARG_NONNULL ((1, 2, 4)));
# endif # endif
/* Need to cast, because on glibc systems, the fourth parameter is /* Need to cast, because on glibc systems, the fourth parameter is
@ -330,7 +333,7 @@ _GL_WARN_ON_USE (scandir, "scandir is unportable - "
/* Compare two 'struct dirent' entries alphabetically. */ /* Compare two 'struct dirent' entries alphabetically. */
# if !@HAVE_ALPHASORT@ # if !@HAVE_ALPHASORT@
_GL_FUNCDECL_SYS (alphasort, int, _GL_FUNCDECL_SYS (alphasort, int,
(const struct dirent **, const struct dirent **) (const struct dirent **, const struct dirent **),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif

View file

@ -133,7 +133,7 @@
/* These are intentionally the same values as the WSA* error numbers, defined /* These are intentionally the same values as the WSA* error numbers, defined
in <winsock2.h>. */ in <winsock2.h>. */
# define ESOCKTNOSUPPORT 10044 /* not required by POSIX */ # define ESOCKTNOSUPPORT 10044
# define EPFNOSUPPORT 10046 /* not required by POSIX */ # define EPFNOSUPPORT 10046 /* not required by POSIX */
# define ESHUTDOWN 10058 /* not required by POSIX */ # define ESHUTDOWN 10058 /* not required by POSIX */
# define ETOOMANYREFS 10059 /* not required by POSIX */ # define ETOOMANYREFS 10059 /* not required by POSIX */
@ -270,10 +270,17 @@
# define GNULIB_defined_ENOTRECOVERABLE 1 # define GNULIB_defined_ENOTRECOVERABLE 1
# endif # endif
/* On LynxOS, the macro EILSEQ is not defined. */
# ifndef EILSEQ # ifndef EILSEQ
# define EILSEQ 2015 # define EILSEQ 2015
# define GNULIB_defined_EILSEQ 1 # define GNULIB_defined_EILSEQ 1
# endif # endif
/* On Haiku, the macro ESOCKTNOSUPPORT is not defined. */
# ifndef ESOCKTNOSUPPORT
# define ESOCKTNOSUPPORT 2016
# define GNULIB_defined_ESOCKTNOSUPPORT 1
# endif
#endif /* _@GUARD_PREFIX@_ERRNO_H */ #endif /* _@GUARD_PREFIX@_ERRNO_H */
#endif /* _@GUARD_PREFIX@_ERRNO_H */ #endif /* _@GUARD_PREFIX@_ERRNO_H */

View file

@ -100,7 +100,7 @@
# undef creat # undef creat
# define creat rpl_creat # define creat rpl_creat
# endif # endif
_GL_FUNCDECL_RPL (creat, int, (const char *filename, mode_t mode) _GL_FUNCDECL_RPL (creat, int, (const char *filename, mode_t mode),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (creat, int, (const char *filename, mode_t mode)); _GL_CXXALIAS_RPL (creat, int, (const char *filename, mode_t mode));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
@ -170,7 +170,7 @@ _GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - "
# undef open # undef open
# define open rpl_open # define open rpl_open
# endif # endif
_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
@ -217,14 +217,14 @@ _GL_CXXALIASWARN (open);
# define openat rpl_openat # define openat rpl_openat
# endif # endif
_GL_FUNCDECL_RPL (openat, int, _GL_FUNCDECL_RPL (openat, int,
(int fd, char const *file, int flags, /* mode_t mode */ ...) (int fd, char const *file, int flags, /* mode_t mode */ ...),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (openat, int, _GL_CXXALIAS_RPL (openat, int,
(int fd, char const *file, int flags, /* mode_t mode */ ...)); (int fd, char const *file, int flags, /* mode_t mode */ ...));
# else # else
# if !@HAVE_OPENAT@ # if !@HAVE_OPENAT@
_GL_FUNCDECL_SYS (openat, int, _GL_FUNCDECL_SYS (openat, int,
(int fd, char const *file, int flags, /* mode_t mode */ ...) (int fd, char const *file, int flags, /* mode_t mode */ ...),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
# endif # endif
_GL_CXXALIAS_SYS (openat, int, _GL_CXXALIAS_SYS (openat, int,

View file

@ -17,14 +17,14 @@
Written by Paul Eggert, Andreas Grünbacher, and Bruno Haible. */ Written by Paul Eggert, Andreas Grünbacher, and Bruno Haible. */
#include <config.h>
/* Without this pragma, gcc 4.7.0 20120126 may suggest that the /* Without this pragma, gcc 4.7.0 20120126 may suggest that the
file_has_acl function might be candidate for attribute 'const' */ file_has_acl function might be candidate for attribute 'const' */
#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ #if _GL_GNUC_PREREQ (4, 6)
# pragma GCC diagnostic ignored "-Wsuggest-attribute=const" # pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
#endif #endif
#include <config.h>
#include "acl.h" #include "acl.h"
#include "acl-internal.h" #include "acl-internal.h"

View file

@ -47,6 +47,7 @@
# --avoid=iswdigit \ # --avoid=iswdigit \
# --avoid=iswxdigit \ # --avoid=iswxdigit \
# --avoid=langinfo \ # --avoid=langinfo \
# --avoid=libgmp-mpq \
# --avoid=localename-unsafe-limited \ # --avoid=localename-unsafe-limited \
# --avoid=lock \ # --avoid=lock \
# --avoid=mbrtowc \ # --avoid=mbrtowc \
@ -226,6 +227,7 @@ CAIRO_XCB_CFLAGS = @CAIRO_XCB_CFLAGS@
CAIRO_XCB_LIBS = @CAIRO_XCB_LIBS@ CAIRO_XCB_LIBS = @CAIRO_XCB_LIBS@
CAIRO_XLIB_CFLAGS = @CAIRO_XLIB_CFLAGS@ CAIRO_XLIB_CFLAGS = @CAIRO_XLIB_CFLAGS@
CAIRO_XLIB_LIBS = @CAIRO_XLIB_LIBS@ CAIRO_XLIB_LIBS = @CAIRO_XLIB_LIBS@
CAN_PRINT_STACK_TRACE = @CAN_PRINT_STACK_TRACE@
CC = @CC@ CC = @CC@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
CFLAGS_SOUND = @CFLAGS_SOUND@ CFLAGS_SOUND = @CFLAGS_SOUND@
@ -597,6 +599,7 @@ GL_GNULIB_SECURE_GETENV = @GL_GNULIB_SECURE_GETENV@
GL_GNULIB_SELECT = @GL_GNULIB_SELECT@ GL_GNULIB_SELECT = @GL_GNULIB_SELECT@
GL_GNULIB_SETENV = @GL_GNULIB_SETENV@ GL_GNULIB_SETENV = @GL_GNULIB_SETENV@
GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@ GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@
GL_GNULIB_SIG2STR = @GL_GNULIB_SIG2STR@
GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@ GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@
GL_GNULIB_SIGACTION = @GL_GNULIB_SIGACTION@ GL_GNULIB_SIGACTION = @GL_GNULIB_SIGACTION@
GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@ GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@
@ -606,6 +609,7 @@ GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@
GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@ GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@
GL_GNULIB_SNZPRINTF = @GL_GNULIB_SNZPRINTF@ GL_GNULIB_SNZPRINTF = @GL_GNULIB_SNZPRINTF@
GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@ GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@
GL_GNULIB_STACK_TRACE = @GL_GNULIB_STACK_TRACE@
GL_GNULIB_STAT = @GL_GNULIB_STAT@ GL_GNULIB_STAT = @GL_GNULIB_STAT@
GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@ GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@
GL_GNULIB_STDIO_H_SIGPIPE = @GL_GNULIB_STDIO_H_SIGPIPE@ GL_GNULIB_STDIO_H_SIGPIPE = @GL_GNULIB_STDIO_H_SIGPIPE@
@ -886,6 +890,7 @@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
HAVE_SETENV = @HAVE_SETENV@ HAVE_SETENV = @HAVE_SETENV@
HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
HAVE_SETSTATE = @HAVE_SETSTATE@ HAVE_SETSTATE = @HAVE_SETSTATE@
HAVE_SIG2STR = @HAVE_SIG2STR@
HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@ HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGACTION = @HAVE_SIGACTION@
HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@ HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
@ -900,6 +905,7 @@ HAVE_SPAWN_H = @HAVE_SPAWN_H@
HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STDINT_H = @HAVE_STDINT_H@
HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPCPY = @HAVE_STPCPY@
HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@
HAVE_STR2SIG = @HAVE_STR2SIG@
HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCASESTR = @HAVE_STRCASESTR@
HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@ HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
@ -933,6 +939,7 @@ HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@ HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@
HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
HAVE_TZALLOC = @HAVE_TZALLOC@
HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@
HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLINKAT = @HAVE_UNLINKAT@
HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
@ -1057,6 +1064,7 @@ NDK_BUILD_MODULES = @NDK_BUILD_MODULES@
NDK_BUILD_NASM = @NDK_BUILD_NASM@ NDK_BUILD_NASM = @NDK_BUILD_NASM@
NDK_BUILD_READELF = @NDK_BUILD_READELF@ NDK_BUILD_READELF = @NDK_BUILD_READELF@
NDK_BUILD_SDK = @NDK_BUILD_SDK@ NDK_BUILD_SDK = @NDK_BUILD_SDK@
NDK_BUILD_SO_LDFLAGS = @NDK_BUILD_SO_LDFLAGS@
NEXT_ASSERT_H = @NEXT_ASSERT_H@ NEXT_ASSERT_H = @NEXT_ASSERT_H@
NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@ NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@
NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@ NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
@ -1218,6 +1226,7 @@ REPLACE_LINK = @REPLACE_LINK@
REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LINKAT = @REPLACE_LINKAT@
REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ REPLACE_LOCALTIME = @REPLACE_LOCALTIME@
REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
REPLACE_LOCALTIME_RZ = @REPLACE_LOCALTIME_RZ@
REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_LSEEK = @REPLACE_LSEEK@
REPLACE_LSTAT = @REPLACE_LSTAT@ REPLACE_LSTAT = @REPLACE_LSTAT@
REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@ REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@
@ -1238,6 +1247,7 @@ REPLACE_MKOSTEMP = @REPLACE_MKOSTEMP@
REPLACE_MKOSTEMPS = @REPLACE_MKOSTEMPS@ REPLACE_MKOSTEMPS = @REPLACE_MKOSTEMPS@
REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_MKTIME = @REPLACE_MKTIME@
REPLACE_MKTIME_Z = @REPLACE_MKTIME_Z@
REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
REPLACE_NULL = @REPLACE_NULL@ REPLACE_NULL = @REPLACE_NULL@
REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
@ -2592,8 +2602,8 @@ EXTRA_DIST += cdefs.h libc-config.h
endif endif
## end gnulib module libc-config ## end gnulib module libc-config
## begin gnulib module libgmp ## begin gnulib module libgmp-mpz
ifeq (,$(OMIT_GNULIB_MODULE_libgmp)) ifeq (,$(OMIT_GNULIB_MODULE_libgmp-mpz))
BUILT_SOURCES += $(GMP_H) BUILT_SOURCES += $(GMP_H)
@ -2602,6 +2612,9 @@ ifneq (,$(GL_GENERATE_MINI_GMP_H_CONDITION))
# Build gmp.h as a wrapper for mini-gmp.h when using mini-gmp. # Build gmp.h as a wrapper for mini-gmp.h when using mini-gmp.
gmp.h: $(top_builddir)/config.status gmp.h: $(top_builddir)/config.status
echo '#include "mini-gmp.h"' > $@-t echo '#include "mini-gmp.h"' > $@-t
echo '#if GNULIB_LIBGMP_MPQ' >> $@-t
echo '# include "mini-mpq.h"' >> $@-t
echo '#endif' >> $@-t
mv $@-t $@ mv $@-t $@
endif endif
ifneq (,$(GL_GENERATE_GMP_GMP_H_CONDITION)) ifneq (,$(GL_GENERATE_GMP_GMP_H_CONDITION))
@ -2625,7 +2638,7 @@ EXTRA_DIST += mini-gmp.c mini-gmp.h
EXTRA_libgnu_a_SOURCES += mini-gmp.c EXTRA_libgnu_a_SOURCES += mini-gmp.c
endif endif
## end gnulib module libgmp ## end gnulib module libgmp-mpz
## begin gnulib module limits-h ## begin gnulib module limits-h
ifeq (,$(OMIT_GNULIB_MODULE_limits-h)) ifeq (,$(OMIT_GNULIB_MODULE_limits-h))
@ -3001,15 +3014,18 @@ signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \ -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \
-e 's/@''GNULIB_PTHREAD_SIGMASK''@/$(GL_GNULIB_PTHREAD_SIGMASK)/g' \ -e 's/@''GNULIB_PTHREAD_SIGMASK''@/$(GL_GNULIB_PTHREAD_SIGMASK)/g' \
-e 's/@''GNULIB_RAISE''@/$(GL_GNULIB_RAISE)/g' \ -e 's/@''GNULIB_RAISE''@/$(GL_GNULIB_RAISE)/g' \
-e 's/@''GNULIB_SIG2STR''@/$(GL_GNULIB_SIG2STR)/g' \
-e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GL_GNULIB_SIGNAL_H_SIGPIPE)/g' \ -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GL_GNULIB_SIGNAL_H_SIGPIPE)/g' \
-e 's/@''GNULIB_SIGPROCMASK''@/$(GL_GNULIB_SIGPROCMASK)/g' \ -e 's/@''GNULIB_SIGPROCMASK''@/$(GL_GNULIB_SIGPROCMASK)/g' \
-e 's/@''GNULIB_SIGACTION''@/$(GL_GNULIB_SIGACTION)/g' \ -e 's/@''GNULIB_SIGACTION''@/$(GL_GNULIB_SIGACTION)/g' \
-e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \ -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \
-e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \ -e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \
-e 's|@''HAVE_RAISE''@|$(HAVE_RAISE)|g' \ -e 's|@''HAVE_RAISE''@|$(HAVE_RAISE)|g' \
-e 's|@''HAVE_SIG2STR''@|$(HAVE_SIG2STR)|g' \
-e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \ -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \
-e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \ -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \
-e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \ -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \
-e 's|@''HAVE_STR2SIG''@|$(HAVE_STR2SIG)|g' \
-e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \ -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \
-e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \ -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \
-e 's|@''HAVE_SIGHANDLER_T''@|$(HAVE_SIGHANDLER_T)|g' \ -e 's|@''HAVE_SIGHANDLER_T''@|$(HAVE_SIGHANDLER_T)|g' \
@ -3491,6 +3507,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's/@''GNULIB_RPMATCH''@/$(GL_GNULIB_RPMATCH)/g' \ -e 's/@''GNULIB_RPMATCH''@/$(GL_GNULIB_RPMATCH)/g' \
-e 's/@''GNULIB_SECURE_GETENV''@/$(GL_GNULIB_SECURE_GETENV)/g' \ -e 's/@''GNULIB_SECURE_GETENV''@/$(GL_GNULIB_SECURE_GETENV)/g' \
-e 's/@''GNULIB_SETENV''@/$(GL_GNULIB_SETENV)/g' \ -e 's/@''GNULIB_SETENV''@/$(GL_GNULIB_SETENV)/g' \
-e 's/@''GNULIB_STACK_TRACE''@/$(GL_GNULIB_STACK_TRACE)/g' \
-e 's/@''GNULIB_STRTOD''@/$(GL_GNULIB_STRTOD)/g' \ -e 's/@''GNULIB_STRTOD''@/$(GL_GNULIB_STRTOD)/g' \
-e 's/@''GNULIB_STRTOF''@/$(GL_GNULIB_STRTOF)/g' \ -e 's/@''GNULIB_STRTOF''@/$(GL_GNULIB_STRTOF)/g' \
-e 's/@''GNULIB_STRTOL''@/$(GL_GNULIB_STRTOL)/g' \ -e 's/@''GNULIB_STRTOL''@/$(GL_GNULIB_STRTOL)/g' \
@ -3600,6 +3617,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's|@''REPLACE_STRTOULL''@|$(REPLACE_STRTOULL)|g' \ -e 's|@''REPLACE_STRTOULL''@|$(REPLACE_STRTOULL)|g' \
-e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
-e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
-e 's|@''CAN_PRINT_STACK_TRACE''@|$(CAN_PRINT_STACK_TRACE)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _Noreturn/r $(_NORETURN_H)' \ -e '/definition of _Noreturn/r $(_NORETURN_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
@ -3960,6 +3978,7 @@ sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU
$(srcdir)/sys_time.in.h > $@-t $(srcdir)/sys_time.in.h > $@-t
$(AM_V_at)mv $@-t $@ $(AM_V_at)mv $@-t $@
MOSTLYCLEANFILES += sys/time.h sys/time.h-t MOSTLYCLEANFILES += sys/time.h sys/time.h-t
MOSTLYCLEANDIRS += sys
EXTRA_DIST += sys_time.in.h EXTRA_DIST += sys_time.in.h
@ -3987,6 +4006,7 @@ sys/types.h: sys_types.in.h $(top_builddir)/config.status
$(srcdir)/sys_types.in.h > $@-t $(srcdir)/sys_types.in.h > $@-t
$(AM_V_at)mv $@-t $@ $(AM_V_at)mv $@-t $@
MOSTLYCLEANFILES += sys/types.h sys/types.h-t MOSTLYCLEANFILES += sys/types.h sys/types.h-t
MOSTLYCLEANDIRS += sys
EXTRA_DIST += sys_types.in.h EXTRA_DIST += sys_types.in.h
@ -4039,11 +4059,14 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
-e 's|@''HAVE_TIMESPEC_GET''@|$(HAVE_TIMESPEC_GET)|g' \ -e 's|@''HAVE_TIMESPEC_GET''@|$(HAVE_TIMESPEC_GET)|g' \
-e 's|@''HAVE_TIMESPEC_GETRES''@|$(HAVE_TIMESPEC_GETRES)|g' \ -e 's|@''HAVE_TIMESPEC_GETRES''@|$(HAVE_TIMESPEC_GETRES)|g' \
-e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \ -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \
-e 's|@''HAVE_TZALLOC''@|$(HAVE_TZALLOC)|g' \
-e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \ -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \
-e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \
-e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \
-e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
-e 's|@''REPLACE_LOCALTIME_RZ''@|$(REPLACE_LOCALTIME_RZ)|g' \
-e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \ -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
-e 's|@''REPLACE_MKTIME_Z''@|$(REPLACE_MKTIME_Z)|g' \
-e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
-e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \ -e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \
-e 's|@''REPLACE_TIME''@|$(REPLACE_TIME)|g' \ -e 's|@''REPLACE_TIME''@|$(REPLACE_TIME)|g' \

View file

@ -21,7 +21,7 @@
#include <limits.h> #include <limits.h>
/* Pacify GCC 13.2 in some calls to _GL_EXPR_SIGNED. */ /* Pacify GCC 13.2 in some calls to _GL_EXPR_SIGNED. */
#if defined __GNUC__ && 4 < __GNUC__ + (3 <= __GNUC_MINOR__) #if 4 < __GNUC__ + (3 <= __GNUC_MINOR__) && !defined __clang__
# pragma GCC diagnostic ignored "-Wtype-limits" # pragma GCC diagnostic ignored "-Wtype-limits"
#endif #endif
@ -163,7 +163,7 @@
#if _GL_HAS_BUILTIN_MUL_OVERFLOW #if _GL_HAS_BUILTIN_MUL_OVERFLOW
# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \ # if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
|| (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \ || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \
&& !defined __EDG__) && !defined __clang__ && !defined __EDG__)
# define _GL_INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r) # define _GL_INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r)
# else # else
/* Work around GCC bug 91450. */ /* Work around GCC bug 91450. */

View file

@ -970,7 +970,7 @@ _GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - "
# define strtoimax rpl_strtoimax # define strtoimax rpl_strtoimax
# endif # endif
_GL_FUNCDECL_RPL (strtoimax, intmax_t, _GL_FUNCDECL_RPL (strtoimax, intmax_t,
(const char *restrict, char **restrict, int) (const char *restrict, char **restrict, int),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoimax, intmax_t, _GL_CXXALIAS_RPL (strtoimax, intmax_t,
(const char *restrict, char **restrict, int)); (const char *restrict, char **restrict, int));
@ -978,7 +978,7 @@ _GL_CXXALIAS_RPL (strtoimax, intmax_t,
# if !@HAVE_DECL_STRTOIMAX@ # if !@HAVE_DECL_STRTOIMAX@
# undef strtoimax # undef strtoimax
_GL_FUNCDECL_SYS (strtoimax, intmax_t, _GL_FUNCDECL_SYS (strtoimax, intmax_t,
(const char *restrict, char **restrict, int) (const char *restrict, char **restrict, int),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (strtoimax, intmax_t, _GL_CXXALIAS_SYS (strtoimax, intmax_t,
@ -1000,7 +1000,7 @@ _GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - "
# define strtoumax rpl_strtoumax # define strtoumax rpl_strtoumax
# endif # endif
_GL_FUNCDECL_RPL (strtoumax, uintmax_t, _GL_FUNCDECL_RPL (strtoumax, uintmax_t,
(const char *restrict, char **restrict, int) (const char *restrict, char **restrict, int),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoumax, uintmax_t, _GL_CXXALIAS_RPL (strtoumax, uintmax_t,
(const char *restrict, char **restrict, int)); (const char *restrict, char **restrict, int));
@ -1008,7 +1008,7 @@ _GL_CXXALIAS_RPL (strtoumax, uintmax_t,
# if !@HAVE_DECL_STRTOUMAX@ # if !@HAVE_DECL_STRTOUMAX@
# undef strtoumax # undef strtoumax
_GL_FUNCDECL_SYS (strtoumax, uintmax_t, _GL_FUNCDECL_SYS (strtoumax, uintmax_t,
(const char *restrict, char **restrict, int) (const char *restrict, char **restrict, int),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (strtoumax, uintmax_t, _GL_CXXALIAS_SYS (strtoumax, uintmax_t,

View file

@ -48,6 +48,11 @@
/* From glibc <features.h>. */ /* From glibc <features.h>. */
#if defined __clang__
/* clang really only groks GNU C 4.2, regardless of its value of __GNUC__. */
# undef __GNUC_PREREQ
# define __GNUC_PREREQ(maj, min) ((maj) < 4 + ((min) <= 2))
#endif
#ifndef __GNUC_PREREQ #ifndef __GNUC_PREREQ
# if defined __GNUC__ && defined __GNUC_MINOR__ # if defined __GNUC__ && defined __GNUC_MINOR__
# define __GNUC_PREREQ(maj, min) ((maj) < __GNUC__ + ((min) <= __GNUC_MINOR__)) # define __GNUC_PREREQ(maj, min) ((maj) < __GNUC__ + ((min) <= __GNUC_MINOR__))

View file

@ -132,10 +132,3 @@ process_partial_block:
free (buffer); free (buffer);
return 0; return 0;
} }
/*
* Hey Emacs!
* Local Variables:
* coding: utf-8
* End:
*/

View file

@ -31,11 +31,11 @@
#include "mini-gmp.h" #include "mini-gmp.h"
/* Pacify GCC -Wsuggest-attribute=const, pure, malloc. */ /* Pacify GCC -Wsuggest-attribute=const, pure, malloc. */
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) #if _GL_GNUC_PREREQ (4, 6)
# pragma GCC diagnostic ignored "-Wsuggest-attribute=const" # pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
#endif #endif
#if 8 <= __GNUC__ #if _GL_GNUC_PREREQ (8, 0)
# pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc" # pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc"
#endif #endif

View file

@ -19,8 +19,10 @@
#include <config.h> #include <config.h>
#include <limits.h> /* Specification. */
#include <signal.h> #include <signal.h>
#include <limits.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View file

@ -19,27 +19,6 @@
#include <signal.h> #include <signal.h>
/* Don't override system declarations of SIG2STR_MAX, sig2str, str2sig. */
#ifndef SIG2STR_MAX
# include "intprops.h"
/* Size of a buffer needed to hold a signal name like "HUP". */
# define SIG2STR_MAX (sizeof "SIGRTMAX" + INT_STRLEN_BOUND (int) - 1)
#ifdef __cplusplus
extern "C" {
#endif
int sig2str (int, char *);
int str2sig (char const *, int *);
#ifdef __cplusplus
}
#endif
#endif
/* An upper bound on signal numbers allowed by the system. */ /* An upper bound on signal numbers allowed by the system. */
#if defined _sys_nsig #if defined _sys_nsig

View file

@ -139,6 +139,47 @@ typedef void (*sighandler_t) (int);
#endif #endif
/* Maximum size of a signal name returned by sig2str(), including the
terminating NUL byte. */
#ifndef SIG2STR_MAX
/* The longest one: "RTMAX", then "+" or "-", then up to 10 digits, then NUL.
Add + 2 as a reserve for the future. */
# define SIG2STR_MAX (5 + 1 + 10 + 1 + 2)
#endif
#if @GNULIB_SIG2STR@
# if !@HAVE_SIG2STR@
_GL_FUNCDECL_SYS (sig2str, int, (int signo, char *str));
# endif
_GL_CXXALIAS_SYS (sig2str, int, (int signo, char *str));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (sig2str);
# endif
#elif defined GNULIB_POSIXCHECK
# undef sig2str
# if HAVE_RAW_DECL_SIG2STR
_GL_WARN_ON_USE (sig2str, "sig2str is not portable - "
"use gnulib module sig2str for portability");
# endif
#endif
#if @GNULIB_SIG2STR@
# if !@HAVE_STR2SIG@
_GL_FUNCDECL_SYS (str2sig, int, (char const *str, int *signo_p));
# endif
_GL_CXXALIAS_SYS (str2sig, int, (char const *str, int *signo_p));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (str2sig);
# endif
#elif defined GNULIB_POSIXCHECK
# undef str2sig
# if HAVE_RAW_DECL_STR2SIG
_GL_WARN_ON_USE (str2sig, "str2sig is not portable - "
"use gnulib module sig2str for portability");
# endif
#endif
#if @GNULIB_PTHREAD_SIGMASK@ #if @GNULIB_PTHREAD_SIGMASK@
# if @REPLACE_PTHREAD_SIGMASK@ # if @REPLACE_PTHREAD_SIGMASK@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -243,7 +284,7 @@ typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
# undef sigismember # undef sigismember
# endif # endif
# else # else
_GL_FUNCDECL_SYS (sigismember, int, (const sigset_t *set, int sig) _GL_FUNCDECL_SYS (sigismember, int, (const sigset_t *set, int sig),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (sigismember, int, (const sigset_t *set, int sig)); _GL_CXXALIAS_SYS (sigismember, int, (const sigset_t *set, int sig));
@ -256,7 +297,7 @@ _GL_CXXALIASWARN (sigismember);
# undef sigemptyset # undef sigemptyset
# endif # endif
# else # else
_GL_FUNCDECL_SYS (sigemptyset, int, (sigset_t *set) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (sigemptyset, int, (sigset_t *set), _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (sigemptyset, int, (sigset_t *set)); _GL_CXXALIAS_SYS (sigemptyset, int, (sigset_t *set));
_GL_CXXALIASWARN (sigemptyset); _GL_CXXALIASWARN (sigemptyset);
@ -268,7 +309,7 @@ _GL_CXXALIASWARN (sigemptyset);
# undef sigaddset # undef sigaddset
# endif # endif
# else # else
_GL_FUNCDECL_SYS (sigaddset, int, (sigset_t *set, int sig) _GL_FUNCDECL_SYS (sigaddset, int, (sigset_t *set, int sig),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (sigaddset, int, (sigset_t *set, int sig)); _GL_CXXALIAS_SYS (sigaddset, int, (sigset_t *set, int sig));
@ -281,7 +322,7 @@ _GL_CXXALIASWARN (sigaddset);
# undef sigdelset # undef sigdelset
# endif # endif
# else # else
_GL_FUNCDECL_SYS (sigdelset, int, (sigset_t *set, int sig) _GL_FUNCDECL_SYS (sigdelset, int, (sigset_t *set, int sig),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (sigdelset, int, (sigset_t *set, int sig)); _GL_CXXALIAS_SYS (sigdelset, int, (sigset_t *set, int sig));
@ -294,14 +335,14 @@ _GL_CXXALIASWARN (sigdelset);
# undef sigfillset # undef sigfillset
# endif # endif
# else # else
_GL_FUNCDECL_SYS (sigfillset, int, (sigset_t *set) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (sigfillset, int, (sigset_t *set), _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (sigfillset, int, (sigset_t *set)); _GL_CXXALIAS_SYS (sigfillset, int, (sigset_t *set));
_GL_CXXALIASWARN (sigfillset); _GL_CXXALIASWARN (sigfillset);
/* Return the set of those blocked signals that are pending. */ /* Return the set of those blocked signals that are pending. */
# if !@HAVE_POSIX_SIGNALBLOCKING@ # if !@HAVE_POSIX_SIGNALBLOCKING@
_GL_FUNCDECL_SYS (sigpending, int, (sigset_t *set) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (sigpending, int, (sigset_t *set), _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (sigpending, int, (sigset_t *set)); _GL_CXXALIAS_SYS (sigpending, int, (sigset_t *set));
_GL_CXXALIASWARN (sigpending); _GL_CXXALIASWARN (sigpending);

View file

@ -131,7 +131,7 @@ typedef long max_align_t;
*/ */
#ifndef _GL_ATTRIBUTE_NOTHROW #ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus # if defined __cplusplus
# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4 # if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L # if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true) # define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else # else
@ -194,7 +194,7 @@ typedef union
# ifndef _GL_HAS_BUILTIN_UNREACHABLE # ifndef _GL_HAS_BUILTIN_UNREACHABLE
# if defined __clang_major__ && __clang_major__ < 5 # if defined __clang_major__ && __clang_major__ < 5
# define _GL_HAS_BUILTIN_UNREACHABLE 0 # define _GL_HAS_BUILTIN_UNREACHABLE 0
# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__) # elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__) && !defined __clang__
# define _GL_HAS_BUILTIN_UNREACHABLE 1 # define _GL_HAS_BUILTIN_UNREACHABLE 1
# elif defined __has_builtin # elif defined __has_builtin
# define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable) # define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)

View file

@ -64,8 +64,8 @@
#define _@GUARD_PREFIX@_STDIO_H #define _@GUARD_PREFIX@_STDIO_H
/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_FORMAT, /* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_FORMAT,
_GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_NOTHROW, GNULIB_POSIXCHECK, _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOTHROW,
HAVE_RAW_DECL_*. */ GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED #if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first." #error "Please include config.h first."
#endif #endif
@ -120,7 +120,7 @@
that can be freed by passing them as the Ith argument to the that can be freed by passing them as the Ith argument to the
function F. */ function F. */
#ifndef _GL_ATTRIBUTE_DEALLOC #ifndef _GL_ATTRIBUTE_DEALLOC
# if __GNUC__ >= 11 # if __GNUC__ >= 11 && !defined __clang__
# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
# else # else
# define _GL_ATTRIBUTE_DEALLOC(f, i) # define _GL_ATTRIBUTE_DEALLOC(f, i)
@ -155,7 +155,7 @@
*/ */
#ifndef _GL_ATTRIBUTE_NOTHROW #ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus # if defined __cplusplus
# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4 # if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L # if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true) # define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else # else
@ -178,7 +178,7 @@
standardized by ISO C99 and POSIX. standardized by ISO C99 and POSIX.
_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD */ _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD */
/* __gnu_printf__ is supported in GCC >= 4.4. */ /* __gnu_printf__ is supported in GCC >= 4.4. */
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) #if (__GNUC__ + (__GNUC_MINOR__ >= 4) > 4) && !defined __clang__
# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __gnu_printf__ # define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __gnu_printf__
#else #else
# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __printf__ # define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __printf__
@ -289,7 +289,7 @@
directives nor widths, the only possible failure codes are ENOMEM directives nor widths, the only possible failure codes are ENOMEM
and the possible failure codes from write(), excluding EINTR. */ and the possible failure codes from write(), excluding EINTR. */
_GL_FUNCDECL_SYS (dzprintf, off64_t, _GL_FUNCDECL_SYS (dzprintf, off64_t,
(int fd, const char *restrict format, ...) (int fd, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_SYS (dzprintf, off64_t, _GL_CXXALIAS_SYS (dzprintf, off64_t,
@ -304,13 +304,13 @@ _GL_CXXALIAS_SYS (dzprintf, off64_t,
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define dprintf rpl_dprintf # define dprintf rpl_dprintf
# endif # endif
_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *restrict format, ...) _GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *restrict format, ...)); _GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *restrict format, ...));
# else # else
# if !@HAVE_DPRINTF@ # if !@HAVE_DPRINTF@
_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *restrict format, ...) _GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
# endif # endif
@ -333,7 +333,7 @@ _GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define fclose rpl_fclose # define fclose rpl_fclose
# endif # endif
_GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (fclose, int, (FILE *stream), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fclose, int, (FILE *stream)); _GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
# else # else
_GL_CXXALIAS_SYS (fclose, int, (FILE *stream)); _GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
@ -380,9 +380,10 @@ _GL_CXXALIASWARN (fcloseall);
# define fdopen rpl_fdopen # define fdopen rpl_fdopen
# endif # endif
_GL_FUNCDECL_RPL (fdopen, FILE *, _GL_FUNCDECL_RPL (fdopen, FILE *,
(int fd, const char *mode) (int fd, const char *mode),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1) _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
_GL_ATTRIBUTE_MALLOC); _GL_ATTRIBUTE_MALLOC
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode)); _GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -391,36 +392,38 @@ _GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
# endif # endif
_GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode)); _GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode));
# else # else
# if __GNUC__ >= 11 # if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose. */ /* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (fdopen, FILE *, _GL_FUNCDECL_SYS (fdopen, FILE *,
(int fd, const char *mode) (int fd, const char *mode),
_GL_ATTRIBUTE_NOTHROW
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1) _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
_GL_ATTRIBUTE_MALLOC); _GL_ATTRIBUTE_MALLOC
_GL_ATTRIBUTE_NODISCARD)
_GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (fdopen, FILE *, _GL_FUNCDECL_SYS (fdopen, FILE *,
(int fd, const char *mode) (int fd, const char *mode),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1) _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
_GL_ATTRIBUTE_MALLOC); _GL_ATTRIBUTE_MALLOC
_GL_ATTRIBUTE_NODISCARD);
# endif # endif
# endif # endif
_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode)); _GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
# endif # endif
_GL_CXXALIASWARN (fdopen); _GL_CXXALIASWARN (fdopen);
#else #else
# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fdopen # if @GNULIB_FCLOSE@ && (__GNUC__ >= 11 && !defined __clang__) && !defined fdopen
/* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose. */ /* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (fdopen, FILE *, _GL_FUNCDECL_SYS (fdopen, FILE *,
(int fd, const char *mode) (int fd, const char *mode),
_GL_ATTRIBUTE_NOTHROW
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1) _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
_GL_ATTRIBUTE_MALLOC); _GL_ATTRIBUTE_MALLOC)
_GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (fdopen, FILE *, _GL_FUNCDECL_SYS (fdopen, FILE *,
(int fd, const char *mode) (int fd, const char *mode),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1) _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
_GL_ATTRIBUTE_MALLOC); _GL_ATTRIBUTE_MALLOC);
# endif # endif
@ -479,7 +482,7 @@ _GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
# undef fgetc # undef fgetc
# define fgetc rpl_fgetc # define fgetc rpl_fgetc
# endif # endif
_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (fgetc, int, (FILE *stream), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fgetc, int, (FILE *stream)); _GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
# else # else
_GL_CXXALIAS_SYS (fgetc, int, (FILE *stream)); _GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
@ -496,8 +499,8 @@ _GL_CXXALIASWARN (fgetc);
# define fgets rpl_fgets # define fgets rpl_fgets
# endif # endif
_GL_FUNCDECL_RPL (fgets, char *, _GL_FUNCDECL_RPL (fgets, char *,
(char *restrict s, int n, FILE *restrict stream) (char *restrict s, int n, FILE *restrict stream),
_GL_ARG_NONNULL ((1, 3))); _GL_ARG_NONNULL ((1, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fgets, char *, _GL_CXXALIAS_RPL (fgets, char *,
(char *restrict s, int n, FILE *restrict stream)); (char *restrict s, int n, FILE *restrict stream));
# else # else
@ -533,17 +536,18 @@ _GL_CXXALIASWARN (fileno);
# define fopen rpl_fopen # define fopen rpl_fopen
# endif # endif
_GL_FUNCDECL_RPL (fopen, FILE *, _GL_FUNCDECL_RPL (fopen, FILE *,
(const char *restrict filename, const char *restrict mode) (const char *restrict filename, const char *restrict mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1) _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
_GL_ATTRIBUTE_MALLOC); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fopen, FILE *, _GL_CXXALIAS_RPL (fopen, FILE *,
(const char *restrict filename, const char *restrict mode)); (const char *restrict filename, const char *restrict mode));
# else # else
# if __GNUC__ >= 11 # if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate fopen with fclose or rpl_fclose. */ /* For -Wmismatched-dealloc: Associate fopen with fclose or rpl_fclose. */
_GL_FUNCDECL_SYS (fopen, FILE *, _GL_FUNCDECL_SYS (fopen, FILE *,
(const char *restrict filename, const char *restrict mode) (const char *restrict filename, const char *restrict mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)); _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
_GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (fopen, FILE *, _GL_CXXALIAS_SYS (fopen, FILE *,
(const char *restrict filename, const char *restrict mode)); (const char *restrict filename, const char *restrict mode));
@ -552,10 +556,10 @@ _GL_CXXALIAS_SYS (fopen, FILE *,
_GL_CXXALIASWARN (fopen); _GL_CXXALIASWARN (fopen);
# endif # endif
#else #else
# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fopen # if @GNULIB_FCLOSE@ && (__GNUC__ >= 11 && !defined __clang__) && !defined fopen
/* For -Wmismatched-dealloc: Associate fopen with fclose or rpl_fclose. */ /* For -Wmismatched-dealloc: Associate fopen with fclose or rpl_fclose. */
_GL_FUNCDECL_SYS (fopen, FILE *, _GL_FUNCDECL_SYS (fopen, FILE *,
(const char *restrict filename, const char *restrict mode) (const char *restrict filename, const char *restrict mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1)); _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
# endif # endif
# if defined GNULIB_POSIXCHECK # if defined GNULIB_POSIXCHECK
@ -575,7 +579,7 @@ _GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX complian
directives nor widths, the only possible failure causes are ENOMEM directives nor widths, the only possible failure causes are ENOMEM
and the possible failure causes from fwrite(). */ and the possible failure causes from fwrite(). */
_GL_FUNCDECL_SYS (fzprintf, off64_t, _GL_FUNCDECL_SYS (fzprintf, off64_t,
(FILE *restrict fp, const char *restrict format, ...) (FILE *restrict fp, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (fzprintf, off64_t, _GL_CXXALIAS_SYS (fzprintf, off64_t,
@ -594,12 +598,12 @@ _GL_CXXALIAS_SYS (fzprintf, off64_t,
# define GNULIB_overrides_fprintf 1 # define GNULIB_overrides_fprintf 1
# if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@ # if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
_GL_FUNCDECL_RPL (fprintf, int, _GL_FUNCDECL_RPL (fprintf, int,
(FILE *restrict fp, const char *restrict format, ...) (FILE *restrict fp, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# else # else
_GL_FUNCDECL_RPL (fprintf, int, _GL_FUNCDECL_RPL (fprintf, int,
(FILE *restrict fp, const char *restrict format, ...) (FILE *restrict fp, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
@ -634,15 +638,17 @@ _GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define fpurge rpl_fpurge # define fpurge rpl_fpurge
# endif # endif
_GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream)); _GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
# else # else
# if !@HAVE_DECL_FPURGE@ # if !@HAVE_DECL_FPURGE@
_GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream), _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream)); _GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
# endif # endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (fpurge); _GL_CXXALIASWARN (fpurge);
# endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef fpurge # undef fpurge
# if HAVE_RAW_DECL_FPURGE # if HAVE_RAW_DECL_FPURGE
@ -657,7 +663,7 @@ _GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
# undef fputc # undef fputc
# define fputc rpl_fputc # define fputc rpl_fputc
# endif # endif
_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2))); _GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream), _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream)); _GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
# else # else
_GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream)); _GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
@ -674,7 +680,7 @@ _GL_CXXALIASWARN (fputc);
# define fputs rpl_fputs # define fputs rpl_fputs
# endif # endif
_GL_FUNCDECL_RPL (fputs, int, _GL_FUNCDECL_RPL (fputs, int,
(const char *restrict string, FILE *restrict stream) (const char *restrict string, FILE *restrict stream),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (fputs, int, _GL_CXXALIAS_RPL (fputs, int,
(const char *restrict string, FILE *restrict stream)); (const char *restrict string, FILE *restrict stream));
@ -695,8 +701,8 @@ _GL_CXXALIASWARN (fputs);
# endif # endif
_GL_FUNCDECL_RPL (fread, size_t, _GL_FUNCDECL_RPL (fread, size_t,
(void *restrict ptr, size_t s, size_t n, (void *restrict ptr, size_t s, size_t n,
FILE *restrict stream) FILE *restrict stream),
_GL_ARG_NONNULL ((4))); _GL_ARG_NONNULL ((4)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fread, size_t, _GL_CXXALIAS_RPL (fread, size_t,
(void *restrict ptr, size_t s, size_t n, (void *restrict ptr, size_t s, size_t n,
FILE *restrict stream)); FILE *restrict stream));
@ -718,8 +724,8 @@ _GL_CXXALIASWARN (fread);
# endif # endif
_GL_FUNCDECL_RPL (freopen, FILE *, _GL_FUNCDECL_RPL (freopen, FILE *,
(const char *restrict filename, const char *restrict mode, (const char *restrict filename, const char *restrict mode,
FILE *restrict stream) FILE *restrict stream),
_GL_ARG_NONNULL ((2, 3))); _GL_ARG_NONNULL ((2, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (freopen, FILE *, _GL_CXXALIAS_RPL (freopen, FILE *,
(const char *restrict filename, const char *restrict mode, (const char *restrict filename, const char *restrict mode,
FILE *restrict stream)); FILE *restrict stream));
@ -746,9 +752,9 @@ _GL_WARN_ON_USE (freopen,
# define fscanf rpl_fscanf # define fscanf rpl_fscanf
# endif # endif
_GL_FUNCDECL_RPL (fscanf, int, _GL_FUNCDECL_RPL (fscanf, int,
(FILE *restrict stream, const char *restrict format, ...) (FILE *restrict stream, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3) _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fscanf, int, _GL_CXXALIAS_RPL (fscanf, int,
(FILE *restrict stream, const char *restrict format, ...)); (FILE *restrict stream, const char *restrict format, ...));
# else # else
@ -802,7 +808,7 @@ _GL_CXXALIASWARN (fscanf);
# undef fseek # undef fseek
# define fseek rpl_fseek # define fseek rpl_fseek
# endif # endif
_GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence) _GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence)); _GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
# else # else
@ -825,12 +831,12 @@ _GL_CXXALIASWARN (fseek);
# undef fseeko # undef fseeko
# define fseeko rpl_fseeko # define fseeko rpl_fseeko
# endif # endif
_GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence) _GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)); _GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
# else # else
# if ! @HAVE_DECL_FSEEKO@ # if ! @HAVE_DECL_FSEEKO@
_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence) _GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)); _GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
@ -868,7 +874,8 @@ _GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
# undef ftell # undef ftell
# define ftell rpl_ftell # define ftell rpl_ftell
# endif # endif
_GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (ftell, long, (FILE *fp),
_GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (ftell, long, (FILE *fp)); _GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
# else # else
_GL_CXXALIAS_SYS (ftell, long, (FILE *fp)); _GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
@ -888,11 +895,13 @@ _GL_CXXALIASWARN (ftell);
# undef ftello # undef ftello
# define ftello rpl_ftello # define ftello rpl_ftello
# endif # endif
_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp),
_GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp)); _GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
# else # else
# if ! @HAVE_DECL_FTELLO@ # if ! @HAVE_DECL_FTELLO@
_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp),
_GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp)); _GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
# endif # endif
@ -925,7 +934,7 @@ _GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
# endif # endif
_GL_FUNCDECL_RPL (fwrite, size_t, _GL_FUNCDECL_RPL (fwrite, size_t,
(const void *restrict ptr, size_t s, size_t n, (const void *restrict ptr, size_t s, size_t n,
FILE *restrict stream) FILE *restrict stream),
_GL_ARG_NONNULL ((1, 4))); _GL_ARG_NONNULL ((1, 4)));
_GL_CXXALIAS_RPL (fwrite, size_t, _GL_CXXALIAS_RPL (fwrite, size_t,
(const void *restrict ptr, size_t s, size_t n, (const void *restrict ptr, size_t s, size_t n,
@ -940,9 +949,9 @@ _GL_CXXALIAS_SYS (fwrite, size_t,
which sometimes causes an unwanted diagnostic for fwrite calls. which sometimes causes an unwanted diagnostic for fwrite calls.
This affects only function declaration attributes under certain This affects only function declaration attributes under certain
versions of gcc and clang, and is not needed for C++. */ versions of gcc and clang, and is not needed for C++. */
# if (0 < __USE_FORTIFY_LEVEL \ # if (0 < __USE_FORTIFY_LEVEL \
&& __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \ && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
&& 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \ && (3 < __GNUC__ + (4 <= __GNUC_MINOR__) || defined __clang__) \
&& !defined __cplusplus) && !defined __cplusplus)
# undef fwrite # undef fwrite
# undef fwrite_unlocked # undef fwrite_unlocked
@ -969,7 +978,7 @@ _GL_CXXALIASWARN (fwrite);
# undef getc # undef getc
# define getc rpl_fgetc # define getc rpl_fgetc
# endif # endif
_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (fgetc, int, (FILE *stream), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream)); _GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
# else # else
_GL_CXXALIAS_SYS (getc, int, (FILE *stream)); _GL_CXXALIAS_SYS (getc, int, (FILE *stream));
@ -1010,8 +1019,8 @@ _GL_CXXALIASWARN (getchar);
_GL_FUNCDECL_RPL (getdelim, ssize_t, _GL_FUNCDECL_RPL (getdelim, ssize_t,
(char **restrict lineptr, size_t *restrict linesize, (char **restrict lineptr, size_t *restrict linesize,
int delimiter, int delimiter,
FILE *restrict stream) FILE *restrict stream),
_GL_ARG_NONNULL ((1, 2, 4))); _GL_ARG_NONNULL ((1, 2, 4)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getdelim, ssize_t, _GL_CXXALIAS_RPL (getdelim, ssize_t,
(char **restrict lineptr, size_t *restrict linesize, (char **restrict lineptr, size_t *restrict linesize,
int delimiter, int delimiter,
@ -1021,8 +1030,8 @@ _GL_CXXALIAS_RPL (getdelim, ssize_t,
_GL_FUNCDECL_SYS (getdelim, ssize_t, _GL_FUNCDECL_SYS (getdelim, ssize_t,
(char **restrict lineptr, size_t *restrict linesize, (char **restrict lineptr, size_t *restrict linesize,
int delimiter, int delimiter,
FILE *restrict stream) FILE *restrict stream),
_GL_ARG_NONNULL ((1, 2, 4))); _GL_ARG_NONNULL ((1, 2, 4)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (getdelim, ssize_t, _GL_CXXALIAS_SYS (getdelim, ssize_t,
(char **restrict lineptr, size_t *restrict linesize, (char **restrict lineptr, size_t *restrict linesize,
@ -1054,8 +1063,8 @@ _GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
# endif # endif
_GL_FUNCDECL_RPL (getline, ssize_t, _GL_FUNCDECL_RPL (getline, ssize_t,
(char **restrict lineptr, size_t *restrict linesize, (char **restrict lineptr, size_t *restrict linesize,
FILE *restrict stream) FILE *restrict stream),
_GL_ARG_NONNULL ((1, 2, 3))); _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getline, ssize_t, _GL_CXXALIAS_RPL (getline, ssize_t,
(char **restrict lineptr, size_t *restrict linesize, (char **restrict lineptr, size_t *restrict linesize,
FILE *restrict stream)); FILE *restrict stream));
@ -1063,8 +1072,8 @@ _GL_CXXALIAS_RPL (getline, ssize_t,
# if !@HAVE_DECL_GETLINE@ # if !@HAVE_DECL_GETLINE@
_GL_FUNCDECL_SYS (getline, ssize_t, _GL_FUNCDECL_SYS (getline, ssize_t,
(char **restrict lineptr, size_t *restrict linesize, (char **restrict lineptr, size_t *restrict linesize,
FILE *restrict stream) FILE *restrict stream),
_GL_ARG_NONNULL ((1, 2, 3))); _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (getline, ssize_t, _GL_CXXALIAS_SYS (getline, ssize_t,
(char **restrict lineptr, size_t *restrict linesize, (char **restrict lineptr, size_t *restrict linesize,
@ -1126,13 +1135,13 @@ struct obstack;
directives nor widths, the only possible failure code is through directives nor widths, the only possible failure code is through
obstack_alloc_failed_handler. */ obstack_alloc_failed_handler. */
_GL_FUNCDECL_SYS (obstack_zprintf, ptrdiff_t, _GL_FUNCDECL_SYS (obstack_zprintf, ptrdiff_t,
(struct obstack *obs, const char *format, ...) (struct obstack *obs, const char *format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (obstack_zprintf, ptrdiff_t, _GL_CXXALIAS_SYS (obstack_zprintf, ptrdiff_t,
(struct obstack *obs, const char *format, ...)); (struct obstack *obs, const char *format, ...));
_GL_FUNCDECL_SYS (obstack_vzprintf, ptrdiff_t, _GL_FUNCDECL_SYS (obstack_vzprintf, ptrdiff_t,
(struct obstack *obs, const char *format, va_list args) (struct obstack *obs, const char *format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (obstack_vzprintf, ptrdiff_t, _GL_CXXALIAS_SYS (obstack_vzprintf, ptrdiff_t,
@ -1151,7 +1160,7 @@ struct obstack;
# define obstack_printf rpl_obstack_printf # define obstack_printf rpl_obstack_printf
# endif # endif
_GL_FUNCDECL_RPL (obstack_printf, int, _GL_FUNCDECL_RPL (obstack_printf, int,
(struct obstack *obs, const char *format, ...) (struct obstack *obs, const char *format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (obstack_printf, int, _GL_CXXALIAS_RPL (obstack_printf, int,
@ -1159,7 +1168,7 @@ _GL_CXXALIAS_RPL (obstack_printf, int,
# else # else
# if !@HAVE_DECL_OBSTACK_PRINTF@ # if !@HAVE_DECL_OBSTACK_PRINTF@
_GL_FUNCDECL_SYS (obstack_printf, int, _GL_FUNCDECL_SYS (obstack_printf, int,
(struct obstack *obs, const char *format, ...) (struct obstack *obs, const char *format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
@ -1172,7 +1181,7 @@ _GL_CXXALIASWARN (obstack_printf);
# define obstack_vprintf rpl_obstack_vprintf # define obstack_vprintf rpl_obstack_vprintf
# endif # endif
_GL_FUNCDECL_RPL (obstack_vprintf, int, _GL_FUNCDECL_RPL (obstack_vprintf, int,
(struct obstack *obs, const char *format, va_list args) (struct obstack *obs, const char *format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (obstack_vprintf, int, _GL_CXXALIAS_RPL (obstack_vprintf, int,
@ -1180,7 +1189,7 @@ _GL_CXXALIAS_RPL (obstack_vprintf, int,
# else # else
# if !@HAVE_DECL_OBSTACK_PRINTF@ # if !@HAVE_DECL_OBSTACK_PRINTF@
_GL_FUNCDECL_SYS (obstack_vprintf, int, _GL_FUNCDECL_SYS (obstack_vprintf, int,
(struct obstack *obs, const char *format, va_list args) (struct obstack *obs, const char *format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
@ -1192,7 +1201,7 @@ _GL_CXXALIASWARN (obstack_vprintf);
#if @GNULIB_PCLOSE@ #if @GNULIB_PCLOSE@
# if !@HAVE_PCLOSE@ # if !@HAVE_PCLOSE@
_GL_FUNCDECL_SYS (pclose, int, (FILE *stream) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (pclose, int, (FILE *stream), _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (pclose, int, (FILE *stream)); _GL_CXXALIAS_SYS (pclose, int, (FILE *stream));
_GL_CXXALIASWARN (pclose); _GL_CXXALIASWARN (pclose);
@ -1234,25 +1243,26 @@ _GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
# define popen rpl_popen # define popen rpl_popen
# endif # endif
_GL_FUNCDECL_RPL (popen, FILE *, _GL_FUNCDECL_RPL (popen, FILE *,
(const char *cmd, const char *mode) (const char *cmd, const char *mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1) _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1)
_GL_ATTRIBUTE_MALLOC); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode)); _GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
# else # else
# if !@HAVE_POPEN@ || __GNUC__ >= 11 # if !@HAVE_POPEN@ || (__GNUC__ >= 11 && !defined __clang__)
_GL_FUNCDECL_SYS (popen, FILE *, _GL_FUNCDECL_SYS (popen, FILE *,
(const char *cmd, const char *mode) (const char *cmd, const char *mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1) _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1)
_GL_ATTRIBUTE_MALLOC); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode)); _GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
# endif # endif
_GL_CXXALIASWARN (popen); _GL_CXXALIASWARN (popen);
#else #else
# if @GNULIB_PCLOSE@ && __GNUC__ >= 11 && !defined popen # if @GNULIB_PCLOSE@ \
&& (__GNUC__ >= 11 && !defined __clang__) && !defined popen
/* For -Wmismatched-dealloc: Associate popen with pclose or rpl_pclose. */ /* For -Wmismatched-dealloc: Associate popen with pclose or rpl_pclose. */
_GL_FUNCDECL_SYS (popen, FILE *, _GL_FUNCDECL_SYS (popen, FILE *,
(const char *cmd, const char *mode) (const char *cmd, const char *mode),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1) _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1)
_GL_ATTRIBUTE_MALLOC); _GL_ATTRIBUTE_MALLOC);
# endif # endif
@ -1273,7 +1283,7 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
Therefore, if the format string is valid and does not use %ls/%lc Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure causes are ENOMEM directives nor widths, the only possible failure causes are ENOMEM
and the possible failure causes from fwrite(). */ and the possible failure causes from fwrite(). */
_GL_FUNCDECL_SYS (zprintf, off64_t, (const char *restrict format, ...) _GL_FUNCDECL_SYS (zprintf, off64_t, (const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (zprintf, off64_t, (const char *restrict format, ...)); _GL_CXXALIAS_SYS (zprintf, off64_t, (const char *restrict format, ...));
@ -1294,14 +1304,14 @@ _GL_CXXALIAS_SYS (zprintf, off64_t, (const char *restrict format, ...));
_GL_FUNCDECL_RPL_1 (__printf__, int, _GL_FUNCDECL_RPL_1 (__printf__, int,
(const char *restrict format, ...) (const char *restrict format, ...)
__asm__ (@ASM_SYMBOL_PREFIX@ __asm__ (@ASM_SYMBOL_PREFIX@
_GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf)) _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf)),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# else # else
_GL_FUNCDECL_RPL_1 (__printf__, int, _GL_FUNCDECL_RPL_1 (__printf__, int,
(const char *restrict format, ...) (const char *restrict format, ...)
__asm__ (@ASM_SYMBOL_PREFIX@ __asm__ (@ASM_SYMBOL_PREFIX@
_GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf)) _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf)),
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2) _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
@ -1311,7 +1321,7 @@ _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
# define printf rpl_printf # define printf rpl_printf
# endif # endif
_GL_FUNCDECL_RPL (printf, int, _GL_FUNCDECL_RPL (printf, int,
(const char *restrict format, ...) (const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (printf, int, (const char *restrict format, ...)); _GL_CXXALIAS_RPL (printf, int, (const char *restrict format, ...));
@ -1340,7 +1350,7 @@ _GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
# undef putc # undef putc
# define putc rpl_fputc # define putc rpl_fputc
# endif # endif
_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2))); _GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream), _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream)); _GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
# else # else
_GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream)); _GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
@ -1372,7 +1382,7 @@ _GL_CXXALIASWARN (putchar);
# undef puts # undef puts
# define puts rpl_puts # define puts rpl_puts
# endif # endif
_GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (puts, int, (const char *string), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (puts, int, (const char *string)); _GL_CXXALIAS_RPL (puts, int, (const char *string));
# else # else
_GL_CXXALIAS_SYS (puts, int, (const char *string)); _GL_CXXALIAS_SYS (puts, int, (const char *string));
@ -1412,7 +1422,7 @@ _GL_CXXALIASWARN (putw);
# undef remove # undef remove
# define remove rpl_remove # define remove rpl_remove
# endif # endif
_GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (remove, int, (const char *name), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (remove, int, (const char *name)); _GL_CXXALIAS_RPL (remove, int, (const char *name));
# else # else
_GL_CXXALIAS_SYS (remove, int, (const char *name)); _GL_CXXALIAS_SYS (remove, int, (const char *name));
@ -1434,7 +1444,7 @@ _GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - "
# define rename rpl_rename # define rename rpl_rename
# endif # endif
_GL_FUNCDECL_RPL (rename, int, _GL_FUNCDECL_RPL (rename, int,
(const char *old_filename, const char *new_filename) (const char *old_filename, const char *new_filename),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (rename, int, _GL_CXXALIAS_RPL (rename, int,
(const char *old_filename, const char *new_filename)); (const char *old_filename, const char *new_filename));
@ -1459,14 +1469,14 @@ _GL_WARN_ON_USE (rename, "rename is buggy on some platforms - "
# define renameat rpl_renameat # define renameat rpl_renameat
# endif # endif
_GL_FUNCDECL_RPL (renameat, int, _GL_FUNCDECL_RPL (renameat, int,
(int fd1, char const *file1, int fd2, char const *file2) (int fd1, char const *file1, int fd2, char const *file2),
_GL_ARG_NONNULL ((2, 4))); _GL_ARG_NONNULL ((2, 4)));
_GL_CXXALIAS_RPL (renameat, int, _GL_CXXALIAS_RPL (renameat, int,
(int fd1, char const *file1, int fd2, char const *file2)); (int fd1, char const *file1, int fd2, char const *file2));
# else # else
# if !@HAVE_RENAMEAT@ # if !@HAVE_RENAMEAT@
_GL_FUNCDECL_SYS (renameat, int, _GL_FUNCDECL_SYS (renameat, int,
(int fd1, char const *file1, int fd2, char const *file2) (int fd1, char const *file1, int fd2, char const *file2),
_GL_ARG_NONNULL ((2, 4))); _GL_ARG_NONNULL ((2, 4)));
# endif # endif
_GL_CXXALIAS_SYS (renameat, int, _GL_CXXALIAS_SYS (renameat, int,
@ -1492,18 +1502,18 @@ _GL_WARN_ON_USE (renameat, "renameat is not portable - "
_GL_FUNCDECL_RPL_1 (__scanf__, int, _GL_FUNCDECL_RPL_1 (__scanf__, int,
(const char *restrict format, ...) (const char *restrict format, ...)
__asm__ (@ASM_SYMBOL_PREFIX@ __asm__ (@ASM_SYMBOL_PREFIX@
_GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf)) _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf)),
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2) _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *restrict format, ...)); _GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *restrict format, ...));
# else # else
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef scanf # undef scanf
# define scanf rpl_scanf # define scanf rpl_scanf
# endif # endif
_GL_FUNCDECL_RPL (scanf, int, (const char *restrict format, ...) _GL_FUNCDECL_RPL (scanf, int, (const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2) _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (scanf, int, (const char *restrict format, ...)); _GL_CXXALIAS_RPL (scanf, int, (const char *restrict format, ...));
# endif # endif
# else # else
@ -1525,7 +1535,7 @@ _GL_CXXALIASWARN (scanf);
directives nor widths, the only possible failure code is ENOMEM. */ directives nor widths, the only possible failure code is ENOMEM. */
_GL_FUNCDECL_SYS (snzprintf, ptrdiff_t, _GL_FUNCDECL_SYS (snzprintf, ptrdiff_t,
(char *restrict str, size_t size, (char *restrict str, size_t size,
const char *restrict format, ...) const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
_GL_ARG_NONNULL ((3))); _GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_SYS (snzprintf, ptrdiff_t, _GL_CXXALIAS_SYS (snzprintf, ptrdiff_t,
@ -1546,7 +1556,7 @@ _GL_CXXALIAS_SYS (snzprintf, ptrdiff_t,
# define GNULIB_overrides_snprintf 1 # define GNULIB_overrides_snprintf 1
_GL_FUNCDECL_RPL (snprintf, int, _GL_FUNCDECL_RPL (snprintf, int,
(char *restrict str, size_t size, (char *restrict str, size_t size,
const char *restrict format, ...) const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
_GL_ARG_NONNULL ((3))); _GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_RPL (snprintf, int, _GL_CXXALIAS_RPL (snprintf, int,
@ -1556,7 +1566,7 @@ _GL_CXXALIAS_RPL (snprintf, int,
# if !@HAVE_DECL_SNPRINTF@ # if !@HAVE_DECL_SNPRINTF@
_GL_FUNCDECL_SYS (snprintf, int, _GL_FUNCDECL_SYS (snprintf, int,
(char *restrict str, size_t size, (char *restrict str, size_t size,
const char *restrict format, ...) const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
_GL_ARG_NONNULL ((3))); _GL_ARG_NONNULL ((3)));
# endif # endif
@ -1584,7 +1594,7 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
directives nor widths, the only possible failure code is ENOMEM. */ directives nor widths, the only possible failure code is ENOMEM. */
_GL_FUNCDECL_SYS (szprintf, ptrdiff_t, _GL_FUNCDECL_SYS (szprintf, ptrdiff_t,
(char *restrict str, (char *restrict str,
const char *restrict format, ...) const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (szprintf, ptrdiff_t, _GL_CXXALIAS_SYS (szprintf, ptrdiff_t,
@ -1611,7 +1621,7 @@ _GL_CXXALIAS_SYS (szprintf, ptrdiff_t,
# endif # endif
# define GNULIB_overrides_sprintf 1 # define GNULIB_overrides_sprintf 1
_GL_FUNCDECL_RPL (sprintf, int, _GL_FUNCDECL_RPL (sprintf, int,
(char *restrict str, const char *restrict format, ...) (char *restrict str, const char *restrict format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (sprintf, int, _GL_CXXALIAS_RPL (sprintf, int,
@ -1652,16 +1662,18 @@ _GL_CXXALIASWARN (tempnam);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define tmpfile rpl_tmpfile # define tmpfile rpl_tmpfile
# endif # endif
_GL_FUNCDECL_RPL (tmpfile, FILE *, (void) _GL_FUNCDECL_RPL (tmpfile, FILE *, (void),
_GL_ATTRIBUTE_DEALLOC (fclose, 1) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
_GL_ATTRIBUTE_MALLOC); _GL_ATTRIBUTE_MALLOC
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (tmpfile, FILE *, (void)); _GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
# else # else
# if __GNUC__ >= 11 # if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose. */ /* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose. */
_GL_FUNCDECL_SYS (tmpfile, FILE *, (void) _GL_FUNCDECL_SYS (tmpfile, FILE *, (void),
_GL_ATTRIBUTE_DEALLOC (fclose, 1) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
_GL_ATTRIBUTE_MALLOC); _GL_ATTRIBUTE_MALLOC
_GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (tmpfile, FILE *, (void)); _GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
# endif # endif
@ -1669,9 +1681,10 @@ _GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
_GL_CXXALIASWARN (tmpfile); _GL_CXXALIASWARN (tmpfile);
# endif # endif
#else #else
# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined tmpfile # if @GNULIB_FCLOSE@ \
&& (__GNUC__ >= 11 && !defined __clang__) && !defined tmpfile
/* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose. */ /* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose. */
_GL_FUNCDECL_SYS (tmpfile, FILE *, (void) _GL_FUNCDECL_SYS (tmpfile, FILE *, (void),
_GL_ATTRIBUTE_DEALLOC (fclose, 1) _GL_ATTRIBUTE_DEALLOC (fclose, 1)
_GL_ATTRIBUTE_MALLOC); _GL_ATTRIBUTE_MALLOC);
# endif # endif
@ -1694,15 +1707,17 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
Therefore, if the format string is valid and does not use %ls/%lc Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure code is ENOMEM. */ directives nor widths, the only possible failure code is ENOMEM. */
_GL_FUNCDECL_SYS (aszprintf, ptrdiff_t, _GL_FUNCDECL_SYS (aszprintf, ptrdiff_t,
(char **result, const char *format, ...) (char **result, const char *format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2))
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_SYS (aszprintf, ptrdiff_t, _GL_CXXALIAS_SYS (aszprintf, ptrdiff_t,
(char **result, const char *format, ...)); (char **result, const char *format, ...));
_GL_FUNCDECL_SYS (vaszprintf, ptrdiff_t, _GL_FUNCDECL_SYS (vaszprintf, ptrdiff_t,
(char **result, const char *format, va_list args) (char **result, const char *format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2))
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_SYS (vaszprintf, ptrdiff_t, _GL_CXXALIAS_SYS (vaszprintf, ptrdiff_t,
(char **result, const char *format, va_list args)); (char **result, const char *format, va_list args));
#endif #endif
@ -1718,17 +1733,19 @@ _GL_CXXALIAS_SYS (vaszprintf, ptrdiff_t,
# endif # endif
# define GNULIB_overrides_asprintf # define GNULIB_overrides_asprintf
_GL_FUNCDECL_RPL (asprintf, int, _GL_FUNCDECL_RPL (asprintf, int,
(char **result, const char *format, ...) (char **result, const char *format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2))
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (asprintf, int, _GL_CXXALIAS_RPL (asprintf, int,
(char **result, const char *format, ...)); (char **result, const char *format, ...));
# else # else
# if !@HAVE_VASPRINTF@ # if !@HAVE_VASPRINTF@
_GL_FUNCDECL_SYS (asprintf, int, _GL_FUNCDECL_SYS (asprintf, int,
(char **result, const char *format, ...) (char **result, const char *format, ...),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2))
_GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (asprintf, int, _GL_CXXALIAS_SYS (asprintf, int,
(char **result, const char *format, ...)); (char **result, const char *format, ...));
@ -1740,17 +1757,19 @@ _GL_CXXALIASWARN (asprintf);
# endif # endif
# define GNULIB_overrides_vasprintf 1 # define GNULIB_overrides_vasprintf 1
_GL_FUNCDECL_RPL (vasprintf, int, _GL_FUNCDECL_RPL (vasprintf, int,
(char **result, const char *format, va_list args) (char **result, const char *format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2))
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (vasprintf, int, _GL_CXXALIAS_RPL (vasprintf, int,
(char **result, const char *format, va_list args)); (char **result, const char *format, va_list args));
# else # else
# if !@HAVE_VASPRINTF@ # if !@HAVE_VASPRINTF@
_GL_FUNCDECL_SYS (vasprintf, int, _GL_FUNCDECL_SYS (vasprintf, int,
(char **result, const char *format, va_list args) (char **result, const char *format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2))
_GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (vasprintf, int, _GL_CXXALIAS_SYS (vasprintf, int,
(char **result, const char *format, va_list args)); (char **result, const char *format, va_list args));
@ -1767,7 +1786,7 @@ _GL_CXXALIASWARN (vasprintf);
directives nor widths, the only possible failure codes are ENOMEM directives nor widths, the only possible failure codes are ENOMEM
and the possible failure codes from write(), excluding EINTR. */ and the possible failure codes from write(), excluding EINTR. */
_GL_FUNCDECL_SYS (vdzprintf, off64_t, _GL_FUNCDECL_SYS (vdzprintf, off64_t,
(int fd, const char *restrict format, va_list args) (int fd, const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_SYS (vdzprintf, off64_t, _GL_CXXALIAS_SYS (vdzprintf, off64_t,
@ -1783,7 +1802,7 @@ _GL_CXXALIAS_SYS (vdzprintf, off64_t,
# define vdprintf rpl_vdprintf # define vdprintf rpl_vdprintf
# endif # endif
_GL_FUNCDECL_RPL (vdprintf, int, _GL_FUNCDECL_RPL (vdprintf, int,
(int fd, const char *restrict format, va_list args) (int fd, const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (vdprintf, int, _GL_CXXALIAS_RPL (vdprintf, int,
@ -1791,7 +1810,7 @@ _GL_CXXALIAS_RPL (vdprintf, int,
# else # else
# if !@HAVE_VDPRINTF@ # if !@HAVE_VDPRINTF@
_GL_FUNCDECL_SYS (vdprintf, int, _GL_FUNCDECL_SYS (vdprintf, int,
(int fd, const char *restrict format, va_list args) (int fd, const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
# endif # endif
@ -1821,7 +1840,7 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
and the possible failure causes from fwrite(). */ and the possible failure causes from fwrite(). */
_GL_FUNCDECL_SYS (vfzprintf, off64_t, _GL_FUNCDECL_SYS (vfzprintf, off64_t,
(FILE *restrict fp, (FILE *restrict fp,
const char *restrict format, va_list args) const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (vfzprintf, off64_t, _GL_CXXALIAS_SYS (vfzprintf, off64_t,
@ -1842,13 +1861,13 @@ _GL_CXXALIAS_SYS (vfzprintf, off64_t,
# if @GNULIB_VFPRINTF_POSIX@ # if @GNULIB_VFPRINTF_POSIX@
_GL_FUNCDECL_RPL (vfprintf, int, _GL_FUNCDECL_RPL (vfprintf, int,
(FILE *restrict fp, (FILE *restrict fp,
const char *restrict format, va_list args) const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# else # else
_GL_FUNCDECL_RPL (vfprintf, int, _GL_FUNCDECL_RPL (vfprintf, int,
(FILE *restrict fp, (FILE *restrict fp,
const char *restrict format, va_list args) const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
@ -1885,9 +1904,9 @@ _GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
# endif # endif
_GL_FUNCDECL_RPL (vfscanf, int, _GL_FUNCDECL_RPL (vfscanf, int,
(FILE *restrict stream, (FILE *restrict stream,
const char *restrict format, va_list args) const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0) _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (vfscanf, int, _GL_CXXALIAS_RPL (vfscanf, int,
(FILE *restrict stream, (FILE *restrict stream,
const char *restrict format, va_list args)); const char *restrict format, va_list args));
@ -1909,9 +1928,10 @@ _GL_CXXALIASWARN (vfscanf);
Therefore, if the format string is valid and does not use %ls/%lc Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure causes are ENOMEM directives nor widths, the only possible failure causes are ENOMEM
and the possible failure causes from fwrite(). */ and the possible failure causes from fwrite(). */
_GL_FUNCDECL_SYS (vzprintf, off64_t, (const char *restrict format, va_list args) _GL_FUNCDECL_SYS (vzprintf, off64_t,
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0) (const char *restrict format, va_list args),
_GL_ARG_NONNULL ((1))); _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (vzprintf, off64_t, _GL_CXXALIAS_SYS (vzprintf, off64_t,
(const char *restrict format, va_list args)); (const char *restrict format, va_list args));
#endif #endif
@ -1927,11 +1947,11 @@ _GL_CXXALIAS_SYS (vzprintf, off64_t,
# endif # endif
# define GNULIB_overrides_vprintf 1 # define GNULIB_overrides_vprintf 1
# if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@ # if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args) _GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0)
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# else # else
_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args) _GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
@ -1963,9 +1983,9 @@ _GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
# undef vscanf # undef vscanf
# define vscanf rpl_vscanf # define vscanf rpl_vscanf
# endif # endif
_GL_FUNCDECL_RPL (vscanf, int, (const char *restrict format, va_list args) _GL_FUNCDECL_RPL (vscanf, int, (const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0) _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (vscanf, int, (const char *restrict format, va_list args)); _GL_CXXALIAS_RPL (vscanf, int, (const char *restrict format, va_list args));
# else # else
_GL_CXXALIAS_SYS (vscanf, int, (const char *restrict format, va_list args)); _GL_CXXALIAS_SYS (vscanf, int, (const char *restrict format, va_list args));
@ -1986,7 +2006,7 @@ _GL_CXXALIASWARN (vscanf);
directives nor widths, the only possible failure code is ENOMEM. */ directives nor widths, the only possible failure code is ENOMEM. */
_GL_FUNCDECL_SYS (vsnzprintf, ptrdiff_t, _GL_FUNCDECL_SYS (vsnzprintf, ptrdiff_t,
(char *restrict str, size_t size, (char *restrict str, size_t size,
const char *restrict format, va_list args) const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
_GL_ARG_NONNULL ((3))); _GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_SYS (vsnzprintf, ptrdiff_t, _GL_CXXALIAS_SYS (vsnzprintf, ptrdiff_t,
@ -2007,7 +2027,7 @@ _GL_CXXALIAS_SYS (vsnzprintf, ptrdiff_t,
# define GNULIB_overrides_vsnprintf 1 # define GNULIB_overrides_vsnprintf 1
_GL_FUNCDECL_RPL (vsnprintf, int, _GL_FUNCDECL_RPL (vsnprintf, int,
(char *restrict str, size_t size, (char *restrict str, size_t size,
const char *restrict format, va_list args) const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
_GL_ARG_NONNULL ((3))); _GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_RPL (vsnprintf, int, _GL_CXXALIAS_RPL (vsnprintf, int,
@ -2017,7 +2037,7 @@ _GL_CXXALIAS_RPL (vsnprintf, int,
# if !@HAVE_DECL_VSNPRINTF@ # if !@HAVE_DECL_VSNPRINTF@
_GL_FUNCDECL_SYS (vsnprintf, int, _GL_FUNCDECL_SYS (vsnprintf, int,
(char *restrict str, size_t size, (char *restrict str, size_t size,
const char *restrict format, va_list args) const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
_GL_ARG_NONNULL ((3))); _GL_ARG_NONNULL ((3)));
# endif # endif
@ -2045,7 +2065,7 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
directives nor widths, the only possible failure code is ENOMEM. */ directives nor widths, the only possible failure code is ENOMEM. */
_GL_FUNCDECL_SYS (vszprintf, ptrdiff_t, _GL_FUNCDECL_SYS (vszprintf, ptrdiff_t,
(char *restrict str, (char *restrict str,
const char *restrict format, va_list args) const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (vszprintf, ptrdiff_t, _GL_CXXALIAS_SYS (vszprintf, ptrdiff_t,
@ -2064,7 +2084,7 @@ _GL_CXXALIAS_SYS (vszprintf, ptrdiff_t,
# define GNULIB_overrides_vsprintf 1 # define GNULIB_overrides_vsprintf 1
_GL_FUNCDECL_RPL (vsprintf, int, _GL_FUNCDECL_RPL (vsprintf, int,
(char *restrict str, (char *restrict str,
const char *restrict format, va_list args) const char *restrict format, va_list args),
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (vsprintf, int, _GL_CXXALIAS_RPL (vsprintf, int,

View file

@ -51,8 +51,8 @@
#define _@GUARD_PREFIX@_STDLIB_H #define _@GUARD_PREFIX@_STDLIB_H
/* This file uses _Noreturn, _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC, /* This file uses _Noreturn, _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
_GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK, _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PURE,
HAVE_RAW_DECL_*. */ GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED #if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first." #error "Please include config.h first."
#endif #endif
@ -132,7 +132,7 @@ struct random_data
that can be freed by passing them as the Ith argument to the that can be freed by passing them as the Ith argument to the
function F. */ function F. */
#ifndef _GL_ATTRIBUTE_DEALLOC #ifndef _GL_ATTRIBUTE_DEALLOC
# if __GNUC__ >= 11 # if __GNUC__ >= 11 && !defined __clang__
# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
# else # else
# define _GL_ATTRIBUTE_DEALLOC(f, i) # define _GL_ATTRIBUTE_DEALLOC(f, i)
@ -161,7 +161,7 @@ struct random_data
*/ */
#ifndef _GL_ATTRIBUTE_NOTHROW #ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus # if defined __cplusplus
# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4 # if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L # if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true) # define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else # else
@ -241,6 +241,9 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
#if @GNULIB_ABORT_DEBUG@ #if @GNULIB_ABORT_DEBUG@
/* Terminates the current process with signal SIGABRT.
Note: While the original abort() function is safe to call in signal handlers,
the overridden abort() function is not. */
# if @REPLACE_ABORT@ # if @REPLACE_ABORT@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef abort # undef abort
@ -255,14 +258,6 @@ _GL_CXXALIAS_SYS (abort, void, (void));
_GL_CXXALIASWARN (abort); _GL_CXXALIASWARN (abort);
# endif # endif
#endif #endif
#if @GNULIB_ABORT_DEBUG@ && @REPLACE_ABORT@
_GL_EXTERN_C void _gl_pre_abort (void);
#else
# if !GNULIB_defined_gl_pre_abort
# define _gl_pre_abort() /* nothing */
# define GNULIB_defined_gl_pre_abort 1
# endif
#endif
#if @GNULIB_FREE_POSIX@ #if @GNULIB_FREE_POSIX@
@ -272,7 +267,7 @@ _GL_EXTERN_C void _gl_pre_abort (void);
# define free rpl_free # define free rpl_free
# endif # endif
# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2) # if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
_GL_FUNCDECL_RPL (free, void, (void *ptr) _GL_ATTRIBUTE_NOTHROW); _GL_FUNCDECL_RPL (free, void, (void *ptr)) _GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_RPL (free, void, (void *ptr)); _GL_FUNCDECL_RPL (free, void, (void *ptr));
# endif # endif
@ -299,22 +294,25 @@ _GL_WARN_ON_USE (free, "free is not future POSIX compliant everywhere - "
# define aligned_alloc rpl_aligned_alloc # define aligned_alloc rpl_aligned_alloc
# endif # endif
_GL_FUNCDECL_RPL (aligned_alloc, void *, _GL_FUNCDECL_RPL (aligned_alloc, void *,
(size_t alignment, size_t size) (size_t alignment, size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size)); _GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size));
# else # else
# if @HAVE_ALIGNED_ALLOC@ # if @HAVE_ALIGNED_ALLOC@
# if __GNUC__ >= 11 # if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */ /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2
_GL_FUNCDECL_SYS (aligned_alloc, void *, _GL_FUNCDECL_SYS (aligned_alloc, void *,
(size_t alignment, size_t size) (size_t alignment, size_t size),
_GL_ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_NODISCARD)
_GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (aligned_alloc, void *, _GL_FUNCDECL_SYS (aligned_alloc, void *,
(size_t alignment, size_t size) (size_t alignment, size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_NODISCARD);
# endif # endif
# endif # endif
_GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size)); _GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
@ -324,16 +322,17 @@ _GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
_GL_CXXALIASWARN (aligned_alloc); _GL_CXXALIASWARN (aligned_alloc);
# endif # endif
#else #else
# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined aligned_alloc # if @GNULIB_FREE_POSIX@ \
&& (__GNUC__ >= 11 && !defined __clang__) && !defined aligned_alloc
/* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */ /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2
_GL_FUNCDECL_SYS (aligned_alloc, void *, _GL_FUNCDECL_SYS (aligned_alloc, void *,
(size_t alignment, size_t size) (size_t alignment, size_t size),
_GL_ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (aligned_alloc, void *, _GL_FUNCDECL_SYS (aligned_alloc, void *,
(size_t alignment, size_t size) (size_t alignment, size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif # endif
# endif # endif
@ -350,9 +349,10 @@ _GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - "
/* Parse a signed decimal integer. /* Parse a signed decimal integer.
Returns the value of the integer. Errors are not detected. */ Returns the value of the integer. Errors are not detected. */
# if !@HAVE_ATOLL@ # if !@HAVE_ATOLL@
_GL_FUNCDECL_SYS (atoll, long long, (const char *string) _GL_FUNCDECL_SYS (atoll, long long,
_GL_ATTRIBUTE_PURE (const char *string),
_GL_ARG_NONNULL ((1))); _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (atoll, long long, (const char *string)); _GL_CXXALIAS_SYS (atoll, long long, (const char *string));
_GL_CXXALIASWARN (atoll); _GL_CXXALIASWARN (atoll);
@ -372,21 +372,24 @@ _GL_WARN_ON_USE (atoll, "atoll is unportable - "
# define calloc rpl_calloc # define calloc rpl_calloc
# endif # endif
_GL_FUNCDECL_RPL (calloc, void *, _GL_FUNCDECL_RPL (calloc, void *,
(size_t nmemb, size_t size) (size_t nmemb, size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size)); _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
# else # else
# if __GNUC__ >= 11 # if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */ /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (calloc, void *, _GL_FUNCDECL_SYS (calloc, void *,
(size_t nmemb, size_t size) (size_t nmemb, size_t size),
_GL_ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_NODISCARD)
_GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (calloc, void *, _GL_FUNCDECL_SYS (calloc, void *,
(size_t nmemb, size_t size) (size_t nmemb, size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_NODISCARD);
# endif # endif
# endif # endif
_GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size)); _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
@ -395,16 +398,17 @@ _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
_GL_CXXALIASWARN (calloc); _GL_CXXALIASWARN (calloc);
# endif # endif
#else #else
# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined calloc # if @GNULIB_FREE_POSIX@ \
&& (__GNUC__ >= 11 && !defined __clang__) && !defined calloc
/* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */ /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (calloc, void *, _GL_FUNCDECL_SYS (calloc, void *,
(size_t nmemb, size_t size) (size_t nmemb, size_t size),
_GL_ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (calloc, void *, _GL_FUNCDECL_SYS (calloc, void *,
(size_t nmemb, size_t size) (size_t nmemb, size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif # endif
# endif # endif
@ -422,23 +426,26 @@ _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
# define canonicalize_file_name rpl_canonicalize_file_name # define canonicalize_file_name rpl_canonicalize_file_name
# endif # endif
_GL_FUNCDECL_RPL (canonicalize_file_name, char *, _GL_FUNCDECL_RPL (canonicalize_file_name, char *,
(const char *name) (const char *name),
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name)); _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
# else # else
# if !@HAVE_CANONICALIZE_FILE_NAME@ || __GNUC__ >= 11 # if !@HAVE_CANONICALIZE_FILE_NAME@ || (__GNUC__ >= 11 && !defined __clang__)
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (canonicalize_file_name, char *, _GL_FUNCDECL_SYS (canonicalize_file_name, char *,
(const char *name) (const char *name),
_GL_ATTRIBUTE_NOTHROW
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_NODISCARD)
_GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (canonicalize_file_name, char *, _GL_FUNCDECL_SYS (canonicalize_file_name, char *,
(const char *name) (const char *name),
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_NODISCARD);
# endif # endif
# endif # endif
_GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name)); _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
@ -449,18 +456,19 @@ _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
# endif # endif
_GL_CXXALIASWARN (canonicalize_file_name); _GL_CXXALIASWARN (canonicalize_file_name);
#else #else
# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined canonicalize_file_name # if @GNULIB_FREE_POSIX@ \
&& (__GNUC__ >= 11 && !defined __clang__) && !defined canonicalize_file_name
/* For -Wmismatched-dealloc: Associate canonicalize_file_name with free or /* For -Wmismatched-dealloc: Associate canonicalize_file_name with free or
rpl_free. */ rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (canonicalize_file_name, char *, _GL_FUNCDECL_SYS (canonicalize_file_name, char *,
(const char *name) (const char *name),
_GL_ATTRIBUTE_NOTHROW
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
_GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (canonicalize_file_name, char *, _GL_FUNCDECL_SYS (canonicalize_file_name, char *,
(const char *name) (const char *name),
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif # endif
@ -552,12 +560,12 @@ _GL_CXXALIASWARN (gcvt);
# undef getloadavg # undef getloadavg
# define getloadavg rpl_getloadavg # define getloadavg rpl_getloadavg
# endif # endif
_GL_FUNCDECL_RPL (getloadavg, int, (double loadavg[], int nelem) _GL_FUNCDECL_RPL (getloadavg, int, (double loadavg[], int nelem),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (getloadavg, int, (double loadavg[], int nelem)); _GL_CXXALIAS_RPL (getloadavg, int, (double loadavg[], int nelem));
# else # else
# if !@HAVE_DECL_GETLOADAVG@ # if !@HAVE_DECL_GETLOADAVG@
_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem) _GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem)); _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
@ -582,7 +590,7 @@ _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
# define getprogname rpl_getprogname # define getprogname rpl_getprogname
# endif # endif
# if @HAVE_DECL_PROGRAM_INVOCATION_NAME@ # if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
_GL_FUNCDECL_RPL (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE); _GL_FUNCDECL_RPL (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE);
# else # else
_GL_FUNCDECL_RPL (getprogname, const char *, (void)); _GL_FUNCDECL_RPL (getprogname, const char *, (void));
# endif # endif
@ -590,7 +598,7 @@ _GL_CXXALIAS_RPL (getprogname, const char *, (void));
# else # else
# if !@HAVE_GETPROGNAME@ # if !@HAVE_GETPROGNAME@
# if @HAVE_DECL_PROGRAM_INVOCATION_NAME@ # if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
_GL_FUNCDECL_SYS (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE); _GL_FUNCDECL_SYS (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE);
# else # else
_GL_FUNCDECL_SYS (getprogname, const char *, (void)); _GL_FUNCDECL_SYS (getprogname, const char *, (void));
# endif # endif
@ -626,15 +634,15 @@ _GL_WARN_ON_USE (getprogname, "getprogname is unportable - "
# define getsubopt rpl_getsubopt # define getsubopt rpl_getsubopt
# endif # endif
_GL_FUNCDECL_RPL (getsubopt, int, _GL_FUNCDECL_RPL (getsubopt, int,
(char **optionp, char *const *tokens, char **valuep) (char **optionp, char *const *tokens, char **valuep),
_GL_ARG_NONNULL ((1, 2, 3))); _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getsubopt, int, _GL_CXXALIAS_RPL (getsubopt, int,
(char **optionp, char *const *tokens, char **valuep)); (char **optionp, char *const *tokens, char **valuep));
# else # else
# if !@HAVE_GETSUBOPT@ # if !@HAVE_GETSUBOPT@
_GL_FUNCDECL_SYS (getsubopt, int, _GL_FUNCDECL_SYS (getsubopt, int,
(char **optionp, char *const *tokens, char **valuep) (char **optionp, char *const *tokens, char **valuep),
_GL_ARG_NONNULL ((1, 2, 3))); _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (getsubopt, int, _GL_CXXALIAS_SYS (getsubopt, int,
(char **optionp, char *const *tokens, char **valuep)); (char **optionp, char *const *tokens, char **valuep));
@ -679,21 +687,24 @@ _GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
# define malloc rpl_malloc # define malloc rpl_malloc
# endif # endif
_GL_FUNCDECL_RPL (malloc, void *, _GL_FUNCDECL_RPL (malloc, void *,
(size_t size) (size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (malloc, void *, (size_t size)); _GL_CXXALIAS_RPL (malloc, void *, (size_t size));
# else # else
# if __GNUC__ >= 11 # if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */ /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (malloc, void *, _GL_FUNCDECL_SYS (malloc, void *,
(size_t size) (size_t size),
_GL_ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_NODISCARD)
_GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (malloc, void *, _GL_FUNCDECL_SYS (malloc, void *,
(size_t size) (size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_NODISCARD);
# endif # endif
# endif # endif
_GL_CXXALIAS_SYS (malloc, void *, (size_t size)); _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
@ -702,16 +713,17 @@ _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
_GL_CXXALIASWARN (malloc); _GL_CXXALIASWARN (malloc);
# endif # endif
#else #else
# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined malloc # if @GNULIB_FREE_POSIX@ \
&& (__GNUC__ >= 11 && !defined __clang__) && !defined malloc
/* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */ /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (malloc, void *, _GL_FUNCDECL_SYS (malloc, void *,
(size_t size) (size_t size),
_GL_ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (malloc, void *, _GL_FUNCDECL_SYS (malloc, void *,
(size_t size) (size_t size),
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif # endif
# endif # endif
@ -747,7 +759,7 @@ int gl_MB_CUR_MAX (void)
# endif # endif
_GL_FUNCDECL_RPL (mbstowcs, size_t, _GL_FUNCDECL_RPL (mbstowcs, size_t,
(wchar_t *restrict dest, const char *restrict src, (wchar_t *restrict dest, const char *restrict src,
size_t len) size_t len),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (mbstowcs, size_t, _GL_CXXALIAS_RPL (mbstowcs, size_t,
(wchar_t *restrict dest, const char *restrict src, (wchar_t *restrict dest, const char *restrict src,
@ -805,7 +817,9 @@ _GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - "
Returns TEMPLATE, or a null pointer if it cannot get a unique name. Returns TEMPLATE, or a null pointer if it cannot get a unique name.
The directory is created mode 700. */ The directory is created mode 700. */
# if !@HAVE_MKDTEMP@ # if !@HAVE_MKDTEMP@
_GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (mkdtemp, char *,
(char * /*template*/),
_GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/)); _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
_GL_CXXALIASWARN (mkdtemp); _GL_CXXALIASWARN (mkdtemp);
@ -835,13 +849,13 @@ _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
# undef mkostemp # undef mkostemp
# define mkostemp rpl_mkostemp # define mkostemp rpl_mkostemp
# endif # endif
_GL_FUNCDECL_RPL (mkostemp, int, (char * /*template*/, int /*flags*/) _GL_FUNCDECL_RPL (mkostemp, int, (char * /*template*/, int /*flags*/),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (mkostemp, int, (char * /*template*/, int /*flags*/)); _GL_CXXALIAS_RPL (mkostemp, int, (char * /*template*/, int /*flags*/));
# else # else
# if !@HAVE_MKOSTEMP@ # if !@HAVE_MKOSTEMP@
_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/) _GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)); _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
# endif # endif
@ -876,15 +890,15 @@ _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
# define mkostemps rpl_mkostemps # define mkostemps rpl_mkostemps
# endif # endif
_GL_FUNCDECL_RPL (mkostemps, int, _GL_FUNCDECL_RPL (mkostemps, int,
(char * /*template*/, int /*suffixlen*/, int /*flags*/) (char * /*template*/, int /*suffixlen*/, int /*flags*/),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (mkostemps, int, _GL_CXXALIAS_RPL (mkostemps, int,
(char * /*template*/, int /*suffixlen*/, int /*flags*/)); (char * /*template*/, int /*suffixlen*/, int /*flags*/));
# else # else
# if !@HAVE_MKOSTEMPS@ # if !@HAVE_MKOSTEMPS@
_GL_FUNCDECL_SYS (mkostemps, int, _GL_FUNCDECL_SYS (mkostemps, int,
(char * /*template*/, int /*suffixlen*/, int /*flags*/) (char * /*template*/, int /*suffixlen*/, int /*flags*/),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (mkostemps, int, _GL_CXXALIAS_SYS (mkostemps, int,
(char * /*template*/, int /*suffixlen*/, int /*flags*/)); (char * /*template*/, int /*suffixlen*/, int /*flags*/));
@ -914,11 +928,13 @@ _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mkstemp rpl_mkstemp # define mkstemp rpl_mkstemp
# endif # endif
_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/),
_GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/)); _GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
# else # else
# if ! @HAVE_MKSTEMP@ # if ! @HAVE_MKSTEMP@
_GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/),
_GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/)); _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
# endif # endif
@ -943,8 +959,8 @@ _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
Returns the open file descriptor if successful, otherwise -1 and errno Returns the open file descriptor if successful, otherwise -1 and errno
set. */ set. */
# if !@HAVE_MKSTEMPS@ # if !@HAVE_MKSTEMPS@
_GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/) _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)); _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
_GL_CXXALIASWARN (mkstemps); _GL_CXXALIASWARN (mkstemps);
@ -980,8 +996,8 @@ _GL_CXXALIASWARN (mktemp);
# define posix_memalign rpl_posix_memalign # define posix_memalign rpl_posix_memalign
# endif # endif
_GL_FUNCDECL_RPL (posix_memalign, int, _GL_FUNCDECL_RPL (posix_memalign, int,
(void **memptr, size_t alignment, size_t size) (void **memptr, size_t alignment, size_t size),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (posix_memalign, int, _GL_CXXALIAS_RPL (posix_memalign, int,
(void **memptr, size_t alignment, size_t size)); (void **memptr, size_t alignment, size_t size));
# else # else
@ -1009,11 +1025,11 @@ _GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - "
# undef posix_openpt # undef posix_openpt
# define posix_openpt rpl_posix_openpt # define posix_openpt rpl_posix_openpt
# endif # endif
_GL_FUNCDECL_RPL (posix_openpt, int, (int flags)); _GL_FUNCDECL_RPL (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (posix_openpt, int, (int flags)); _GL_CXXALIAS_RPL (posix_openpt, int, (int flags));
# else # else
# if !@HAVE_POSIX_OPENPT@ # if !@HAVE_POSIX_OPENPT@
_GL_FUNCDECL_SYS (posix_openpt, int, (int flags)); _GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (posix_openpt, int, (int flags)); _GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
# endif # endif
@ -1036,11 +1052,11 @@ _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
# undef ptsname # undef ptsname
# define ptsname rpl_ptsname # define ptsname rpl_ptsname
# endif # endif
_GL_FUNCDECL_RPL (ptsname, char *, (int fd)); _GL_FUNCDECL_RPL (ptsname, char *, (int fd), _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (ptsname, char *, (int fd)); _GL_CXXALIAS_RPL (ptsname, char *, (int fd));
# else # else
# if !@HAVE_PTSNAME@ # if !@HAVE_PTSNAME@
_GL_FUNCDECL_SYS (ptsname, char *, (int fd)); _GL_FUNCDECL_SYS (ptsname, char *, (int fd), _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (ptsname, char *, (int fd)); _GL_CXXALIAS_SYS (ptsname, char *, (int fd));
# endif # endif
@ -1088,7 +1104,7 @@ _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
# undef putenv # undef putenv
# define putenv rpl_putenv # define putenv rpl_putenv
# endif # endif
_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (putenv, int, (char *string), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (putenv, int, (char *string)); _GL_CXXALIAS_RPL (putenv, int, (char *string));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -1147,7 +1163,8 @@ typedef int (*_gl_qsort_r_compar_fn) (void const *, void const *, void *);
# endif # endif
_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, _GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare, _gl_qsort_r_compar_fn compare,
void *arg) _GL_ARG_NONNULL ((1, 4))); void *arg),
_GL_ARG_NONNULL ((1, 4)));
_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare, _gl_qsort_r_compar_fn compare,
void *arg)); void *arg));
@ -1155,7 +1172,8 @@ _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
# if !@HAVE_QSORT_R@ # if !@HAVE_QSORT_R@
_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, _GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare, _gl_qsort_r_compar_fn compare,
void *arg) _GL_ARG_NONNULL ((1, 4))); void *arg),
_GL_ARG_NONNULL ((1, 4)));
# endif # endif
_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare, _gl_qsort_r_compar_fn compare,
@ -1258,14 +1276,14 @@ _GL_WARN_ON_USE (srandom, "srandom is unportable - "
# define initstate rpl_initstate # define initstate rpl_initstate
# endif # endif
_GL_FUNCDECL_RPL (initstate, char *, _GL_FUNCDECL_RPL (initstate, char *,
(unsigned int seed, char *buf, size_t buf_size) (unsigned int seed, char *buf, size_t buf_size),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (initstate, char *, _GL_CXXALIAS_RPL (initstate, char *,
(unsigned int seed, char *buf, size_t buf_size)); (unsigned int seed, char *buf, size_t buf_size));
# else # else
# if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@ # if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@
_GL_FUNCDECL_SYS (initstate, char *, _GL_FUNCDECL_SYS (initstate, char *,
(unsigned int seed, char *buf, size_t buf_size) (unsigned int seed, char *buf, size_t buf_size),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
# endif # endif
/* Need to cast, because on FreeBSD, the first parameter is /* Need to cast, because on FreeBSD, the first parameter is
@ -1290,11 +1308,11 @@ _GL_WARN_ON_USE (initstate, "initstate is unportable - "
# undef setstate # undef setstate
# define setstate rpl_setstate # define setstate rpl_setstate
# endif # endif
_GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (setstate, char *, (char *arg_state), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (setstate, char *, (char *arg_state)); _GL_CXXALIAS_RPL (setstate, char *, (char *arg_state));
# else # else
# if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@ # if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@
_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (setstate, char *, (char *arg_state), _GL_ARG_NONNULL ((1)));
# endif # endif
/* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter /* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter
is const char *arg_state. */ is const char *arg_state. */
@ -1318,12 +1336,12 @@ _GL_WARN_ON_USE (setstate, "setstate is unportable - "
# undef random_r # undef random_r
# define random_r rpl_random_r # define random_r rpl_random_r
# endif # endif
_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result) _GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result)); _GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
# else # else
# if !@HAVE_RANDOM_R@ # if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result) _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result)); _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
@ -1344,14 +1362,14 @@ _GL_WARN_ON_USE (random_r, "random_r is unportable - "
# define srandom_r rpl_srandom_r # define srandom_r rpl_srandom_r
# endif # endif
_GL_FUNCDECL_RPL (srandom_r, int, _GL_FUNCDECL_RPL (srandom_r, int,
(unsigned int seed, struct random_data *rand_state) (unsigned int seed, struct random_data *rand_state),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (srandom_r, int, _GL_CXXALIAS_RPL (srandom_r, int,
(unsigned int seed, struct random_data *rand_state)); (unsigned int seed, struct random_data *rand_state));
# else # else
# if !@HAVE_RANDOM_R@ # if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (srandom_r, int, _GL_FUNCDECL_SYS (srandom_r, int,
(unsigned int seed, struct random_data *rand_state) (unsigned int seed, struct random_data *rand_state),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
# endif # endif
_GL_CXXALIAS_SYS (srandom_r, int, _GL_CXXALIAS_SYS (srandom_r, int,
@ -1374,7 +1392,7 @@ _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
# endif # endif
_GL_FUNCDECL_RPL (initstate_r, int, _GL_FUNCDECL_RPL (initstate_r, int,
(unsigned int seed, char *buf, size_t buf_size, (unsigned int seed, char *buf, size_t buf_size,
struct random_data *rand_state) struct random_data *rand_state),
_GL_ARG_NONNULL ((2, 4))); _GL_ARG_NONNULL ((2, 4)));
_GL_CXXALIAS_RPL (initstate_r, int, _GL_CXXALIAS_RPL (initstate_r, int,
(unsigned int seed, char *buf, size_t buf_size, (unsigned int seed, char *buf, size_t buf_size,
@ -1383,7 +1401,7 @@ _GL_CXXALIAS_RPL (initstate_r, int,
# if !@HAVE_RANDOM_R@ # if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (initstate_r, int, _GL_FUNCDECL_SYS (initstate_r, int,
(unsigned int seed, char *buf, size_t buf_size, (unsigned int seed, char *buf, size_t buf_size,
struct random_data *rand_state) struct random_data *rand_state),
_GL_ARG_NONNULL ((2, 4))); _GL_ARG_NONNULL ((2, 4)));
# endif # endif
/* Need to cast, because on Haiku, the third parameter is /* Need to cast, because on Haiku, the third parameter is
@ -1408,14 +1426,14 @@ _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
# define setstate_r rpl_setstate_r # define setstate_r rpl_setstate_r
# endif # endif
_GL_FUNCDECL_RPL (setstate_r, int, _GL_FUNCDECL_RPL (setstate_r, int,
(char *arg_state, struct random_data *rand_state) (char *arg_state, struct random_data *rand_state),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (setstate_r, int, _GL_CXXALIAS_RPL (setstate_r, int,
(char *arg_state, struct random_data *rand_state)); (char *arg_state, struct random_data *rand_state));
# else # else
# if !@HAVE_RANDOM_R@ # if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (setstate_r, int, _GL_FUNCDECL_SYS (setstate_r, int,
(char *arg_state, struct random_data *rand_state) (char *arg_state, struct random_data *rand_state),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
/* Need to cast, because on Haiku, the first parameter is /* Need to cast, because on Haiku, the first parameter is
@ -1441,21 +1459,22 @@ _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
# undef realloc # undef realloc
# define realloc rpl_realloc # define realloc rpl_realloc
# endif # endif
_GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size) _GL_FUNCDECL_RPL (realloc, void *,
_GL_ATTRIBUTE_DEALLOC_FREE); (void *ptr, size_t size),
_GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size)); _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
# else # else
# if __GNUC__ >= 11 # if __GNUC__ >= 11 && !defined __clang__
/* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */ /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (realloc, void *, _GL_FUNCDECL_SYS (realloc, void *,
(void *ptr, size_t size) (void *ptr, size_t size),
_GL_ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD)
_GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (realloc, void *, _GL_FUNCDECL_SYS (realloc, void *,
(void *ptr, size_t size) (void *ptr, size_t size),
_GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD);
# endif # endif
# endif # endif
_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size)); _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
@ -1464,16 +1483,17 @@ _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
_GL_CXXALIASWARN (realloc); _GL_CXXALIASWARN (realloc);
# endif # endif
#else #else
# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined realloc # if @GNULIB_FREE_POSIX@ \
&& (__GNUC__ >= 11 && !defined __clang__) && !defined realloc
/* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */ /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
_GL_FUNCDECL_SYS (realloc, void *, _GL_FUNCDECL_SYS (realloc, void *,
(void *ptr, size_t size) (void *ptr, size_t size),
_GL_ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_DEALLOC_FREE)
_GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (realloc, void *, _GL_FUNCDECL_SYS (realloc, void *,
(void *ptr, size_t size) (void *ptr, size_t size),
_GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_DEALLOC_FREE);
# endif # endif
# endif # endif
@ -1493,13 +1513,15 @@ _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
# define reallocarray rpl_reallocarray # define reallocarray rpl_reallocarray
# endif # endif
_GL_FUNCDECL_RPL (reallocarray, void *, _GL_FUNCDECL_RPL (reallocarray, void *,
(void *ptr, size_t nmemb, size_t size)); (void *ptr, size_t nmemb, size_t size),
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (reallocarray, void *, _GL_CXXALIAS_RPL (reallocarray, void *,
(void *ptr, size_t nmemb, size_t size)); (void *ptr, size_t nmemb, size_t size));
# else # else
# if ! @HAVE_REALLOCARRAY@ # if ! @HAVE_REALLOCARRAY@
_GL_FUNCDECL_SYS (reallocarray, void *, _GL_FUNCDECL_SYS (reallocarray, void *,
(void *ptr, size_t nmemb, size_t size)); (void *ptr, size_t nmemb, size_t size),
_GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (reallocarray, void *, _GL_CXXALIAS_SYS (reallocarray, void *,
(void *ptr, size_t nmemb, size_t size)); (void *ptr, size_t nmemb, size_t size));
@ -1521,15 +1543,15 @@ _GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - "
# define realpath rpl_realpath # define realpath rpl_realpath
# endif # endif
_GL_FUNCDECL_RPL (realpath, char *, _GL_FUNCDECL_RPL (realpath, char *,
(const char *restrict name, char *restrict resolved) (const char *restrict name, char *restrict resolved),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (realpath, char *, _GL_CXXALIAS_RPL (realpath, char *,
(const char *restrict name, char *restrict resolved)); (const char *restrict name, char *restrict resolved));
# else # else
# if !@HAVE_REALPATH@ # if !@HAVE_REALPATH@
_GL_FUNCDECL_SYS (realpath, char *, _GL_FUNCDECL_SYS (realpath, char *,
(const char *restrict name, char *restrict resolved) (const char *restrict name, char *restrict resolved),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (realpath, char *, _GL_CXXALIAS_SYS (realpath, char *,
(const char *restrict name, char *restrict resolved)); (const char *restrict name, char *restrict resolved));
@ -1547,7 +1569,8 @@ _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
/* Test a user response to a question. /* Test a user response to a question.
Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */ Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
# if !@HAVE_RPMATCH@ # if !@HAVE_RPMATCH@
_GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (rpmatch, int, (const char *response),
_GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (rpmatch, int, (const char *response)); _GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
_GL_CXXALIASWARN (rpmatch); _GL_CXXALIASWARN (rpmatch);
@ -1563,7 +1586,8 @@ _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
/* Look up NAME in the environment, returning 0 in insecure situations. */ /* Look up NAME in the environment, returning 0 in insecure situations. */
# if !@HAVE_SECURE_GETENV@ # if !@HAVE_SECURE_GETENV@
_GL_FUNCDECL_SYS (secure_getenv, char *, _GL_FUNCDECL_SYS (secure_getenv, char *,
(char const *name) _GL_ARG_NONNULL ((1))); (char const *name),
_GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name)); _GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
_GL_CXXALIASWARN (secure_getenv); _GL_CXXALIASWARN (secure_getenv);
@ -1584,14 +1608,14 @@ _GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
# define setenv rpl_setenv # define setenv rpl_setenv
# endif # endif
_GL_FUNCDECL_RPL (setenv, int, _GL_FUNCDECL_RPL (setenv, int,
(const char *name, const char *value, int replace) (const char *name, const char *value, int replace),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (setenv, int, _GL_CXXALIAS_RPL (setenv, int,
(const char *name, const char *value, int replace)); (const char *name, const char *value, int replace));
# else # else
# if !@HAVE_DECL_SETENV@ # if !@HAVE_DECL_SETENV@
_GL_FUNCDECL_SYS (setenv, int, _GL_FUNCDECL_SYS (setenv, int,
(const char *name, const char *value, int replace) (const char *name, const char *value, int replace),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (setenv, int, _GL_CXXALIAS_SYS (setenv, int,
@ -1608,6 +1632,19 @@ _GL_WARN_ON_USE (setenv, "setenv is unportable - "
# endif # endif
#endif #endif
#if @GNULIB_STACK_TRACE@
/* Prints a stack trace of the current thread to standard error,
if possible. */
# if @CAN_PRINT_STACK_TRACE@
_GL_EXTERN_C void print_stack_trace (void);
# else
# if !GNULIB_defined_print_stack_trace
# define print_stack_trace() /* nothing */
# define GNULIB_defined_print_stack_trace 1
# endif
# endif
#endif
#if @GNULIB_STRTOD@ #if @GNULIB_STRTOD@
/* Parse a double from STRING, updating ENDP if appropriate. */ /* Parse a double from STRING, updating ENDP if appropriate. */
# if @REPLACE_STRTOD@ # if @REPLACE_STRTOD@
@ -1616,14 +1653,14 @@ _GL_WARN_ON_USE (setenv, "setenv is unportable - "
# endif # endif
# define GNULIB_defined_strtod_function 1 # define GNULIB_defined_strtod_function 1
_GL_FUNCDECL_RPL (strtod, double, _GL_FUNCDECL_RPL (strtod, double,
(const char *restrict str, char **restrict endp) (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtod, double, _GL_CXXALIAS_RPL (strtod, double,
(const char *restrict str, char **restrict endp)); (const char *restrict str, char **restrict endp));
# else # else
# if !@HAVE_STRTOD@ # if !@HAVE_STRTOD@
_GL_FUNCDECL_SYS (strtod, double, _GL_FUNCDECL_SYS (strtod, double,
(const char *restrict str, char **restrict endp) (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (strtod, double, _GL_CXXALIAS_SYS (strtod, double,
@ -1648,14 +1685,14 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - "
# endif # endif
# define GNULIB_defined_strtof_function 1 # define GNULIB_defined_strtof_function 1
_GL_FUNCDECL_RPL (strtof, float, _GL_FUNCDECL_RPL (strtof, float,
(const char *restrict str, char **restrict endp) (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtof, float, _GL_CXXALIAS_RPL (strtof, float,
(const char *restrict str, char **restrict endp)); (const char *restrict str, char **restrict endp));
# else # else
# if !@HAVE_STRTOF@ # if !@HAVE_STRTOF@
_GL_FUNCDECL_SYS (strtof, float, _GL_FUNCDECL_SYS (strtof, float,
(const char *restrict str, char **restrict endp) (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (strtof, float, _GL_CXXALIAS_SYS (strtof, float,
@ -1680,14 +1717,14 @@ _GL_WARN_ON_USE (strtof, "strtof is unportable - "
# endif # endif
# define GNULIB_defined_strtold_function 1 # define GNULIB_defined_strtold_function 1
_GL_FUNCDECL_RPL (strtold, long double, _GL_FUNCDECL_RPL (strtold, long double,
(const char *restrict str, char **restrict endp) (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtold, long double, _GL_CXXALIAS_RPL (strtold, long double,
(const char *restrict str, char **restrict endp)); (const char *restrict str, char **restrict endp));
# else # else
# if !@HAVE_STRTOLD@ # if !@HAVE_STRTOLD@
_GL_FUNCDECL_SYS (strtold, long double, _GL_FUNCDECL_SYS (strtold, long double,
(const char *restrict str, char **restrict endp) (const char *restrict str, char **restrict endp),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (strtold, long double, _GL_CXXALIAS_SYS (strtold, long double,
@ -1718,7 +1755,7 @@ _GL_WARN_ON_USE (strtold, "strtold is unportable - "
# define GNULIB_defined_strtol_function 1 # define GNULIB_defined_strtol_function 1
_GL_FUNCDECL_RPL (strtol, long, _GL_FUNCDECL_RPL (strtol, long,
(const char *restrict string, char **restrict endptr, (const char *restrict string, char **restrict endptr,
int base) int base),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtol, long, _GL_CXXALIAS_RPL (strtol, long,
(const char *restrict string, char **restrict endptr, (const char *restrict string, char **restrict endptr,
@ -1727,7 +1764,7 @@ _GL_CXXALIAS_RPL (strtol, long,
# if !@HAVE_STRTOL@ # if !@HAVE_STRTOL@
_GL_FUNCDECL_SYS (strtol, long, _GL_FUNCDECL_SYS (strtol, long,
(const char *restrict string, char **restrict endptr, (const char *restrict string, char **restrict endptr,
int base) int base),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (strtol, long, _GL_CXXALIAS_SYS (strtol, long,
@ -1761,7 +1798,7 @@ _GL_WARN_ON_USE (strtol, "strtol is unportable - "
# define GNULIB_defined_strtoll_function 1 # define GNULIB_defined_strtoll_function 1
_GL_FUNCDECL_RPL (strtoll, long long, _GL_FUNCDECL_RPL (strtoll, long long,
(const char *restrict string, char **restrict endptr, (const char *restrict string, char **restrict endptr,
int base) int base),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoll, long long, _GL_CXXALIAS_RPL (strtoll, long long,
(const char *restrict string, char **restrict endptr, (const char *restrict string, char **restrict endptr,
@ -1770,7 +1807,7 @@ _GL_CXXALIAS_RPL (strtoll, long long,
# if !@HAVE_STRTOLL@ # if !@HAVE_STRTOLL@
_GL_FUNCDECL_SYS (strtoll, long long, _GL_FUNCDECL_SYS (strtoll, long long,
(const char *restrict string, char **restrict endptr, (const char *restrict string, char **restrict endptr,
int base) int base),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (strtoll, long long, _GL_CXXALIAS_SYS (strtoll, long long,
@ -1801,7 +1838,7 @@ _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
# define GNULIB_defined_strtoul_function 1 # define GNULIB_defined_strtoul_function 1
_GL_FUNCDECL_RPL (strtoul, unsigned long, _GL_FUNCDECL_RPL (strtoul, unsigned long,
(const char *restrict string, char **restrict endptr, (const char *restrict string, char **restrict endptr,
int base) int base),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoul, unsigned long, _GL_CXXALIAS_RPL (strtoul, unsigned long,
(const char *restrict string, char **restrict endptr, (const char *restrict string, char **restrict endptr,
@ -1810,7 +1847,7 @@ _GL_CXXALIAS_RPL (strtoul, unsigned long,
# if !@HAVE_STRTOUL@ # if !@HAVE_STRTOUL@
_GL_FUNCDECL_SYS (strtoul, unsigned long, _GL_FUNCDECL_SYS (strtoul, unsigned long,
(const char *restrict string, char **restrict endptr, (const char *restrict string, char **restrict endptr,
int base) int base),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (strtoul, unsigned long, _GL_CXXALIAS_SYS (strtoul, unsigned long,
@ -1844,7 +1881,7 @@ _GL_WARN_ON_USE (strtoul, "strtoul is unportable - "
# define GNULIB_defined_strtoull_function 1 # define GNULIB_defined_strtoull_function 1
_GL_FUNCDECL_RPL (strtoull, unsigned long long, _GL_FUNCDECL_RPL (strtoull, unsigned long long,
(const char *restrict string, char **restrict endptr, (const char *restrict string, char **restrict endptr,
int base) int base),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoull, unsigned long long, _GL_CXXALIAS_RPL (strtoull, unsigned long long,
(const char *restrict string, char **restrict endptr, (const char *restrict string, char **restrict endptr,
@ -1853,7 +1890,7 @@ _GL_CXXALIAS_RPL (strtoull, unsigned long long,
# if !@HAVE_STRTOULL@ # if !@HAVE_STRTOULL@
_GL_FUNCDECL_SYS (strtoull, unsigned long long, _GL_FUNCDECL_SYS (strtoull, unsigned long long,
(const char *restrict string, char **restrict endptr, (const char *restrict string, char **restrict endptr,
int base) int base),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (strtoull, unsigned long long, _GL_CXXALIAS_SYS (strtoull, unsigned long long,
@ -1892,11 +1929,11 @@ _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
# undef unsetenv # undef unsetenv
# define unsetenv rpl_unsetenv # define unsetenv rpl_unsetenv
# endif # endif
_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (unsetenv, int, (const char *name), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (unsetenv, int, (const char *name)); _GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
# else # else
# if !@HAVE_DECL_UNSETENV@ # if !@HAVE_DECL_UNSETENV@
_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (unsetenv, int, (const char *name), _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (unsetenv, int, (const char *name)); _GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
# endif # endif

View file

@ -321,7 +321,7 @@ enum pad_style
maximum object size 9223372036854775807", caused by insufficient data flow maximum object size 9223372036854775807", caused by insufficient data flow
analysis and value propagation of the 'width_add' expansion when GCC is not analysis and value propagation of the 'width_add' expansion when GCC is not
optimizing. Cf. <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443>. */ optimizing. Cf. <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443>. */
#if __GNUC__ >= 7 && !__OPTIMIZE__ #if _GL_GNUC_PREREQ (7, 0) && !__OPTIMIZE__
# pragma GCC diagnostic ignored "-Wstringop-overflow" # pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif #endif

View file

@ -21,11 +21,11 @@
extern "C" { extern "C" {
#endif #endif
/* Formats the broken-down time *__TP, with additional __NS nanoseconds, /* Format the broken-down time *__TP, with additional __NS nanoseconds,
into the buffer __S of size __MAXSIZE, according to the rules of the into the buffer __S of size __MAXSIZE, according to the rules of the
LC_TIME category of the current locale. LC_TIME category of the current locale.
Uses the time zone __TZ. Use the time zone __TZ.
If *__TP represents local time, __TZ should be set to If *__TP represents local time, __TZ should be set to
tzalloc (getenv ("TZ")). tzalloc (getenv ("TZ")).
If *__TP represents universal time (a.k.a. GMT), __TZ should be set to If *__TP represents universal time (a.k.a. GMT), __TZ should be set to
@ -60,15 +60,11 @@ extern "C" {
time zone: %z %Z time zone: %z %Z
nanosecond %N nanosecond %N
Stores the result, as a string with a trailing NUL character, at the Store the result, as a string with a trailing NUL character, at the
beginning of the array __S[0..__MAXSIZE-1], if it fits, and returns beginning of the array __S[0..__MAXSIZE-1] and return the length of
the length of that string, not counting the trailing NUL. In this case, that string, not counting the trailing NUL, and without changing errno.
errno is preserved if the return value is 0. If unsuccessful, possibly change the array __S, set errno, and return 0;
If it does not fit, this function sets errno to ERANGE and returns 0. errno == ERANGE means the string didn't fit.
Upon other errors, this function sets errno and returns 0 as well.
Note: The errno behavior is in draft POSIX 202x plus some requested
changes to POSIX.
This function is like strftime, but with two more arguments: This function is like strftime, but with two more arguments:
* __TZ instead of the local timezone information, * __TZ instead of the local timezone information,

View file

@ -79,7 +79,7 @@
that can be freed by passing them as the Ith argument to the that can be freed by passing them as the Ith argument to the
function F. */ function F. */
#ifndef _GL_ATTRIBUTE_DEALLOC #ifndef _GL_ATTRIBUTE_DEALLOC
# if __GNUC__ >= 11 # if __GNUC__ >= 11 && !defined __clang__
# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
# else # else
# define _GL_ATTRIBUTE_DEALLOC(f, i) # define _GL_ATTRIBUTE_DEALLOC(f, i)
@ -115,7 +115,7 @@
*/ */
#ifndef _GL_ATTRIBUTE_NOTHROW #ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus # if defined __cplusplus
# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4 # if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L # if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true) # define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else # else
@ -198,7 +198,7 @@ _GL_EXTERN_C void free (void *);
#if @GNULIB_EXPLICIT_BZERO@ #if @GNULIB_EXPLICIT_BZERO@
# if ! @HAVE_EXPLICIT_BZERO@ # if ! @HAVE_EXPLICIT_BZERO@
_GL_FUNCDECL_SYS (explicit_bzero, void, _GL_FUNCDECL_SYS (explicit_bzero, void,
(void *__dest, size_t __n) _GL_ARG_NONNULL ((1))); (void *__dest, size_t __n), _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (explicit_bzero, void, (void *__dest, size_t __n)); _GL_CXXALIAS_SYS (explicit_bzero, void, (void *__dest, size_t __n));
_GL_CXXALIASWARN (explicit_bzero); _GL_CXXALIASWARN (explicit_bzero);
@ -274,7 +274,7 @@ _GL_CXXALIASWARN (memccpy);
# undef memchr # undef memchr
# define memchr rpl_memchr # define memchr rpl_memchr
# endif # endif
_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n) _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n)); _GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
@ -313,7 +313,7 @@ _GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - "
# endif # endif
_GL_FUNCDECL_RPL (memmem, void *, _GL_FUNCDECL_RPL (memmem, void *,
(void const *__haystack, size_t __haystack_len, (void const *__haystack, size_t __haystack_len,
void const *__needle, size_t __needle_len) void const *__needle, size_t __needle_len),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 3))); _GL_ARG_NONNULL ((1, 3)));
_GL_CXXALIAS_RPL (memmem, void *, _GL_CXXALIAS_RPL (memmem, void *,
@ -323,7 +323,7 @@ _GL_CXXALIAS_RPL (memmem, void *,
# if ! @HAVE_DECL_MEMMEM@ # if ! @HAVE_DECL_MEMMEM@
_GL_FUNCDECL_SYS (memmem, void *, _GL_FUNCDECL_SYS (memmem, void *,
(void const *__haystack, size_t __haystack_len, (void const *__haystack, size_t __haystack_len,
void const *__needle, size_t __needle_len) void const *__needle, size_t __needle_len),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 3))); _GL_ARG_NONNULL ((1, 3)));
# endif # endif
@ -351,7 +351,7 @@ _GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - "
# endif # endif
_GL_FUNCDECL_RPL (mempcpy, void *, _GL_FUNCDECL_RPL (mempcpy, void *,
(void *restrict __dest, void const *restrict __src, (void *restrict __dest, void const *restrict __src,
size_t __n) size_t __n),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (mempcpy, void *, _GL_CXXALIAS_RPL (mempcpy, void *,
(void *restrict __dest, void const *restrict __src, (void *restrict __dest, void const *restrict __src,
@ -360,7 +360,7 @@ _GL_CXXALIAS_RPL (mempcpy, void *,
# if !@HAVE_MEMPCPY@ # if !@HAVE_MEMPCPY@
_GL_FUNCDECL_SYS (mempcpy, void *, _GL_FUNCDECL_SYS (mempcpy, void *,
(void *restrict __dest, void const *restrict __src, (void *restrict __dest, void const *restrict __src,
size_t __n) size_t __n),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
_GL_CXXALIAS_SYS (mempcpy, void *, _GL_CXXALIAS_SYS (mempcpy, void *,
@ -381,7 +381,7 @@ _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
/* Search backwards through a block for a byte (specified as an int). */ /* Search backwards through a block for a byte (specified as an int). */
#if @GNULIB_MEMRCHR@ #if @GNULIB_MEMRCHR@
# if ! @HAVE_DECL_MEMRCHR@ # if ! @HAVE_DECL_MEMRCHR@
_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t) _GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
@ -420,12 +420,12 @@ _GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
# define memset_explicit rpl_memset_explicit # define memset_explicit rpl_memset_explicit
# endif # endif
_GL_FUNCDECL_RPL (memset_explicit, void *, _GL_FUNCDECL_RPL (memset_explicit, void *,
(void *__dest, int __c, size_t __n) _GL_ARG_NONNULL ((1))); (void *__dest, int __c, size_t __n), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (memset_explicit, void *, (void *__dest, int __c, size_t __n)); _GL_CXXALIAS_RPL (memset_explicit, void *, (void *__dest, int __c, size_t __n));
# else # else
# if !@HAVE_MEMSET_EXPLICIT@ # if !@HAVE_MEMSET_EXPLICIT@
_GL_FUNCDECL_SYS (memset_explicit, void *, _GL_FUNCDECL_SYS (memset_explicit, void *,
(void *__dest, int __c, size_t __n) _GL_ARG_NONNULL ((1))); (void *__dest, int __c, size_t __n), _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t __n)); _GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t __n));
# endif # endif
@ -443,7 +443,7 @@ _GL_WARN_ON_USE (memset_explicit, "memset_explicit is unportable - "
occur within N bytes. */ occur within N bytes. */
#if @GNULIB_RAWMEMCHR@ #if @GNULIB_RAWMEMCHR@
# if ! @HAVE_RAWMEMCHR@ # if ! @HAVE_RAWMEMCHR@
_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in) _GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
@ -481,14 +481,14 @@ _GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
# define stpcpy rpl_stpcpy # define stpcpy rpl_stpcpy
# endif # endif
_GL_FUNCDECL_RPL (stpcpy, char *, _GL_FUNCDECL_RPL (stpcpy, char *,
(char *restrict __dst, char const *restrict __src) (char *restrict __dst, char const *restrict __src),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (stpcpy, char *, _GL_CXXALIAS_RPL (stpcpy, char *,
(char *restrict __dst, char const *restrict __src)); (char *restrict __dst, char const *restrict __src));
# else # else
# if !@HAVE_STPCPY@ # if !@HAVE_STPCPY@
_GL_FUNCDECL_SYS (stpcpy, char *, _GL_FUNCDECL_SYS (stpcpy, char *,
(char *restrict __dst, char const *restrict __src) (char *restrict __dst, char const *restrict __src),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
_GL_CXXALIAS_SYS (stpcpy, char *, _GL_CXXALIAS_SYS (stpcpy, char *,
@ -515,7 +515,7 @@ _GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
# endif # endif
_GL_FUNCDECL_RPL (stpncpy, char *, _GL_FUNCDECL_RPL (stpncpy, char *,
(char *restrict __dst, char const *restrict __src, (char *restrict __dst, char const *restrict __src,
size_t __n) size_t __n),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (stpncpy, char *, _GL_CXXALIAS_RPL (stpncpy, char *,
(char *restrict __dst, char const *restrict __src, (char *restrict __dst, char const *restrict __src,
@ -524,7 +524,7 @@ _GL_CXXALIAS_RPL (stpncpy, char *,
# if ! @HAVE_STPNCPY@ # if ! @HAVE_STPNCPY@
_GL_FUNCDECL_SYS (stpncpy, char *, _GL_FUNCDECL_SYS (stpncpy, char *,
(char *restrict __dst, char const *restrict __src, (char *restrict __dst, char const *restrict __src,
size_t __n) size_t __n),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
_GL_CXXALIAS_SYS (stpncpy, char *, _GL_CXXALIAS_SYS (stpncpy, char *,
@ -560,14 +560,14 @@ _GL_WARN_ON_USE_CXX (strchr,
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define strchrnul rpl_strchrnul # define strchrnul rpl_strchrnul
# endif # endif
_GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in) _GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strchrnul, char *, _GL_CXXALIAS_RPL (strchrnul, char *,
(const char *str, int ch)); (const char *str, int ch));
# else # else
# if ! @HAVE_STRCHRNUL@ # if ! @HAVE_STRCHRNUL@
_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in) _GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
@ -606,7 +606,7 @@ _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
# define strdup rpl_strdup # define strdup rpl_strdup
# endif # endif
_GL_FUNCDECL_RPL (strdup, char *, _GL_FUNCDECL_RPL (strdup, char *,
(char const *__s) (char const *__s),
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
_GL_CXXALIAS_RPL (strdup, char *, (char const *__s)); _GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
@ -621,16 +621,17 @@ _GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
/* strdup exists as a function and as a macro. Get rid of the macro. */ /* strdup exists as a function and as a macro. Get rid of the macro. */
# undef strdup # undef strdup
# endif # endif
# if (!@HAVE_DECL_STRDUP@ || __GNUC__ >= 11) && !defined strdup # if (!@HAVE_DECL_STRDUP@ || (__GNUC__ >= 11 && !defined __clang__)) \
&& !defined strdup
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (strdup, char *, _GL_FUNCDECL_SYS (strdup, char *,
(char const *__s) (char const *__s),
_GL_ATTRIBUTE_NOTHROW
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
_GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (strdup, char *, _GL_FUNCDECL_SYS (strdup, char *,
(char const *__s) (char const *__s),
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif # endif
@ -639,17 +640,17 @@ _GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
# endif # endif
_GL_CXXALIASWARN (strdup); _GL_CXXALIASWARN (strdup);
#else #else
# if __GNUC__ >= 11 && !defined strdup # if (__GNUC__ >= 11 && !defined __clang__) && !defined strdup
/* For -Wmismatched-dealloc: Associate strdup with free or rpl_free. */ /* For -Wmismatched-dealloc: Associate strdup with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (strdup, char *, _GL_FUNCDECL_SYS (strdup, char *,
(char const *__s) (char const *__s),
_GL_ATTRIBUTE_NOTHROW
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
_GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (strdup, char *, _GL_FUNCDECL_SYS (strdup, char *,
(char const *__s) (char const *__s),
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif # endif
@ -688,7 +689,7 @@ _GL_CXXALIASWARN (strdup);
# define strncat rpl_strncat # define strncat rpl_strncat
# endif # endif
_GL_FUNCDECL_RPL (strncat, char *, _GL_FUNCDECL_RPL (strncat, char *,
(char *restrict dest, const char *restrict src, size_t n) (char *restrict dest, const char *restrict src, size_t n),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strncat, char *, _GL_CXXALIAS_RPL (strncat, char *,
(char *restrict dest, const char *restrict src, size_t n)); (char *restrict dest, const char *restrict src, size_t n));
@ -715,21 +716,22 @@ _GL_WARN_ON_USE (strncat, "strncat is unportable - "
# define strndup rpl_strndup # define strndup rpl_strndup
# endif # endif
_GL_FUNCDECL_RPL (strndup, char *, _GL_FUNCDECL_RPL (strndup, char *,
(char const *__s, size_t __n) (char const *__s, size_t __n),
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); _GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n));
# else # else
# if !@HAVE_DECL_STRNDUP@ || (__GNUC__ >= 11 && !defined strndup) # if !@HAVE_DECL_STRNDUP@ \
|| ((__GNUC__ >= 11 && !defined __clang__) && !defined strndup)
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (strndup, char *, _GL_FUNCDECL_SYS (strndup, char *,
(char const *__s, size_t __n) (char const *__s, size_t __n),
_GL_ATTRIBUTE_NOTHROW
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
_GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (strndup, char *, _GL_FUNCDECL_SYS (strndup, char *,
(char const *__s, size_t __n) (char const *__s, size_t __n),
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif # endif
@ -738,17 +740,17 @@ _GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n));
# endif # endif
_GL_CXXALIASWARN (strndup); _GL_CXXALIASWARN (strndup);
#else #else
# if __GNUC__ >= 11 && !defined strndup # if (__GNUC__ >= 11 && !defined __clang__) && !defined strndup
/* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */ /* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (strndup, char *, _GL_FUNCDECL_SYS (strndup, char *,
(char const *__s, size_t __n) (char const *__s, size_t __n),
_GL_ATTRIBUTE_NOTHROW
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
_GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (strndup, char *, _GL_FUNCDECL_SYS (strndup, char *,
(char const *__s, size_t __n) (char const *__s, size_t __n),
_GL_ARG_NONNULL ((1)) _GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif # endif
@ -771,13 +773,13 @@ _GL_WARN_ON_USE (strndup, "strndup is unportable - "
# undef strnlen # undef strnlen
# define strnlen rpl_strnlen # define strnlen rpl_strnlen
# endif # endif
_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen) _GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__s, size_t __maxlen)); _GL_CXXALIAS_RPL (strnlen, size_t, (char const *__s, size_t __maxlen));
# else # else
# if ! @HAVE_DECL_STRNLEN@ # if ! @HAVE_DECL_STRNLEN@
_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen) _GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
@ -807,7 +809,7 @@ _GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings "
/* Find the first occurrence in S of any character in ACCEPT. */ /* Find the first occurrence in S of any character in ACCEPT. */
#if @GNULIB_STRPBRK@ #if @GNULIB_STRPBRK@
# if ! @HAVE_STRPBRK@ # if ! @HAVE_STRPBRK@
_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept) _GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
@ -892,7 +894,7 @@ _GL_WARN_ON_USE_CXX (strrchr,
#if @GNULIB_STRSEP@ #if @GNULIB_STRSEP@
# if ! @HAVE_STRSEP@ # if ! @HAVE_STRSEP@
_GL_FUNCDECL_SYS (strsep, char *, _GL_FUNCDECL_SYS (strsep, char *,
(char **restrict __stringp, char const *restrict __delim) (char **restrict __stringp, char const *restrict __delim),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
_GL_CXXALIAS_SYS (strsep, char *, _GL_CXXALIAS_SYS (strsep, char *,
@ -917,7 +919,7 @@ _GL_WARN_ON_USE (strsep, "strsep is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define strstr rpl_strstr # define strstr rpl_strstr
# endif # endif
_GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle) _GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle)); _GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle));
@ -963,7 +965,7 @@ _GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot "
# define strcasestr rpl_strcasestr # define strcasestr rpl_strcasestr
# endif # endif
_GL_FUNCDECL_RPL (strcasestr, char *, _GL_FUNCDECL_RPL (strcasestr, char *,
(const char *haystack, const char *needle) (const char *haystack, const char *needle),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strcasestr, char *, _GL_CXXALIAS_RPL (strcasestr, char *,
@ -971,7 +973,7 @@ _GL_CXXALIAS_RPL (strcasestr, char *,
# else # else
# if ! @HAVE_STRCASESTR@ # if ! @HAVE_STRCASESTR@
_GL_FUNCDECL_SYS (strcasestr, char *, _GL_FUNCDECL_SYS (strcasestr, char *,
(const char *haystack, const char *needle) (const char *haystack, const char *needle),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
@ -1038,7 +1040,7 @@ _GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character "
# endif # endif
_GL_FUNCDECL_RPL (strtok_r, char *, _GL_FUNCDECL_RPL (strtok_r, char *,
(char *restrict s, char const *restrict delim, (char *restrict s, char const *restrict delim,
char **restrict save_ptr) char **restrict save_ptr),
_GL_ARG_NONNULL ((2, 3))); _GL_ARG_NONNULL ((2, 3)));
_GL_CXXALIAS_RPL (strtok_r, char *, _GL_CXXALIAS_RPL (strtok_r, char *,
(char *restrict s, char const *restrict delim, (char *restrict s, char const *restrict delim,
@ -1050,7 +1052,7 @@ _GL_CXXALIAS_RPL (strtok_r, char *,
# if ! @HAVE_DECL_STRTOK_R@ # if ! @HAVE_DECL_STRTOK_R@
_GL_FUNCDECL_SYS (strtok_r, char *, _GL_FUNCDECL_SYS (strtok_r, char *,
(char *restrict s, char const *restrict delim, (char *restrict s, char const *restrict delim,
char **restrict save_ptr) char **restrict save_ptr),
_GL_ARG_NONNULL ((2, 3))); _GL_ARG_NONNULL ((2, 3)));
# endif # endif
_GL_CXXALIAS_SYS (strtok_r, char *, _GL_CXXALIAS_SYS (strtok_r, char *,
@ -1085,12 +1087,12 @@ _GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbslen rpl_mbslen # define mbslen rpl_mbslen
# endif # endif
_GL_FUNCDECL_RPL (mbslen, size_t, (const char *string) _GL_FUNCDECL_RPL (mbslen, size_t, (const char *string),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mbslen, size_t, (const char *string)); _GL_CXXALIAS_RPL (mbslen, size_t, (const char *string));
# else # else
_GL_FUNCDECL_SYS (mbslen, size_t, (const char *string) _GL_FUNCDECL_SYS (mbslen, size_t, (const char *string),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (mbslen, size_t, (const char *string)); _GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
@ -1117,12 +1119,12 @@ _GL_EXTERN_C size_t mbsnlen (const char *string, size_t len)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbschr rpl_mbschr /* avoid collision with HP-UX function */ # define mbschr rpl_mbschr /* avoid collision with HP-UX function */
# endif # endif
_GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c) _GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c)); _GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c));
# else # else
_GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c) _GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c)); _GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c));
@ -1139,12 +1141,12 @@ _GL_CXXALIASWARN (mbschr);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbsrchr rpl_mbsrchr /* avoid collision with system function */ # define mbsrchr rpl_mbsrchr /* avoid collision with system function */
# endif # endif
_GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c) _GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c)); _GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c));
# else # else
_GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c) _GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c)); _GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c));
@ -1234,12 +1236,12 @@ _GL_EXTERN_C size_t mbscspn (const char *string, const char *accept)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */ # define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
# endif # endif
_GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept) _GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept)); _GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept));
# else # else
_GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept) _GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept)); _GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept));
@ -1329,12 +1331,12 @@ _GL_WARN_ON_USE (strerror, "strerror is unportable - "
# undef strerror_r # undef strerror_r
# define strerror_r rpl_strerror_r # define strerror_r rpl_strerror_r
# endif # endif
_GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen) _GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen)); _GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen));
# else # else
# if !@HAVE_DECL_STRERROR_R@ # if !@HAVE_DECL_STRERROR_R@
_GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen) _GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
# endif # endif
_GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)); _GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen));
@ -1433,13 +1435,13 @@ _GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define strverscmp rpl_strverscmp # define strverscmp rpl_strverscmp
# endif # endif
_GL_FUNCDECL_RPL (strverscmp, int, (const char *, const char *) _GL_FUNCDECL_RPL (strverscmp, int, (const char *, const char *),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strverscmp, int, (const char *, const char *)); _GL_CXXALIAS_RPL (strverscmp, int, (const char *, const char *));
# else # else
# if !@HAVE_STRVERSCMP@ # if !@HAVE_STRVERSCMP@
_GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *) _GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *),
_GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif

View file

@ -45,7 +45,8 @@
#ifndef _@GUARD_PREFIX@_SYS_RANDOM_H #ifndef _@GUARD_PREFIX@_SYS_RANDOM_H
#define _@GUARD_PREFIX@_SYS_RANDOM_H #define _@GUARD_PREFIX@_SYS_RANDOM_H
/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */ /* This file uses _GL_ATTRIBUTE_NODISCARD, GNULIB_POSIXCHECK,
HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED #if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first." #error "Please include config.h first."
#endif #endif
@ -76,15 +77,15 @@
# define getrandom rpl_getrandom # define getrandom rpl_getrandom
# endif # endif
_GL_FUNCDECL_RPL (getrandom, ssize_t, _GL_FUNCDECL_RPL (getrandom, ssize_t,
(void *buffer, size_t length, unsigned int flags) (void *buffer, size_t length, unsigned int flags),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getrandom, ssize_t, _GL_CXXALIAS_RPL (getrandom, ssize_t,
(void *buffer, size_t length, unsigned int flags)); (void *buffer, size_t length, unsigned int flags));
# else # else
# if !@HAVE_GETRANDOM@ # if !@HAVE_GETRANDOM@
_GL_FUNCDECL_SYS (getrandom, ssize_t, _GL_FUNCDECL_SYS (getrandom, ssize_t,
(void *buffer, size_t length, unsigned int flags) (void *buffer, size_t length, unsigned int flags),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (getrandom, ssize_t, _GL_CXXALIAS_SYS (getrandom, ssize_t,
(void *buffer, size_t length, unsigned int flags)); (void *buffer, size_t length, unsigned int flags));

View file

@ -332,8 +332,10 @@ _GL_CXXALIAS_SYS (select, int,
_GL_CXXALIASWARN (select); _GL_CXXALIASWARN (select);
# endif # endif
#elif @HAVE_WINSOCK2_H@ #elif @HAVE_WINSOCK2_H@
# undef select # if !GNULIB_SELECT
# define select select_used_without_requesting_gnulib_module_select # undef select
# define select select_used_without_requesting_gnulib_module_select
# endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef select # undef select
# if HAVE_RAW_DECL_SELECT # if HAVE_RAW_DECL_SELECT

View file

@ -55,7 +55,8 @@
#ifndef _@GUARD_PREFIX@_SYS_STAT_H #ifndef _@GUARD_PREFIX@_SYS_STAT_H
#define _@GUARD_PREFIX@_SYS_STAT_H #define _@GUARD_PREFIX@_SYS_STAT_H
/* This file uses _GL_ATTRIBUTE_NOTHROW, GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */ /* This file uses _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOTHROW,
GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED #if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first." #error "Please include config.h first."
#endif #endif
@ -65,7 +66,7 @@
*/ */
#ifndef _GL_ATTRIBUTE_NOTHROW #ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus # if defined __cplusplus
# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4 # if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
# if __cplusplus >= 201103L # if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true) # define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else # else
@ -122,9 +123,11 @@
# if @GNULIB_STAT@ # if @GNULIB_STAT@
# define stat rpl_stat # define stat rpl_stat
# else # else
/* Provoke a clear link error if stat() is used as a function and # if !GNULIB_STAT
module 'stat' is not in use. */ /* Provoke a clear link error if stat() is used as a function and
# define stat stat_used_without_requesting_gnulib_module_stat module 'stat' is not in use. */
# define stat stat_used_without_requesting_gnulib_module_stat
# endif
# endif # endif
# if !GNULIB_defined_struct_stat # if !GNULIB_defined_struct_stat
@ -433,7 +436,7 @@ struct stat
# undef chmod # undef chmod
# define chmod rpl_chmod # define chmod rpl_chmod
# endif # endif
_GL_FUNCDECL_RPL (chmod, int, (const char *filename, mode_t mode) _GL_FUNCDECL_RPL (chmod, int, (const char *filename, mode_t mode),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (chmod, int, (const char *filename, mode_t mode)); _GL_CXXALIAS_RPL (chmod, int, (const char *filename, mode_t mode));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
@ -478,15 +481,15 @@ _GL_CXXALIASWARN (chmod);
# define fchmodat rpl_fchmodat # define fchmodat rpl_fchmodat
# endif # endif
_GL_FUNCDECL_RPL (fchmodat, int, _GL_FUNCDECL_RPL (fchmodat, int,
(int fd, char const *file, mode_t mode, int flag) (int fd, char const *file, mode_t mode, int flag),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fchmodat, int, _GL_CXXALIAS_RPL (fchmodat, int,
(int fd, char const *file, mode_t mode, int flag)); (int fd, char const *file, mode_t mode, int flag));
# else # else
# if !@HAVE_FCHMODAT@ # if !@HAVE_FCHMODAT@
_GL_FUNCDECL_SYS (fchmodat, int, _GL_FUNCDECL_SYS (fchmodat, int,
(int fd, char const *file, mode_t mode, int flag) (int fd, char const *file, mode_t mode, int flag),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (fchmodat, int, _GL_CXXALIAS_SYS (fchmodat, int,
(int fd, char const *file, mode_t mode, int flag)); (int fd, char const *file, mode_t mode, int flag));
@ -507,7 +510,8 @@ _GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - "
# undef fstat # undef fstat
# define fstat rpl_fstat # define fstat rpl_fstat
# endif # endif
_GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2))); _GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf),
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf)); _GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf));
# else # else
_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf)); _GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
@ -516,8 +520,10 @@ _GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
_GL_CXXALIASWARN (fstat); _GL_CXXALIASWARN (fstat);
# endif # endif
#elif @GNULIB_OVERRIDES_STRUCT_STAT@ #elif @GNULIB_OVERRIDES_STRUCT_STAT@
# undef fstat # if !GNULIB_FSTAT
# define fstat fstat_used_without_requesting_gnulib_module_fstat # undef fstat
# define fstat fstat_used_without_requesting_gnulib_module_fstat
# endif
#elif @WINDOWS_64_BIT_ST_SIZE@ #elif @WINDOWS_64_BIT_ST_SIZE@
/* Above, we define stat to _stati64. */ /* Above, we define stat to _stati64. */
# define fstat _fstati64 # define fstat _fstati64
@ -538,7 +544,7 @@ _GL_WARN_ON_USE (fstat, "fstat has portability problems - "
# endif # endif
_GL_FUNCDECL_RPL (fstatat, int, _GL_FUNCDECL_RPL (fstatat, int,
(int fd, char const *restrict name, struct stat *restrict st, (int fd, char const *restrict name, struct stat *restrict st,
int flags) int flags),
_GL_ARG_NONNULL ((2, 3))); _GL_ARG_NONNULL ((2, 3)));
_GL_CXXALIAS_RPL (fstatat, int, _GL_CXXALIAS_RPL (fstatat, int,
(int fd, char const *restrict name, struct stat *restrict st, (int fd, char const *restrict name, struct stat *restrict st,
@ -547,7 +553,7 @@ _GL_CXXALIAS_RPL (fstatat, int,
# if !@HAVE_FSTATAT@ # if !@HAVE_FSTATAT@
_GL_FUNCDECL_SYS (fstatat, int, _GL_FUNCDECL_SYS (fstatat, int,
(int fd, char const *restrict name, struct stat *restrict st, (int fd, char const *restrict name, struct stat *restrict st,
int flags) int flags),
_GL_ARG_NONNULL ((2, 3))); _GL_ARG_NONNULL ((2, 3)));
# endif # endif
_GL_CXXALIAS_SYS (fstatat, int, _GL_CXXALIAS_SYS (fstatat, int,
@ -556,8 +562,10 @@ _GL_CXXALIAS_SYS (fstatat, int,
# endif # endif
_GL_CXXALIASWARN (fstatat); _GL_CXXALIASWARN (fstatat);
#elif @GNULIB_OVERRIDES_STRUCT_STAT@ #elif @GNULIB_OVERRIDES_STRUCT_STAT@
# undef fstatat # if !GNULIB_FSTATAT
# define fstatat fstatat_used_without_requesting_gnulib_module_fstatat # undef fstatat
# define fstatat fstatat_used_without_requesting_gnulib_module_fstatat
# endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef fstatat # undef fstatat
# if HAVE_RAW_DECL_FSTATAT # if HAVE_RAW_DECL_FSTATAT
@ -600,7 +608,7 @@ _GL_WARN_ON_USE (futimens, "futimens is not portable - "
#if @GNULIB_GETUMASK@ #if @GNULIB_GETUMASK@
# if !@HAVE_GETUMASK@ # if !@HAVE_GETUMASK@
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (getumask, mode_t, (void) _GL_ATTRIBUTE_NOTHROW); _GL_FUNCDECL_SYS (getumask, mode_t, (void)) _GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (getumask, mode_t, (void)); _GL_FUNCDECL_SYS (getumask, mode_t, (void));
# endif # endif
@ -622,7 +630,7 @@ _GL_WARN_ON_USE (getumask, "getumask is not portable - "
/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME /* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME
denotes a symbolic link. */ denotes a symbolic link. */
# if !@HAVE_LCHMOD@ || defined __hpux # if !@HAVE_LCHMOD@ || defined __hpux
_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode) _GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode)); _GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
@ -642,7 +650,7 @@ _GL_WARN_ON_USE (lchmod, "lchmod is unportable - "
# undef mkdir # undef mkdir
# define mkdir rpl_mkdir # define mkdir rpl_mkdir
# endif # endif
_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode) _GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
@ -667,12 +675,6 @@ _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode)); _GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
# endif # endif
_GL_CXXALIASWARN (mkdir); _GL_CXXALIASWARN (mkdir);
#elif defined GNULIB_POSIXCHECK
# undef mkdir
# if HAVE_RAW_DECL_MKDIR
_GL_WARN_ON_USE (mkdir, "mkdir does not always support two parameters - "
"use gnulib module mkdir for portability");
# endif
#elif @GNULIB_MDA_MKDIR@ #elif @GNULIB_MDA_MKDIR@
/* On native Windows, map 'mkdir' to '_mkdir', so that -loldnames is not /* On native Windows, map 'mkdir' to '_mkdir', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between required. In C++ with GNULIB_NAMESPACE, avoid differences between
@ -695,12 +697,18 @@ _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode)); _GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
# endif # endif
_GL_CXXALIASWARN (mkdir); _GL_CXXALIASWARN (mkdir);
#elif defined GNULIB_POSIXCHECK
# undef mkdir
# if HAVE_RAW_DECL_MKDIR
_GL_WARN_ON_USE (mkdir, "mkdir does not always support two parameters - "
"use gnulib module mkdir for portability");
# endif
#endif #endif
#if @GNULIB_MKDIRAT@ #if @GNULIB_MKDIRAT@
# if !@HAVE_MKDIRAT@ # if !@HAVE_MKDIRAT@
_GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode) _GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
# endif # endif
_GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode)); _GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode));
@ -720,12 +728,12 @@ _GL_WARN_ON_USE (mkdirat, "mkdirat is not portable - "
# undef mkfifo # undef mkfifo
# define mkfifo rpl_mkfifo # define mkfifo rpl_mkfifo
# endif # endif
_GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode) _GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mkfifo, int, (char const *file, mode_t mode)); _GL_CXXALIAS_RPL (mkfifo, int, (char const *file, mode_t mode));
# else # else
# if !@HAVE_MKFIFO@ # if !@HAVE_MKFIFO@
_GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode) _GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode)); _GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode));
@ -746,12 +754,12 @@ _GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - "
# undef mkfifoat # undef mkfifoat
# define mkfifoat rpl_mkfifoat # define mkfifoat rpl_mkfifoat
# endif # endif
_GL_FUNCDECL_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode) _GL_FUNCDECL_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode)); _GL_CXXALIAS_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode));
# else # else
# if !@HAVE_MKFIFOAT@ # if !@HAVE_MKFIFOAT@
_GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode) _GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
# endif # endif
_GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)); _GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode));
@ -774,12 +782,12 @@ _GL_WARN_ON_USE (mkfifoat, "mkfifoat is not portable - "
# undef mknod # undef mknod
# define mknod rpl_mknod # define mknod rpl_mknod
# endif # endif
_GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev) _GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)); _GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev));
# else # else
# if !@HAVE_MKNOD@ # if !@HAVE_MKNOD@
_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev) _GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
/* Need to cast, because on OSF/1 5.1, the third parameter is '...'. */ /* Need to cast, because on OSF/1 5.1, the third parameter is '...'. */
@ -802,14 +810,14 @@ _GL_WARN_ON_USE (mknod, "mknod is not portable - "
# define mknodat rpl_mknodat # define mknodat rpl_mknodat
# endif # endif
_GL_FUNCDECL_RPL (mknodat, int, _GL_FUNCDECL_RPL (mknodat, int,
(int fd, char const *file, mode_t mode, dev_t dev) (int fd, char const *file, mode_t mode, dev_t dev),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (mknodat, int, _GL_CXXALIAS_RPL (mknodat, int,
(int fd, char const *file, mode_t mode, dev_t dev)); (int fd, char const *file, mode_t mode, dev_t dev));
# else # else
# if !@HAVE_MKNODAT@ # if !@HAVE_MKNODAT@
_GL_FUNCDECL_SYS (mknodat, int, _GL_FUNCDECL_SYS (mknodat, int,
(int fd, char const *file, mode_t mode, dev_t dev) (int fd, char const *file, mode_t mode, dev_t dev),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
# endif # endif
_GL_CXXALIAS_SYS (mknodat, int, _GL_CXXALIAS_SYS (mknodat, int,
@ -916,7 +924,7 @@ _GL_CXXALIAS_RPL_1 (lstat, stat, int,
# define lstat rpl_lstat # define lstat rpl_lstat
# endif # endif
_GL_FUNCDECL_RPL (lstat, int, _GL_FUNCDECL_RPL (lstat, int,
(const char *restrict name, struct stat *restrict buf) (const char *restrict name, struct stat *restrict buf),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (lstat, int, _GL_CXXALIAS_RPL (lstat, int,
(const char *restrict name, struct stat *restrict buf)); (const char *restrict name, struct stat *restrict buf));
@ -928,8 +936,10 @@ _GL_CXXALIAS_SYS (lstat, int,
_GL_CXXALIASWARN (lstat); _GL_CXXALIASWARN (lstat);
# endif # endif
#elif @GNULIB_OVERRIDES_STRUCT_STAT@ #elif @GNULIB_OVERRIDES_STRUCT_STAT@
# undef lstat # if !GNULIB_LSTAT
# define lstat lstat_used_without_requesting_gnulib_module_lstat # undef lstat
# define lstat lstat_used_without_requesting_gnulib_module_lstat
# endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef lstat # undef lstat
# if HAVE_RAW_DECL_LSTAT # if HAVE_RAW_DECL_LSTAT
@ -968,14 +978,14 @@ _GL_CXXALIASWARN (umask);
# define utimensat rpl_utimensat # define utimensat rpl_utimensat
# endif # endif
_GL_FUNCDECL_RPL (utimensat, int, (int fd, char const *name, _GL_FUNCDECL_RPL (utimensat, int, (int fd, char const *name,
struct timespec const times[2], int flag) struct timespec const times[2], int flag),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (utimensat, int, (int fd, char const *name, _GL_CXXALIAS_RPL (utimensat, int, (int fd, char const *name,
struct timespec const times[2], int flag)); struct timespec const times[2], int flag));
# else # else
# if !@HAVE_UTIMENSAT@ # if !@HAVE_UTIMENSAT@
_GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name, _GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
struct timespec const times[2], int flag) struct timespec const times[2], int flag),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
# endif # endif
_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name, _GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,

View file

@ -105,14 +105,14 @@ struct timeval
# define gettimeofday rpl_gettimeofday # define gettimeofday rpl_gettimeofday
# endif # endif
_GL_FUNCDECL_RPL (gettimeofday, int, _GL_FUNCDECL_RPL (gettimeofday, int,
(struct timeval *restrict, void *restrict) (struct timeval *restrict, void *restrict),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (gettimeofday, int, _GL_CXXALIAS_RPL (gettimeofday, int,
(struct timeval *restrict, void *restrict)); (struct timeval *restrict, void *restrict));
# else # else
# if !@HAVE_GETTIMEOFDAY@ # if !@HAVE_GETTIMEOFDAY@
_GL_FUNCDECL_SYS (gettimeofday, int, _GL_FUNCDECL_SYS (gettimeofday, int,
(struct timeval *restrict, void *restrict) (struct timeval *restrict, void *restrict),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
/* Need to cast, because on glibc systems, by default, the second argument is /* Need to cast, because on glibc systems, by default, the second argument is

View file

@ -147,12 +147,12 @@ extern
# undef timespec_get # undef timespec_get
# define timespec_get rpl_timespec_get # define timespec_get rpl_timespec_get
# endif # endif
_GL_FUNCDECL_RPL (timespec_get, int, (struct timespec *ts, int base) _GL_FUNCDECL_RPL (timespec_get, int, (struct timespec *ts, int base),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (timespec_get, int, (struct timespec *ts, int base)); _GL_CXXALIAS_RPL (timespec_get, int, (struct timespec *ts, int base));
# else # else
# if !@HAVE_TIMESPEC_GET@ # if !@HAVE_TIMESPEC_GET@
_GL_FUNCDECL_SYS (timespec_get, int, (struct timespec *ts, int base) _GL_FUNCDECL_SYS (timespec_get, int, (struct timespec *ts, int base),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base)); _GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base));
@ -176,12 +176,12 @@ _GL_WARN_ON_USE (timespec_get, "timespec_get is unportable - "
# undef timespec_getres # undef timespec_getres
# define timespec_getres rpl_timespec_getres # define timespec_getres rpl_timespec_getres
# endif # endif
_GL_FUNCDECL_RPL (timespec_getres, int, (struct timespec *ts, int base) _GL_FUNCDECL_RPL (timespec_getres, int, (struct timespec *ts, int base),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (timespec_getres, int, (struct timespec *ts, int base)); _GL_CXXALIAS_RPL (timespec_getres, int, (struct timespec *ts, int base));
# else # else
# if !@HAVE_TIMESPEC_GETRES@ # if !@HAVE_TIMESPEC_GETRES@
_GL_FUNCDECL_SYS (timespec_getres, int, (struct timespec *ts, int base) _GL_FUNCDECL_SYS (timespec_getres, int, (struct timespec *ts, int base),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base)); _GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base));
@ -226,14 +226,14 @@ _GL_WARN_ON_USE (time, "time has consistency problems - "
# define nanosleep rpl_nanosleep # define nanosleep rpl_nanosleep
# endif # endif
_GL_FUNCDECL_RPL (nanosleep, int, _GL_FUNCDECL_RPL (nanosleep, int,
(struct timespec const *__rqtp, struct timespec *__rmtp) (struct timespec const *__rqtp, struct timespec *__rmtp),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (nanosleep, int, _GL_CXXALIAS_RPL (nanosleep, int,
(struct timespec const *__rqtp, struct timespec *__rmtp)); (struct timespec const *__rqtp, struct timespec *__rmtp));
# else # else
# if ! @HAVE_NANOSLEEP@ # if ! @HAVE_NANOSLEEP@
_GL_FUNCDECL_SYS (nanosleep, int, _GL_FUNCDECL_SYS (nanosleep, int,
(struct timespec const *__rqtp, struct timespec *__rmtp) (struct timespec const *__rqtp, struct timespec *__rmtp),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (nanosleep, int, _GL_CXXALIAS_SYS (nanosleep, int,
@ -295,7 +295,7 @@ _GL_WARN_ON_USE (tzset, "tzset has portability problems - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mktime rpl_mktime # define mktime rpl_mktime
# endif # endif
_GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp)); _GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp));
# else # else
_GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp)); _GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
@ -321,14 +321,14 @@ _GL_WARN_ON_USE (mktime, "mktime has portability problems - "
# define localtime_r rpl_localtime_r # define localtime_r rpl_localtime_r
# endif # endif
_GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, _GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result) struct tm *restrict __result),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, _GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result)); struct tm *restrict __result));
# else # else
# if ! @HAVE_DECL_LOCALTIME_R@ # if ! @HAVE_DECL_LOCALTIME_R@
_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result) struct tm *restrict __result),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, _GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
@ -343,14 +343,14 @@ _GL_CXXALIASWARN (localtime_r);
# define gmtime_r rpl_gmtime_r # define gmtime_r rpl_gmtime_r
# endif # endif
_GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, _GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result) struct tm *restrict __result),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, _GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result)); struct tm *restrict __result));
# else # else
# if ! @HAVE_DECL_LOCALTIME_R@ # if ! @HAVE_DECL_LOCALTIME_R@
_GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, _GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result) struct tm *restrict __result),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, _GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
@ -381,7 +381,7 @@ _GL_WARN_ON_USE (gmtime_r, "gmtime_r is unportable - "
# undef localtime # undef localtime
# define localtime rpl_localtime # define localtime rpl_localtime
# endif # endif
_GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer) _GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer)); _GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer));
# else # else
@ -404,7 +404,7 @@ _GL_WARN_ON_USE (localtime, "localtime has portability problems - "
# undef gmtime # undef gmtime
# define gmtime rpl_gmtime # define gmtime rpl_gmtime
# endif # endif
_GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer) _GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer)); _GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer));
# else # else
@ -420,7 +420,7 @@ _GL_CXXALIASWARN (gmtime);
# if ! @HAVE_STRPTIME@ # if ! @HAVE_STRPTIME@
_GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf, _GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf,
char const *restrict __format, char const *restrict __format,
struct tm *restrict __tm) struct tm *restrict __tm),
_GL_ARG_NONNULL ((1, 2, 3))); _GL_ARG_NONNULL ((1, 2, 3)));
# endif # endif
_GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf, _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
@ -445,7 +445,7 @@ _GL_WARN_ON_USE (strptime, "strptime is unportable - "
# ifndef __cplusplus # ifndef __cplusplus
_GL_ATTRIBUTE_DEPRECATED _GL_ATTRIBUTE_DEPRECATED
# endif # endif
_GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp) _GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp)); _GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp));
# else # else
@ -467,7 +467,7 @@ _GL_CXXALIASWARN (ctime);
# endif # endif
_GL_FUNCDECL_RPL (strftime, size_t, _GL_FUNCDECL_RPL (strftime, size_t,
(char *restrict __buf, size_t __bufsize, (char *restrict __buf, size_t __bufsize,
const char *restrict __fmt, const struct tm *restrict __tp) const char *restrict __fmt, const struct tm *restrict __tp),
_GL_ARG_NONNULL ((1, 3, 4))); _GL_ARG_NONNULL ((1, 3, 4)));
_GL_CXXALIAS_RPL (strftime, size_t, _GL_CXXALIAS_RPL (strftime, size_t,
(char *restrict __buf, size_t __bufsize, (char *restrict __buf, size_t __bufsize,
@ -488,14 +488,24 @@ _GL_WARN_ON_USE (strftime, "strftime has portability problems - "
# endif # endif
# endif # endif
# if defined _GNU_SOURCE && @GNULIB_TIME_RZ@ && ! @HAVE_TIMEZONE_T@ # if @GNULIB_TIME_RZ@
/* Functions that use a first-class time zone data type, instead of /* Functions that use a first-class time zone data type, instead of
relying on an implicit global time zone. relying on an implicit global time zone.
Inspired by NetBSD. */ Inspired by NetBSD. */
/* Represents a time zone. /* Represents a time zone.
(timezone_t) NULL stands for UTC. */ (timezone_t) NULL stands for UTC. */
# if !@HAVE_TZALLOC@
# if !GNULIB_defined_timezone_t
# if !@HAVE_TIMEZONE_T@
typedef struct tm_zone *timezone_t; typedef struct tm_zone *timezone_t;
# else
typedef struct tm_zone *rpl_timezone_t;
# define timezone_t rpl_timezone_t
# endif
# define GNULIB_defined_timezone_t 1
# endif
# endif
/* tzalloc (name) /* tzalloc (name)
Returns a time zone object for the given time zone NAME. This object Returns a time zone object for the given time zone NAME. This object
@ -505,37 +515,72 @@ typedef struct tm_zone *timezone_t;
would use it the TZ environment variable was unset. would use it the TZ environment variable was unset.
May return NULL if NAME is invalid (this is platform dependent) or May return NULL if NAME is invalid (this is platform dependent) or
upon memory allocation failure. */ upon memory allocation failure. */
# if !@HAVE_TZALLOC@
_GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name)); _GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name));
_GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name)); _GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name));
# endif
/* tzfree (tz) /* tzfree (tz)
Frees a time zone object. Frees a time zone object.
The argument must have been returned by tzalloc(). */ The argument must have been returned by tzalloc(). */
# if !@HAVE_TZALLOC@
_GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz)); _GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz));
_GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz)); _GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz));
# endif
/* localtime_rz (tz, &t, &result) /* localtime_rz (tz, &t, &result)
Converts an absolute time T to a broken-down time RESULT, assuming the Converts an absolute time T to a broken-down time RESULT, assuming the
time zone TZ. time zone TZ.
This function is like 'localtime_r', but relies on the argument TZ instead This function is like 'localtime_r', but relies on the argument TZ instead
of an implicit global time zone. */ of an implicit global time zone. */
# if @REPLACE_LOCALTIME_RZ@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef localtime_rz
# define localtime_rz rpl_localtime_rz
# endif
_GL_FUNCDECL_RPL (localtime_rz, struct tm *,
(timezone_t __tz, time_t const *restrict __timer,
struct tm *restrict __result),
_GL_ARG_NONNULL ((2, 3)));
_GL_CXXALIAS_RPL (localtime_rz, struct tm *,
(timezone_t __tz, time_t const *restrict __timer,
struct tm *restrict __result));
# else
# if !@HAVE_TZALLOC@
_GL_FUNCDECL_SYS (localtime_rz, struct tm *, _GL_FUNCDECL_SYS (localtime_rz, struct tm *,
(timezone_t __tz, time_t const *restrict __timer, (timezone_t __tz, time_t const *restrict __timer,
struct tm *restrict __result) _GL_ARG_NONNULL ((2, 3))); struct tm *restrict __result),
_GL_ARG_NONNULL ((2, 3)));
# endif
_GL_CXXALIAS_SYS (localtime_rz, struct tm *, _GL_CXXALIAS_SYS (localtime_rz, struct tm *,
(timezone_t __tz, time_t const *restrict __timer, (timezone_t __tz, time_t const *restrict __timer,
struct tm *restrict __result)); struct tm *restrict __result));
# endif
/* mktime_z (tz, &tm) /* mktime_z (tz, &tm)
Normalizes the broken-down time TM and converts it to an absolute time, Normalizes the broken-down time TM and converts it to an absolute time,
assuming the time zone TZ. Returns the absolute time. assuming the time zone TZ. Returns the absolute time.
This function is like 'mktime', but relies on the argument TZ instead This function is like 'mktime', but relies on the argument TZ instead
of an implicit global time zone. */ of an implicit global time zone. */
_GL_FUNCDECL_SYS (mktime_z, time_t, # if @REPLACE_MKTIME_Z@
(timezone_t __tz, struct tm *restrict __tm) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef mktime_z
# define mktime_z rpl_mktime_z
# endif
_GL_FUNCDECL_RPL (mktime_z, time_t,
(timezone_t __tz, struct tm *restrict __tm),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (mktime_z, time_t,
(timezone_t __tz, struct tm *restrict __tm));
# else
# if !@HAVE_TZALLOC@
_GL_FUNCDECL_SYS (mktime_z, time_t,
(timezone_t __tz, struct tm *restrict __tm),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (mktime_z, time_t, _GL_CXXALIAS_SYS (mktime_z, time_t,
(timezone_t __tz, struct tm *restrict __tm)); (timezone_t __tz, struct tm *restrict __tm));
# endif
/* Time zone abbreviation strings (returned by 'localtime_rz' or 'mktime_z' /* Time zone abbreviation strings (returned by 'localtime_rz' or 'mktime_z'
in the 'tm_zone' member of 'struct tm') are valid as long as in the 'tm_zone' member of 'struct tm') are valid as long as
@ -552,11 +597,11 @@ _GL_CXXALIAS_SYS (mktime_z, time_t,
# undef timegm # undef timegm
# define timegm rpl_timegm # define timegm rpl_timegm
# endif # endif
_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm)); _GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm));
# else # else
# if ! @HAVE_TIMEGM@ # if ! @HAVE_TIMEGM@
_GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm), _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm)); _GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
# endif # endif

View file

@ -24,16 +24,41 @@
#include <config.h> #include <config.h>
/* Specification. */
#include <time.h> #include <time.h>
#include <errno.h> #if NEED_TIMEZONE_NULL_SUPPORT /* Android API level >= 35 */
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "flexmember.h" struct tm *
#include "idx.h" localtime_rz (timezone_t tz, time_t const *t, struct tm *tm)
#include "time-internal.h" # undef localtime_rz
{
if (!tz)
return gmtime_r (t, tm);
else
return localtime_rz (tz, t, tm);
}
time_t
mktime_z (timezone_t tz, struct tm *tm)
# undef mktime_z
{
if (!tz)
return timegm (tm);
else
return mktime_z (tz, tm);
}
#else
# include <errno.h>
# include <stddef.h>
# include <stdlib.h>
# include <string.h>
# include "flexmember.h"
# include "idx.h"
# include "time-internal.h"
/* The approximate size to use for small allocation requests. This is /* The approximate size to use for small allocation requests. This is
the largest "small" request for the GNU C library malloc. */ the largest "small" request for the GNU C library malloc. */
@ -79,7 +104,7 @@ tzalloc (char const *name)
static bool static bool
save_abbr (timezone_t tz, struct tm *tm) save_abbr (timezone_t tz, struct tm *tm)
{ {
#if HAVE_STRUCT_TM_TM_ZONE # if HAVE_STRUCT_TM_TM_ZONE
char const *zone = tm->tm_zone; char const *zone = tm->tm_zone;
char *zone_copy = (char *) ""; char *zone_copy = (char *) "";
@ -120,7 +145,7 @@ save_abbr (timezone_t tz, struct tm *tm)
/* Replace the zone name so that its lifetime matches that of TZ. */ /* Replace the zone name so that its lifetime matches that of TZ. */
tm->tm_zone = zone_copy; tm->tm_zone = zone_copy;
#endif # endif
return true; return true;
} }
@ -141,21 +166,21 @@ tzfree (timezone_t tz)
/* Get and set the TZ environment variable. These functions can be /* Get and set the TZ environment variable. These functions can be
overridden by programs like Emacs that manage their own environment. */ overridden by programs like Emacs that manage their own environment. */
#ifndef getenv_TZ # ifndef getenv_TZ
static char * static char *
getenv_TZ (void) getenv_TZ (void)
{ {
return getenv ("TZ"); return getenv ("TZ");
} }
#endif # endif
#ifndef setenv_TZ # ifndef setenv_TZ
static int static int
setenv_TZ (char const *tz) setenv_TZ (char const *tz)
{ {
return tz ? setenv ("TZ", tz, 1) : unsetenv ("TZ"); return tz ? setenv ("TZ", tz, 1) : unsetenv ("TZ");
} }
#endif # endif
/* Change the environment to match the specified timezone_t value. /* Change the environment to match the specified timezone_t value.
Return true if successful, false (setting errno) otherwise. */ Return true if successful, false (setting errno) otherwise. */
@ -220,7 +245,7 @@ revert_tz (timezone_t tz)
struct tm * struct tm *
localtime_rz (timezone_t tz, time_t const *t, struct tm *tm) localtime_rz (timezone_t tz, time_t const *t, struct tm *tm)
{ {
#ifdef HAVE_LOCALTIME_INFLOOP_BUG # ifdef HAVE_LOCALTIME_INFLOOP_BUG
/* The -67768038400665599 comes from: /* The -67768038400665599 comes from:
https://lists.gnu.org/r/bug-gnulib/2017-07/msg00142.html https://lists.gnu.org/r/bug-gnulib/2017-07/msg00142.html
On affected platforms the greatest POSIX-compatible time_t value On affected platforms the greatest POSIX-compatible time_t value
@ -233,7 +258,7 @@ localtime_rz (timezone_t tz, time_t const *t, struct tm *tm)
errno = EOVERFLOW; errno = EOVERFLOW;
return NULL; return NULL;
} }
#endif # endif
if (!tz) if (!tz)
return gmtime_r (t, tm); return gmtime_r (t, tm);
@ -282,3 +307,5 @@ mktime_z (timezone_t tz, struct tm *tm)
return -1; return -1;
} }
} }
#endif

View file

@ -69,8 +69,8 @@
#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H #if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
#define _@GUARD_PREFIX@_UNISTD_H #define _@GUARD_PREFIX@_UNISTD_H
/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, GNULIB_POSIXCHECK, /* This file uses _GL_ATTRIBUTE_NODISCARD, _GL_INLINE_HEADER_BEGIN, _GL_INLINE,
HAVE_RAW_DECL_*. */ GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED #if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first." #error "Please include config.h first."
#endif #endif
@ -287,7 +287,7 @@ _GL_INLINE_HEADER_BEGIN
# undef access # undef access
# define access rpl_access # define access rpl_access
# endif # endif
_GL_FUNCDECL_RPL (access, int, (const char *file, int mode) _GL_FUNCDECL_RPL (access, int, (const char *file, int mode),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (access, int, (const char *file, int mode)); _GL_CXXALIAS_RPL (access, int, (const char *file, int mode));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
@ -340,7 +340,7 @@ _GL_CXXALIASWARN (chdir);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef chdir # undef chdir
# if HAVE_RAW_DECL_CHDIR # if HAVE_RAW_DECL_CHDIR
_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - " _GL_WARN_ON_USE (chdir, "chdir is not always in <unistd.h> - "
"use gnulib module chdir for portability"); "use gnulib module chdir for portability");
# endif # endif
#elif @GNULIB_MDA_CHDIR@ #elif @GNULIB_MDA_CHDIR@
@ -371,13 +371,13 @@ _GL_CXXALIASWARN (chdir);
# undef chown # undef chown
# define chown rpl_chown # define chown rpl_chown
# endif # endif
_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid) _GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)); _GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid));
# else # else
# if !@HAVE_CHOWN@ # if !@HAVE_CHOWN@
_GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid) _GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)); _GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid));
# endif # endif
@ -412,8 +412,10 @@ _GL_CXXALIAS_SYS (close, int, (int fd));
# endif # endif
_GL_CXXALIASWARN (close); _GL_CXXALIASWARN (close);
#elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ #elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
# undef close # if !GNULIB_CLOSE
# define close close_used_without_requesting_gnulib_module_close # undef close
# define close close_used_without_requesting_gnulib_module_close
# endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef close # undef close
/* Assume close is always declared. */ /* Assume close is always declared. */
@ -474,7 +476,7 @@ _GL_WARN_ON_USE (copy_file_range,
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define dup rpl_dup # define dup rpl_dup
# endif # endif
_GL_FUNCDECL_RPL (dup, int, (int oldfd)); _GL_FUNCDECL_RPL (dup, int, (int oldfd), _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (dup, int, (int oldfd)); _GL_CXXALIAS_RPL (dup, int, (int oldfd));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -637,7 +639,7 @@ rpl_environ (void)
/* Like access(), except that it uses the effective user id and group id of /* Like access(), except that it uses the effective user id and group id of
the current process. */ the current process. */
# if !@HAVE_EUIDACCESS@ # if !@HAVE_EUIDACCESS@
_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode) _GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode)); _GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode));
@ -662,7 +664,7 @@ _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
# undef execl # undef execl
# define execl rpl_execl # define execl rpl_execl
# endif # endif
_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...) _GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...)); _GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...));
# else # else
@ -697,7 +699,7 @@ _GL_CXXALIASWARN (execl);
# undef execle # undef execle
# define execle rpl_execle # define execle rpl_execle
# endif # endif
_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...) _GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...)); _GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...));
# else # else
@ -733,7 +735,7 @@ _GL_CXXALIASWARN (execle);
# undef execlp # undef execlp
# define execlp rpl_execlp # define execlp rpl_execlp
# endif # endif
_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...) _GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...)); _GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...));
# else # else
@ -770,7 +772,7 @@ _GL_CXXALIASWARN (execlp);
# undef execv # undef execv
# define execv rpl_execv # define execv rpl_execv
# endif # endif
_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv) _GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv)); _GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv));
# else # else
@ -807,7 +809,7 @@ _GL_CXXALIASWARN (execv);
# define execve rpl_execve # define execve rpl_execve
# endif # endif
_GL_FUNCDECL_RPL (execve, int, _GL_FUNCDECL_RPL (execve, int,
(const char *program, char * const *argv, char * const *env) (const char *program, char * const *argv, char * const *env),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (execve, int, _GL_CXXALIAS_RPL (execve, int,
(const char *program, char * const *argv, char * const *env)); (const char *program, char * const *argv, char * const *env));
@ -847,7 +849,7 @@ _GL_CXXALIASWARN (execve);
# undef execvp # undef execvp
# define execvp rpl_execvp # define execvp rpl_execvp
# endif # endif
_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv) _GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv)); _GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv));
# else # else
@ -884,14 +886,14 @@ _GL_CXXALIASWARN (execvp);
# define execvpe rpl_execvpe # define execvpe rpl_execvpe
# endif # endif
_GL_FUNCDECL_RPL (execvpe, int, _GL_FUNCDECL_RPL (execvpe, int,
(const char *program, char * const *argv, char * const *env) (const char *program, char * const *argv, char * const *env),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (execvpe, int, _GL_CXXALIAS_RPL (execvpe, int,
(const char *program, char * const *argv, char * const *env)); (const char *program, char * const *argv, char * const *env));
# else # else
# if !@HAVE_DECL_EXECVPE@ # if !@HAVE_DECL_EXECVPE@
_GL_FUNCDECL_SYS (execvpe, int, _GL_FUNCDECL_SYS (execvpe, int,
(const char *program, char * const *argv, char * const *env) (const char *program, char * const *argv, char * const *env),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
_GL_CXXALIAS_SYS (execvpe, int, _GL_CXXALIAS_SYS (execvpe, int,
@ -922,7 +924,7 @@ _GL_CXXALIAS_MDA_CAST (execvpe, intptr_t,
# elif @HAVE_EXECVPE@ # elif @HAVE_EXECVPE@
# if !@HAVE_DECL_EXECVPE@ # if !@HAVE_DECL_EXECVPE@
_GL_FUNCDECL_SYS (execvpe, int, _GL_FUNCDECL_SYS (execvpe, int,
(const char *program, char * const *argv, char * const *env) (const char *program, char * const *argv, char * const *env),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
# endif # endif
_GL_CXXALIAS_SYS (execvpe, int, _GL_CXXALIAS_SYS (execvpe, int,
@ -941,15 +943,15 @@ _GL_CXXALIASWARN (execvpe);
# define faccessat rpl_faccessat # define faccessat rpl_faccessat
# endif # endif
_GL_FUNCDECL_RPL (faccessat, int, _GL_FUNCDECL_RPL (faccessat, int,
(int fd, char const *name, int mode, int flag) (int fd, char const *name, int mode, int flag),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (faccessat, int, _GL_CXXALIAS_RPL (faccessat, int,
(int fd, char const *name, int mode, int flag)); (int fd, char const *name, int mode, int flag));
# else # else
# if !@HAVE_FACCESSAT@ # if !@HAVE_FACCESSAT@
_GL_FUNCDECL_SYS (faccessat, int, _GL_FUNCDECL_SYS (faccessat, int,
(int fd, char const *file, int mode, int flag) (int fd, char const *file, int mode, int flag),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (faccessat, int, _GL_CXXALIAS_SYS (faccessat, int,
(int fd, char const *file, int mode, int flag)); (int fd, char const *file, int mode, int flag));
@ -977,11 +979,11 @@ _GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
# undef fchdir # undef fchdir
# define fchdir rpl_fchdir # define fchdir rpl_fchdir
# endif # endif
_GL_FUNCDECL_RPL (fchdir, int, (int /*fd*/)); _GL_FUNCDECL_RPL (fchdir, int, (int /*fd*/), _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fchdir, int, (int /*fd*/)); _GL_CXXALIAS_RPL (fchdir, int, (int /*fd*/));
# else # else
# if !@HAVE_FCHDIR@ || !@HAVE_DECL_FCHDIR@ # if !@HAVE_FCHDIR@ || !@HAVE_DECL_FCHDIR@
_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/)); _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/), _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/)); _GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
# endif # endif
@ -1010,15 +1012,15 @@ _GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
# define fchownat rpl_fchownat # define fchownat rpl_fchownat
# endif # endif
_GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file, _GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
uid_t owner, gid_t group, int flag) uid_t owner, gid_t group, int flag),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file, _GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
uid_t owner, gid_t group, int flag)); uid_t owner, gid_t group, int flag));
# else # else
# if !@HAVE_FCHOWNAT@ # if !@HAVE_FCHOWNAT@
_GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file, _GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
uid_t owner, gid_t group, int flag) uid_t owner, gid_t group, int flag),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file, _GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
uid_t owner, gid_t group, int flag)); uid_t owner, gid_t group, int flag));
@ -1092,13 +1094,17 @@ _GL_WARN_ON_USE (fsync, "fsync is unportable - "
# undef ftruncate # undef ftruncate
# define ftruncate rpl_ftruncate # define ftruncate rpl_ftruncate
# endif # endif
_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length)); _GL_FUNCDECL_RPL (ftruncate, int,
_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length)); (int fd, off_t length), _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (ftruncate, int,
(int fd, off_t length));
# else # else
# if !@HAVE_FTRUNCATE@ # if !@HAVE_FTRUNCATE@
_GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length)); _GL_FUNCDECL_SYS (ftruncate, int,
(int fd, off_t length), _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length)); _GL_CXXALIAS_SYS (ftruncate, int,
(int fd, off_t length));
# endif # endif
# if __GLIBC__ >= 2 # if __GLIBC__ >= 2
_GL_CXXALIASWARN (ftruncate); _GL_CXXALIASWARN (ftruncate);
@ -1127,7 +1133,8 @@ _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define getcwd rpl_getcwd # define getcwd rpl_getcwd
# endif # endif
_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size)); _GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size),
_GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size)); _GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -1182,15 +1189,19 @@ _GL_CXXALIASWARN (getcwd);
# undef getdomainname # undef getdomainname
# define getdomainname rpl_getdomainname # define getdomainname rpl_getdomainname
# endif # endif
_GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len) _GL_FUNCDECL_RPL (getdomainname, int,
_GL_ARG_NONNULL ((1))); (char *name, size_t len),
_GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len)); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getdomainname, int,
(char *name, size_t len));
# else # else
# if !@HAVE_DECL_GETDOMAINNAME@ # if !@HAVE_DECL_GETDOMAINNAME@
_GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len) _GL_FUNCDECL_SYS (getdomainname, int,
_GL_ARG_NONNULL ((1))); (char *name, size_t len),
_GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len)); _GL_CXXALIAS_SYS (getdomainname, int,
(char *name, size_t len));
# endif # endif
# if __GLIBC__ >= 2 # if __GLIBC__ >= 2
_GL_CXXALIASWARN (getdomainname); _GL_CXXALIASWARN (getdomainname);
@ -1239,13 +1250,17 @@ _GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
# undef getentropy # undef getentropy
# define getentropy rpl_getentropy # define getentropy rpl_getentropy
# endif # endif
_GL_FUNCDECL_RPL (getentropy, int, (void *buffer, size_t length)); _GL_FUNCDECL_RPL (getentropy, int,
_GL_CXXALIAS_RPL (getentropy, int, (void *buffer, size_t length)); (void *buffer, size_t length), _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getentropy, int,
(void *buffer, size_t length));
# else # else
# if !@HAVE_GETENTROPY@ # if !@HAVE_GETENTROPY@
_GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length)); _GL_FUNCDECL_SYS (getentropy, int,
(void *buffer, size_t length), _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length)); _GL_CXXALIAS_SYS (getentropy, int,
(void *buffer, size_t length));
# endif # endif
# if __GLIBC__ >= 2 # if __GLIBC__ >= 2
_GL_CXXALIASWARN (getentropy); _GL_CXXALIASWARN (getentropy);
@ -1270,13 +1285,17 @@ _GL_WARN_ON_USE (getentropy, "getentropy is unportable - "
# undef getgroups # undef getgroups
# define getgroups rpl_getgroups # define getgroups rpl_getgroups
# endif # endif
_GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups)); _GL_FUNCDECL_RPL (getgroups, int,
_GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups)); (int n, gid_t *groups), _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (getgroups, int,
(int n, gid_t *groups));
# else # else
# if !@HAVE_GETGROUPS@ # if !@HAVE_GETGROUPS@
_GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups)); _GL_FUNCDECL_SYS (getgroups, int,
(int n, gid_t *groups), _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups)); _GL_CXXALIAS_SYS (getgroups, int,
(int n, gid_t *groups));
# endif # endif
_GL_CXXALIASWARN (getgroups); _GL_CXXALIASWARN (getgroups);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
@ -1301,12 +1320,12 @@ _GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
# undef gethostname # undef gethostname
# define gethostname rpl_gethostname # define gethostname rpl_gethostname
# endif # endif
_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len) _GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len)); _GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
# else # else
# if !@HAVE_GETHOSTNAME@ # if !@HAVE_GETHOSTNAME@
_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len) _GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
/* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second /* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second
@ -1316,8 +1335,10 @@ _GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
# endif # endif
_GL_CXXALIASWARN (gethostname); _GL_CXXALIASWARN (gethostname);
#elif @UNISTD_H_HAVE_WINSOCK2_H@ #elif @UNISTD_H_HAVE_WINSOCK2_H@
# undef gethostname # if !GNULIB_GETHOSTNAME
# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname # undef gethostname
# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
# endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef gethostname # undef gethostname
# if HAVE_RAW_DECL_GETHOSTNAME # if HAVE_RAW_DECL_GETHOSTNAME
@ -1371,12 +1392,12 @@ _GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define getlogin_r rpl_getlogin_r # define getlogin_r rpl_getlogin_r
# endif # endif
_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size) _GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size)); _GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size));
# else # else
# if !@HAVE_DECL_GETLOGIN_R@ # if !@HAVE_DECL_GETLOGIN_R@
_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size) _GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
/* Need to cast, because on Solaris 10 systems, the second argument is /* Need to cast, because on Solaris 10 systems, the second argument is
@ -1493,12 +1514,12 @@ _GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
# undef getpass # undef getpass
# define getpass rpl_getpass # define getpass rpl_getpass
# endif # endif
_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt) _GL_FUNCDECL_RPL (getpass, char *, (const char *prompt),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (getpass, char *, (const char *prompt)); _GL_CXXALIAS_RPL (getpass, char *, (const char *prompt));
# else # else
# if !@HAVE_GETPASS@ # if !@HAVE_GETPASS@
_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt) _GL_FUNCDECL_SYS (getpass, char *, (const char *prompt),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (getpass, char *, (const char *prompt)); _GL_CXXALIAS_SYS (getpass, char *, (const char *prompt));
@ -1674,13 +1695,13 @@ _GL_CXXALIASWARN (isatty);
# undef lchown # undef lchown
# define lchown rpl_lchown # define lchown rpl_lchown
# endif # endif
_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group) _GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)); _GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group));
# else # else
# if !@HAVE_LCHOWN@ # if !@HAVE_LCHOWN@
_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group) _GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)); _GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group));
# endif # endif
@ -1703,13 +1724,13 @@ _GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define link rpl_link # define link rpl_link
# endif # endif
_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2) _GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2)); _GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2));
# else # else
# if !@HAVE_LINK@ # if !@HAVE_LINK@
_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2) _GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2)); _GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2));
# endif # endif
@ -1734,8 +1755,8 @@ _GL_WARN_ON_USE (link, "link is unportable - "
# endif # endif
_GL_FUNCDECL_RPL (linkat, int, _GL_FUNCDECL_RPL (linkat, int,
(int fd1, const char *path1, int fd2, const char *path2, (int fd1, const char *path1, int fd2, const char *path2,
int flag) int flag),
_GL_ARG_NONNULL ((2, 4))); _GL_ARG_NONNULL ((2, 4)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (linkat, int, _GL_CXXALIAS_RPL (linkat, int,
(int fd1, const char *path1, int fd2, const char *path2, (int fd1, const char *path1, int fd2, const char *path2,
int flag)); int flag));
@ -1743,8 +1764,8 @@ _GL_CXXALIAS_RPL (linkat, int,
# if !@HAVE_LINKAT@ # if !@HAVE_LINKAT@
_GL_FUNCDECL_SYS (linkat, int, _GL_FUNCDECL_SYS (linkat, int,
(int fd1, const char *path1, int fd2, const char *path2, (int fd1, const char *path1, int fd2, const char *path2,
int flag) int flag),
_GL_ARG_NONNULL ((2, 4))); _GL_ARG_NONNULL ((2, 4)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (linkat, int, _GL_CXXALIAS_SYS (linkat, int,
(int fd1, const char *path1, int fd2, const char *path2, (int fd1, const char *path1, int fd2, const char *path2,
@ -1811,7 +1832,8 @@ _GL_CXXALIASWARN (lseek);
Store the read-end as fd[0] and the write-end as fd[1]. Store the read-end as fd[0] and the write-end as fd[1].
Return 0 upon success, or -1 with errno set upon failure. */ Return 0 upon success, or -1 with errno set upon failure. */
# if !@HAVE_PIPE@ # if !@HAVE_PIPE@
_GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (pipe, int, (int fd[2]),
_GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (pipe, int, (int fd[2])); _GL_CXXALIAS_SYS (pipe, int, (int fd[2]));
_GL_CXXALIASWARN (pipe); _GL_CXXALIASWARN (pipe);
@ -1838,10 +1860,12 @@ _GL_WARN_ON_USE (pipe, "pipe is unportable - "
# undef pipe2 # undef pipe2
# define pipe2 rpl_pipe2 # define pipe2 rpl_pipe2
# endif # endif
_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags),
_GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags)); _GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
# else # else
_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags),
_GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags)); _GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
# endif # endif
# if __GLIBC__ >= 2 # if __GLIBC__ >= 2
@ -1868,15 +1892,15 @@ _GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
# define pread rpl_pread # define pread rpl_pread
# endif # endif
_GL_FUNCDECL_RPL (pread, ssize_t, _GL_FUNCDECL_RPL (pread, ssize_t,
(int fd, void *buf, size_t bufsize, off_t offset) (int fd, void *buf, size_t bufsize, off_t offset),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (pread, ssize_t, _GL_CXXALIAS_RPL (pread, ssize_t,
(int fd, void *buf, size_t bufsize, off_t offset)); (int fd, void *buf, size_t bufsize, off_t offset));
# else # else
# if !@HAVE_PREAD@ # if !@HAVE_PREAD@
_GL_FUNCDECL_SYS (pread, ssize_t, _GL_FUNCDECL_SYS (pread, ssize_t,
(int fd, void *buf, size_t bufsize, off_t offset) (int fd, void *buf, size_t bufsize, off_t offset),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (pread, ssize_t, _GL_CXXALIAS_SYS (pread, ssize_t,
(int fd, void *buf, size_t bufsize, off_t offset)); (int fd, void *buf, size_t bufsize, off_t offset));
@ -1905,15 +1929,15 @@ _GL_WARN_ON_USE (pread, "pread is unportable - "
# define pwrite rpl_pwrite # define pwrite rpl_pwrite
# endif # endif
_GL_FUNCDECL_RPL (pwrite, ssize_t, _GL_FUNCDECL_RPL (pwrite, ssize_t,
(int fd, const void *buf, size_t bufsize, off_t offset) (int fd, const void *buf, size_t bufsize, off_t offset),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (pwrite, ssize_t, _GL_CXXALIAS_RPL (pwrite, ssize_t,
(int fd, const void *buf, size_t bufsize, off_t offset)); (int fd, const void *buf, size_t bufsize, off_t offset));
# else # else
# if !@HAVE_PWRITE@ # if !@HAVE_PWRITE@
_GL_FUNCDECL_SYS (pwrite, ssize_t, _GL_FUNCDECL_SYS (pwrite, ssize_t,
(int fd, const void *buf, size_t bufsize, off_t offset) (int fd, const void *buf, size_t bufsize, off_t offset),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (pwrite, ssize_t, _GL_CXXALIAS_SYS (pwrite, ssize_t,
(int fd, const void *buf, size_t bufsize, off_t offset)); (int fd, const void *buf, size_t bufsize, off_t offset));
@ -1939,8 +1963,9 @@ _GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
# undef read # undef read
# define read rpl_read # define read rpl_read
# endif # endif
_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count)
_GL_ARG_NONNULL ((2))); _GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count)); _GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -1981,8 +2006,8 @@ _GL_CXXALIASWARN (read);
# endif # endif
_GL_FUNCDECL_RPL (readlink, ssize_t, _GL_FUNCDECL_RPL (readlink, ssize_t,
(const char *restrict file, (const char *restrict file,
char *restrict buf, size_t bufsize) char *restrict buf, size_t bufsize),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (readlink, ssize_t, _GL_CXXALIAS_RPL (readlink, ssize_t,
(const char *restrict file, (const char *restrict file,
char *restrict buf, size_t bufsize)); char *restrict buf, size_t bufsize));
@ -1990,8 +2015,8 @@ _GL_CXXALIAS_RPL (readlink, ssize_t,
# if !@HAVE_READLINK@ # if !@HAVE_READLINK@
_GL_FUNCDECL_SYS (readlink, ssize_t, _GL_FUNCDECL_SYS (readlink, ssize_t,
(const char *restrict file, (const char *restrict file,
char *restrict buf, size_t bufsize) char *restrict buf, size_t bufsize),
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (readlink, ssize_t, _GL_CXXALIAS_SYS (readlink, ssize_t,
(const char *restrict file, (const char *restrict file,
@ -2014,8 +2039,8 @@ _GL_WARN_ON_USE (readlink, "readlink is unportable - "
# endif # endif
_GL_FUNCDECL_RPL (readlinkat, ssize_t, _GL_FUNCDECL_RPL (readlinkat, ssize_t,
(int fd, char const *restrict file, (int fd, char const *restrict file,
char *restrict buf, size_t len) char *restrict buf, size_t len),
_GL_ARG_NONNULL ((2, 3))); _GL_ARG_NONNULL ((2, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (readlinkat, ssize_t, _GL_CXXALIAS_RPL (readlinkat, ssize_t,
(int fd, char const *restrict file, (int fd, char const *restrict file,
char *restrict buf, size_t len)); char *restrict buf, size_t len));
@ -2023,8 +2048,8 @@ _GL_CXXALIAS_RPL (readlinkat, ssize_t,
# if !@HAVE_READLINKAT@ # if !@HAVE_READLINKAT@
_GL_FUNCDECL_SYS (readlinkat, ssize_t, _GL_FUNCDECL_SYS (readlinkat, ssize_t,
(int fd, char const *restrict file, (int fd, char const *restrict file,
char *restrict buf, size_t len) char *restrict buf, size_t len),
_GL_ARG_NONNULL ((2, 3))); _GL_ARG_NONNULL ((2, 3)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (readlinkat, ssize_t, _GL_CXXALIAS_SYS (readlinkat, ssize_t,
(int fd, char const *restrict file, (int fd, char const *restrict file,
@ -2048,7 +2073,7 @@ _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define rmdir rpl_rmdir # define rmdir rpl_rmdir
# endif # endif
_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (rmdir, int, (char const *name), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (rmdir, int, (char const *name)); _GL_CXXALIAS_RPL (rmdir, int, (char const *name));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -2097,18 +2122,22 @@ _GL_CXXALIASWARN (rmdir);
# undef sethostname # undef sethostname
# define sethostname rpl_sethostname # define sethostname rpl_sethostname
# endif # endif
_GL_FUNCDECL_RPL (sethostname, int, (const char *name, size_t len) _GL_FUNCDECL_RPL (sethostname, int,
_GL_ARG_NONNULL ((1))); (const char *name, size_t len),
_GL_CXXALIAS_RPL (sethostname, int, (const char *name, size_t len)); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (sethostname, int,
(const char *name, size_t len));
# else # else
# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@ # if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@
_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len) _GL_FUNCDECL_SYS (sethostname, int,
_GL_ARG_NONNULL ((1))); (const char *name, size_t len),
_GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5 /* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5
and FreeBSD 6.4 the second parameter is int. On Solaris 11 and FreeBSD 6.4 the second parameter is int. On Solaris 11
2011-10, the first parameter is not const. */ 2011-10, the first parameter is not const. */
_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len)); _GL_CXXALIAS_SYS_CAST (sethostname, int,
(const char *name, size_t len));
# endif # endif
# if __GLIBC__ >= 2 # if __GLIBC__ >= 2
_GL_CXXALIASWARN (sethostname); _GL_CXXALIASWARN (sethostname);
@ -2181,15 +2210,19 @@ _GL_CXXALIASWARN (swab);
# undef symlink # undef symlink
# define symlink rpl_symlink # define symlink rpl_symlink
# endif # endif
_GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file) _GL_FUNCDECL_RPL (symlink, int,
_GL_ARG_NONNULL ((1, 2))); (char const *contents, char const *file),
_GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file)); _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (symlink, int,
(char const *contents, char const *file));
# else # else
# if !@HAVE_SYMLINK@ # if !@HAVE_SYMLINK@
_GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file) _GL_FUNCDECL_SYS (symlink, int,
_GL_ARG_NONNULL ((1, 2))); (char const *contents, char const *file),
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file)); _GL_CXXALIAS_SYS (symlink, int,
(char const *contents, char const *file));
# endif # endif
_GL_CXXALIASWARN (symlink); _GL_CXXALIASWARN (symlink);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
@ -2208,15 +2241,15 @@ _GL_WARN_ON_USE (symlink, "symlink is not portable - "
# define symlinkat rpl_symlinkat # define symlinkat rpl_symlinkat
# endif # endif
_GL_FUNCDECL_RPL (symlinkat, int, _GL_FUNCDECL_RPL (symlinkat, int,
(char const *contents, int fd, char const *file) (char const *contents, int fd, char const *file),
_GL_ARG_NONNULL ((1, 3))); _GL_ARG_NONNULL ((1, 3)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (symlinkat, int, _GL_CXXALIAS_RPL (symlinkat, int,
(char const *contents, int fd, char const *file)); (char const *contents, int fd, char const *file));
# else # else
# if !@HAVE_SYMLINKAT@ # if !@HAVE_SYMLINKAT@
_GL_FUNCDECL_SYS (symlinkat, int, _GL_FUNCDECL_SYS (symlinkat, int,
(char const *contents, int fd, char const *file) (char const *contents, int fd, char const *file),
_GL_ARG_NONNULL ((1, 3))); _GL_ARG_NONNULL ((1, 3)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (symlinkat, int, _GL_CXXALIAS_SYS (symlinkat, int,
(char const *contents, int fd, char const *file)); (char const *contents, int fd, char const *file));
@ -2243,13 +2276,13 @@ _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
# undef truncate # undef truncate
# define truncate rpl_truncate # define truncate rpl_truncate
# endif # endif
_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length) _GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length)); _GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length));
# else # else
# if !@HAVE_DECL_TRUNCATE@ # if !@HAVE_DECL_TRUNCATE@
_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length) _GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length)); _GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length));
# endif # endif
@ -2274,13 +2307,15 @@ _GL_WARN_ON_USE (truncate, "truncate is unportable - "
# define ttyname_r rpl_ttyname_r # define ttyname_r rpl_ttyname_r
# endif # endif
_GL_FUNCDECL_RPL (ttyname_r, int, _GL_FUNCDECL_RPL (ttyname_r, int,
(int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2))); (int fd, char *buf, size_t buflen),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (ttyname_r, int, _GL_CXXALIAS_RPL (ttyname_r, int,
(int fd, char *buf, size_t buflen)); (int fd, char *buf, size_t buflen));
# else # else
# if !@HAVE_DECL_TTYNAME_R@ # if !@HAVE_DECL_TTYNAME_R@
_GL_FUNCDECL_SYS (ttyname_r, int, _GL_FUNCDECL_SYS (ttyname_r, int,
(int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2))); (int fd, char *buf, size_t buflen),
_GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
# endif # endif
_GL_CXXALIAS_SYS (ttyname_r, int, _GL_CXXALIAS_SYS (ttyname_r, int,
(int fd, char *buf, size_t buflen)); (int fd, char *buf, size_t buflen));
@ -2303,7 +2338,7 @@ _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
# undef unlink # undef unlink
# define unlink rpl_unlink # define unlink rpl_unlink
# endif # endif
_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1))); _GL_FUNCDECL_RPL (unlink, int, (char const *file), _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (unlink, int, (char const *file)); _GL_CXXALIAS_RPL (unlink, int, (char const *file));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -2344,12 +2379,12 @@ _GL_CXXALIASWARN (unlink);
# undef unlinkat # undef unlinkat
# define unlinkat rpl_unlinkat # define unlinkat rpl_unlinkat
# endif # endif
_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag) _GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag)); _GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag));
# else # else
# if !@HAVE_UNLINKAT@ # if !@HAVE_UNLINKAT@
_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag) _GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag),
_GL_ARG_NONNULL ((2))); _GL_ARG_NONNULL ((2)));
# endif # endif
_GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag)); _GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag));
@ -2403,17 +2438,21 @@ _GL_WARN_ON_USE (usleep, "usleep is unportable - "
# undef write # undef write
# define write rpl_write # define write rpl_write
# endif # endif
_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count) _GL_FUNCDECL_RPL (write, ssize_t,
_GL_ARG_NONNULL ((2))); (int fd, const void *buf, size_t count),
_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count)); _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
_GL_CXXALIAS_RPL (write, ssize_t,
(int fd, const void *buf, size_t count));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef write # undef write
# define write _write # define write _write
# endif # endif
_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count)); _GL_CXXALIAS_MDA (write, ssize_t,
(int fd, const void *buf, size_t count));
# else # else
_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); _GL_CXXALIAS_SYS (write, ssize_t,
(int fd, const void *buf, size_t count));
# endif # endif
_GL_CXXALIASWARN (write); _GL_CXXALIASWARN (write);
#elif @GNULIB_MDA_WRITE@ #elif @GNULIB_MDA_WRITE@
@ -2425,9 +2464,11 @@ _GL_CXXALIASWARN (write);
# undef write # undef write
# define write _write # define write _write
# endif # endif
_GL_CXXALIAS_MDA_CAST (write, ssize_t, (int fd, const void *buf, unsigned int count)); _GL_CXXALIAS_MDA_CAST (write, ssize_t,
(int fd, const void *buf, unsigned int count));
# else # else
_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); _GL_CXXALIAS_SYS (write, ssize_t,
(int fd, const void *buf, size_t count));
# endif # endif
_GL_CXXALIASWARN (write); _GL_CXXALIASWARN (write);
#endif #endif

View file

@ -34,11 +34,12 @@
#ifndef __cplusplus #ifndef __cplusplus
# if (201112 <= __STDC_VERSION__ \ # if (201112 <= __STDC_VERSION__ \
|| (!defined __STRICT_ANSI__ \ || (!defined __STRICT_ANSI__ \
&& (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 5 <= __clang_major__))) && ((4 < __GNUC__ + (6 <= __GNUC_MINOR__) && !defined __clang__) \
|| 5 <= __clang_major__)))
# define _GL_HAVE__STATIC_ASSERT 1 # define _GL_HAVE__STATIC_ASSERT 1
# endif # endif
# if (202311 <= __STDC_VERSION__ \ # if (202311 <= __STDC_VERSION__ \
|| (!defined __STRICT_ANSI__ && 9 <= __GNUC__)) || (!defined __STRICT_ANSI__ && 9 <= __GNUC__ && !defined __clang__))
# define _GL_HAVE__STATIC_ASSERT1 1 # define _GL_HAVE__STATIC_ASSERT1 1
# endif # endif
#endif #endif
@ -215,7 +216,7 @@ template <int w>
# define _GL_VERIFY(R, DIAGNOSTIC, ...) \ # define _GL_VERIFY(R, DIAGNOSTIC, ...) \
extern int (*_GL_GENSYM (_gl_verify_function) (void)) \ extern int (*_GL_GENSYM (_gl_verify_function) (void)) \
[_GL_VERIFY_TRUE (R, DIAGNOSTIC)] [_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) # if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) && !defined __clang__
# pragma GCC diagnostic ignored "-Wnested-externs" # pragma GCC diagnostic ignored "-Wnested-externs"
# endif # endif
#endif #endif
@ -305,7 +306,7 @@ template <int w>
#ifndef _GL_HAS_BUILTIN_UNREACHABLE #ifndef _GL_HAS_BUILTIN_UNREACHABLE
# if defined __clang_major__ && __clang_major__ < 5 # if defined __clang_major__ && __clang_major__ < 5
# define _GL_HAS_BUILTIN_UNREACHABLE 0 # define _GL_HAS_BUILTIN_UNREACHABLE 0
# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__) # elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__) && !defined __clang__
# define _GL_HAS_BUILTIN_UNREACHABLE 1 # define _GL_HAS_BUILTIN_UNREACHABLE 1
# elif defined __has_builtin # elif defined __has_builtin
# define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable) # define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)

View file

@ -85,7 +85,7 @@
*/ */
#ifndef _GL_WARN_ON_USE #ifndef _GL_WARN_ON_USE
# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) # if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined __clang__
/* A compiler attribute is available in gcc versions 4.3.0 and later. */ /* A compiler attribute is available in gcc versions 4.3.0 and later. */
# define _GL_WARN_ON_USE(function, message) \ # define _GL_WARN_ON_USE(function, message) \
_GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message))) _GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message)))
@ -98,7 +98,7 @@ _GL_WARN_EXTERN_C __typeof__ (function) function \
__attribute__ ((__diagnose_if__ (1, message, "warning"))) __attribute__ ((__diagnose_if__ (1, message, "warning")))
# define _GL_WARN_ON_USE_ATTRIBUTE(message) \ # define _GL_WARN_ON_USE_ATTRIBUTE(message) \
__attribute__ ((__diagnose_if__ (1, message, "warning"))) __attribute__ ((__diagnose_if__ (1, message, "warning")))
# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING # elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
/* Verify the existence of the function. */ /* Verify the existence of the function. */
# define _GL_WARN_ON_USE(function, message) \ # define _GL_WARN_ON_USE(function, message) \
_GL_WARN_EXTERN_C __typeof__ (function) function _GL_WARN_EXTERN_C __typeof__ (function) function
@ -121,7 +121,7 @@ _GL_WARN_EXTERN_C int _gl_warn_on_use
# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
_GL_WARN_ON_USE (function, msg) _GL_WARN_ON_USE (function, msg)
# else # else
# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) # if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined __clang__
/* A compiler attribute is available in gcc versions 4.3.0 and later. */ /* A compiler attribute is available in gcc versions 4.3.0 and later. */
# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
extern rettype_gcc function parameters_and_attributes \ extern rettype_gcc function parameters_and_attributes \
@ -131,7 +131,7 @@ extern rettype_gcc function parameters_and_attributes \
# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
extern rettype_clang function parameters_and_attributes \ extern rettype_clang function parameters_and_attributes \
__attribute__ ((__diagnose_if__ (1, msg, "warning"))) __attribute__ ((__diagnose_if__ (1, msg, "warning")))
# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING # elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
/* Verify the existence of the function. */ /* Verify the existence of the function. */
# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
extern rettype_gcc function parameters_and_attributes extern rettype_gcc function parameters_and_attributes

View file

@ -47,7 +47,8 @@
#if 7 <= __GNUC__ && !defined __clang__ && PTRDIFF_MAX < SIZE_MAX #if 7 <= __GNUC__ && !defined __clang__ && PTRDIFF_MAX < SIZE_MAX
# define xalloc_oversized(n, s) \ # define xalloc_oversized(n, s) \
__builtin_mul_overflow_p (n, s, (ptrdiff_t) 1) __builtin_mul_overflow_p (n, s, (ptrdiff_t) 1)
#elif 5 <= __GNUC__ && !defined __ICC && PTRDIFF_MAX < SIZE_MAX #elif 5 <= __GNUC__ && !defined __clang__ && !defined __ICC \
&& PTRDIFF_MAX < SIZE_MAX
# define xalloc_oversized(n, s) \ # define xalloc_oversized(n, s) \
(__builtin_constant_p (n) && __builtin_constant_p (s) \ (__builtin_constant_p (n) && __builtin_constant_p (s) \
? __xalloc_oversized (n, s) \ ? __xalloc_oversized (n, s) \

View file

@ -1,11 +1,11 @@
# builtin-expect.m4 # builtin-expect.m4
# serial 1 # serial 2
dnl Copyright 2016-2024 Free Software Foundation, Inc. dnl Copyright 2016-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
dnl Check for __builtin_expect. dnl Provide a GCC-compatible __builtin_expect macro in <config.h>.
dnl Written by Paul Eggert. dnl Written by Paul Eggert.

View file

@ -1,5 +1,5 @@
# errno_h.m4 # errno_h.m4
# serial 14 # serial 18
dnl Copyright (C) 2004, 2006, 2008-2024 Free Software Foundation, Inc. dnl Copyright (C) 2004, 2006, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -10,6 +10,11 @@ AC_PREREQ([2.61])
AC_DEFUN_ONCE([gl_HEADER_ERRNO_H], AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
[ [
AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CC])
dnl Through the dependency on module extensions-aix, _LINUX_SOURCE_COMPAT
dnl gets defined already before this macro gets invoked. This persuades
dnl AIX 7.3 errno.h to assign ENOTEMPTY a value different than EEXIST.
AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [ AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
AC_EGREP_CPP([booboo],[ AC_EGREP_CPP([booboo],[
#include <errno.h> #include <errno.h>
@ -63,6 +68,9 @@ booboo
#endif #endif
#if !defined EILSEQ #if !defined EILSEQ
booboo booboo
#endif
#if !defined ESOCKTNOSUPPORT
booboo
#endif #endif
], ],
[gl_cv_header_errno_h_complete=no], [gl_cv_header_errno_h_complete=no],

25
m4/extensions-aix.m4 Normal file
View file

@ -0,0 +1,25 @@
# extensions-aix.m4
# serial 1
dnl Copyright (C) 2024 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.
# On AIX, most extensions are already enabled through the _ALL_SOURCE macro,
# defined by gl_USE_SYSTEM_EXTENSIONS. gl_USE_AIX_EXTENSIONS additionally
# activates more GNU and Linux-like behaviours, affecting
# - the time_t type,
# - errno values in <errno.h>: ENOTEMPTY
# - functions in <stdlib.h>: malloc calloc realloc valloc
# <https://www.ibm.com/docs/en/aix/7.3?topic=m-malloc-free-realloc-calloc-mallopt-mallinfo-mallinfo-heap-alloca-valloc-posix-memalign-subroutine>
# - functions in <string.h>: strerror_r (returns 'char *', like glibc)
# - functions in <dirent.h>: scandir, alphasort, readdir_r
# - functions in <netdb.h>: gethostbyname_r gethostbyaddr_r
# - declarations in <unistd.h>: sbrk
# and a couple of secondary <sys/*> header files.
AC_DEFUN_ONCE([gl_USE_AIX_EXTENSIONS],
[
AC_DEFINE([_LINUX_SOURCE_COMPAT], [1],
[Define so that AIX headers are more compatible with GNU/Linux.])
])

View file

@ -1,5 +1,5 @@
# fchmodat.m4 # fchmodat.m4
# serial 8 # serial 9
dnl Copyright (C) 2004-2024 Free Software Foundation, Inc. dnl Copyright (C) 2004-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -70,12 +70,12 @@ AC_DEFUN([gl_FUNC_FCHMODAT],
esac esac
], ],
[case "$host_os" in [case "$host_os" in
# Guess no on Linux with glibc and Cygwin. # Guess no on Linux with glibc and Cygwin.
linux-gnu* | cygwin*) gl_cv_func_fchmodat_works="guessing no" ;; linux*-gnu* | cygwin*) gl_cv_func_fchmodat_works="guessing no" ;;
# Guess 'nearly' on AIX. # Guess 'nearly' on AIX.
aix*) gl_cv_func_fchmodat_works="guessing nearly" ;; aix*) gl_cv_func_fchmodat_works="guessing nearly" ;;
# If we don't know, obey --enable-cross-guesses. # If we don't know, obey --enable-cross-guesses.
*) gl_cv_func_fchmodat_works="$gl_cross_guess_normal" ;; *) gl_cv_func_fchmodat_works="$gl_cross_guess_normal" ;;
esac esac
]) ])
rm -f conftest.fchmodat]) rm -f conftest.fchmodat])

View file

@ -1,5 +1,5 @@
# fpieee.m4 # fpieee.m4
# serial 2 -*- coding: utf-8 -*- # serial 2
dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,

View file

@ -1,5 +1,5 @@
# gnulib-common.m4 # gnulib-common.m4
# serial 95 # serial 103
dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -21,10 +21,22 @@ AC_DEFUN([gl_COMMON_BODY], [
#define _GL_CONFIG_H_INCLUDED 1 #define _GL_CONFIG_H_INCLUDED 1
]) ])
AH_VERBATIM([_GL_GNUC_PREREQ], AH_VERBATIM([_GL_GNUC_PREREQ],
[/* True if the compiler says it groks GNU C version MAJOR.MINOR. */ [/* True if the compiler says it groks GNU C version MAJOR.MINOR.
#if defined __GNUC__ && defined __GNUC_MINOR__ Except that
- clang groks GNU C 4.2, even on Windows, where it does not define
__GNUC__.
- The OpenMandriva-modified clang compiler pretends that it groks
GNU C version 13.1, but it doesn't: It does not support
__attribute__ ((__malloc__ (f, i))), nor does it support
__attribute__ ((__warning__ (message))) on a function redeclaration.
- Users can make clang lie as well, through the -fgnuc-version option. */
#if defined __GNUC__ && defined __GNUC_MINOR__ && !defined __clang__
# define _GL_GNUC_PREREQ(major, minor) \ # define _GL_GNUC_PREREQ(major, minor) \
((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__)) ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
#elif defined __clang__
/* clang really only groks GNU C 4.2. */
# define _GL_GNUC_PREREQ(major, minor) \
((major) < 4 + ((minor) <= 2))
#else #else
# define _GL_GNUC_PREREQ(major, minor) 0 # define _GL_GNUC_PREREQ(major, minor) 0
#endif #endif
@ -133,6 +145,23 @@ AC_DEFUN([gl_COMMON_BODY], [
# define _GL_HAVE___HAS_C_ATTRIBUTE 0 # define _GL_HAVE___HAS_C_ATTRIBUTE 0
#endif #endif
/* Attributes in bracket syntax [[...]] vs. attributes in __attribute__((...))
syntax, in function declarations. There are two problems here.
(Last tested with gcc/g++ 14 and clang/clang++ 18.)
1) We want that the _GL_ATTRIBUTE_* can be cumulated on the same declaration
in any order.
=========================== foo.c = foo.cc ===========================
__attribute__ ((__deprecated__)) [[__nodiscard__]] int bar1 (int);
[[__nodiscard__]] __attribute__ ((__deprecated__)) int bar2 (int);
======================================================================
This gives a syntax error
- in C mode with gcc
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108796>, and
- in C++ mode with clang++ version < 16, and
- in C++ mode, inside extern "C" {}, still in newer clang++ versions
<https://github.com/llvm/llvm-project/issues/101990>.
*/
/* Define if, in a function declaration, the attributes in bracket syntax /* Define if, in a function declaration, the attributes in bracket syntax
[[...]] must come before the attributes in __attribute__((...)) syntax. [[...]] must come before the attributes in __attribute__((...)) syntax.
If this is defined, it is best to avoid the bracket syntax, so that the If this is defined, it is best to avoid the bracket syntax, so that the
@ -147,6 +176,176 @@ AC_DEFUN([gl_COMMON_BODY], [
# define _GL_BRACKET_BEFORE_ATTRIBUTE 1 # define _GL_BRACKET_BEFORE_ATTRIBUTE 1
# endif # endif
#endif #endif
/*
2) We want that the _GL_ATTRIBUTE_* can be placed in a declaration
- without 'extern', in C as well as in C++,
- with 'extern', in C,
- with 'extern "C"', in C++
in the same position. That is, we don't want to be forced to use a
macro which arranges for the attribute to come before 'extern' in
one case and after 'extern' in the other case, because such a macro
would make the source code of .h files pretty ugly.
=========================== foo.c = foo.cc ===========================
#ifdef __cplusplus
# define CC "C"
#else
# define CC
#endif
#define ND [[__nodiscard__]]
#define WUR __attribute__((__warn_unused_result__))
#ifdef __cplusplus
extern "C" {
#endif
// gcc clang g++ clang++
ND int foo (int);
int ND foo (int); // warn error warn error
int foo ND (int);
int foo (int) ND; // warn error warn error
WUR int foo (int);
int WUR foo (int);
int fo1 WUR (int); // error error error error
int foo (int) WUR;
#ifdef __cplusplus
}
#endif
// gcc clang g++ clang++
ND extern CC int foo (int); // error error
extern CC ND int foo (int); // error error
extern CC int ND foo (int); // warn error warn error
extern CC int foo ND (int);
extern CC int foo (int) ND; // warn error warn error
WUR extern CC int foo (int); // warn
extern CC WUR int foo (int);
extern CC int WUR foo (int);
extern CC int foo WUR (int); // error error error error
extern CC int foo (int) WUR;
ND EXTERN_C_FUNC int foo (int); // error error
EXTERN_C_FUNC ND int foo (int);
EXTERN_C_FUNC int ND foo (int); // warn error warn error
EXTERN_C_FUNC int foo ND (int);
EXTERN_C_FUNC int foo (int) ND; // warn error warn error
WUR EXTERN_C_FUNC int foo (int); // warn
EXTERN_C_FUNC WUR int foo (int);
EXTERN_C_FUNC int WUR foo (int);
EXTERN_C_FUNC int fo2 WUR (int); // error error error error
EXTERN_C_FUNC int foo (int) WUR;
======================================================================
So, if we insist on using the 'extern' keyword ('extern CC' idiom):
* If _GL_ATTRIBUTE_* expands to bracket syntax [[...]]
in both C and C++, there is one available position:
- between the function name and the parameter list.
* If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax
in both C and C++, there are several available positions:
- before the return type,
- between return type and function name,
- at the end of the declaration.
* If _GL_ATTRIBUTE_* expands to bracket syntax [[...]] in C and to
__attribute__((...)) syntax in C++, there is no available position:
it would need to come before 'extern' in C but after 'extern "C"'
in C++.
* If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax in C and
to bracket syntax [[...]] in C++, there is one available position:
- before the return type.
Whereas, if we use the 'EXTERN_C_FUNC' idiom, which conditionally
omits the 'extern' keyword:
* If _GL_ATTRIBUTE_* expands to bracket syntax [[...]]
in both C and C++, there are two available positions:
- before the return type,
- between the function name and the parameter list.
* If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax
in both C and C++, there are several available positions:
- before the return type,
- between return type and function name,
- at the end of the declaration.
* If _GL_ATTRIBUTE_* expands to bracket syntax [[...]] in C and to
__attribute__((...)) syntax in C++, there is one available position:
- before the return type.
* If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax in C and
to bracket syntax [[...]] in C++, there is one available position:
- before the return type.
The best choice is therefore to use the 'EXTERN_C_FUNC' idiom and
put the attributes before the return type. This works regardless
to what the _GL_ATTRIBUTE_* macros expand.
*/
/* Attributes in bracket syntax [[...]] vs. attributes in __attribute__((...))
syntax, in static/inline function definitions.
There are similar constraints as for function declarations. However, here,
we cannot omit the storage-class specifier. Therefore, the following rule
applies:
* The macros
_GL_ATTRIBUTE_CONST
_GL_ATTRIBUTE_DEPRECATED
_GL_ATTRIBUTE_MAYBE_UNUSED
_GL_ATTRIBUTE_NODISCARD
_GL_ATTRIBUTE_PURE
_GL_ATTRIBUTE_REPRODUCIBLE
_GL_ATTRIBUTE_UNSEQUENCED
which may expand to bracket syntax [[...]], must come first, before the
storage-class specifier.
* Other _GL_ATTRIBUTE_* macros, that expand to __attribute__((...)) syntax,
are better placed between the storage-class specifier and the return
type.
*/
/* Attributes in bracket syntax [[...]] vs. attributes in __attribute__((...))
syntax, in variable declarations.
At which position can they be placed?
(Last tested with gcc/g++ 14 and clang/clang++ 18.)
=========================== foo.c = foo.cc ===========================
#ifdef __cplusplus
# define CC "C"
#else
# define CC
#endif
#define BD [[__deprecated__]]
#define AD __attribute__ ((__deprecated__))
// gcc clang g++ clang++
BD extern CC int var; // error error
extern CC BD int var; // error error
extern CC int BD var; // warn error warn error
extern CC int var BD;
AD extern CC int var; // warn
extern CC AD int var;
extern CC int AD var;
extern CC int var AD;
BD extern CC int z[]; // error error
extern CC BD int z[]; // error error
extern CC int BD z[]; // warn error warn error
extern CC int z1 BD [];
extern CC int z[] BD; // warn error error
AD extern CC int z[]; // warn
extern CC AD int z[];
extern CC int AD z[];
extern CC int z2 AD []; // error error error error
extern CC int z[] AD;
======================================================================
* For non-array variables, the only good position is after the variable name,
that is, at the end of the declaration.
* For array variables, you will need to distinguish C and C++:
- In C, before the 'extern' keyword.
- In C++, between the 'extern "C"' and the variable's type.
*/
]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's alignas instead. ]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's alignas instead.
[ [
/* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the function /* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the function
@ -488,7 +687,7 @@ AC_DEFUN([gl_COMMON_BODY], [
other attributes. */ other attributes. */
#ifndef _GL_ATTRIBUTE_NOTHROW #ifndef _GL_ATTRIBUTE_NOTHROW
# if defined __cplusplus # if defined __cplusplus
# if _GL_GNUC_PREREQ (2, 8) || __clang_major >= 4 # if _GL_GNUC_PREREQ (2, 8) || __clang_major__ >= 4
# if __cplusplus >= 201103L # if __cplusplus >= 201103L
# define _GL_ATTRIBUTE_NOTHROW noexcept (true) # define _GL_ATTRIBUTE_NOTHROW noexcept (true)
# else # else
@ -1156,7 +1355,7 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS],
dnl -Wno-unused-parameter >= 3 >= 3.9 dnl -Wno-unused-parameter >= 3 >= 3.9
dnl dnl
cat > conftest.c <<\EOF cat > conftest.c <<\EOF
#if __GNUC__ >= 3 || (__clang_major__ + (__clang_minor__ >= 9) > 3) #if (__GNUC__ >= 3 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3)
-Wno-cast-qual -Wno-cast-qual
-Wno-conversion -Wno-conversion
-Wno-float-equal -Wno-float-equal
@ -1165,23 +1364,23 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS],
-Wno-unused-function -Wno-unused-function
-Wno-unused-parameter -Wno-unused-parameter
#endif #endif
#if __GNUC__ + (__GNUC_MINOR__ >= 9) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) #if (__GNUC__ + (__GNUC_MINOR__ >= 9) > 4 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3)
-Wno-float-conversion -Wno-float-conversion
#endif #endif
#if __GNUC__ >= 7 || (__clang_major__ + (__clang_minor__ >= 9) > 3) #if (__GNUC__ >= 7 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3)
-Wimplicit-fallthrough -Wimplicit-fallthrough
#endif #endif
#if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) #if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 4 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3)
-Wno-pedantic -Wno-pedantic
#endif #endif
#if 3 < __clang_major__ + (9 <= __clang_minor__) #if 3 < __clang_major__ + (9 <= __clang_minor__)
-Wno-tautological-constant-out-of-range-compare -Wno-tautological-constant-out-of-range-compare
#endif #endif
#if __GNUC__ + (__GNUC_MINOR__ >= 3) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) #if (__GNUC__ + (__GNUC_MINOR__ >= 3) > 4 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3)
-Wno-sign-conversion -Wno-sign-conversion
-Wno-type-limits -Wno-type-limits
#endif #endif
#if __GNUC__ + (__GNUC_MINOR__ >= 5) > 4 #if (__GNUC__ + (__GNUC_MINOR__ >= 5) > 4 && !defined __clang__)
-Wno-unsuffixed-float-constants -Wno-unsuffixed-float-constants
#endif #endif
EOF EOF
@ -1364,7 +1563,7 @@ dnl
dnl This macro sets two variables: dnl This macro sets two variables:
dnl - gl_cv_onwards_func_<func> to yes / no / "future OS version" dnl - gl_cv_onwards_func_<func> to yes / no / "future OS version"
dnl - ac_cv_func_<func> to yes / no / no dnl - ac_cv_func_<func> to yes / no / no
dnl The first variable allows distinguishing all three cases. dnl The first variable allows to distinguish all three cases.
dnl The second variable is set, so that an invocation dnl The second variable is set, so that an invocation
dnl gl_CHECK_FUNCS_ANDROID([func], [[#include <foo.h>]]) dnl gl_CHECK_FUNCS_ANDROID([func], [[#include <foo.h>]])
dnl can be used as a drop-in replacement for dnl can be used as a drop-in replacement for
@ -1417,7 +1616,7 @@ dnl
dnl This macro sets two variables: dnl This macro sets two variables:
dnl - gl_cv_onwards_func_<func> to yes / no / "future OS version" dnl - gl_cv_onwards_func_<func> to yes / no / "future OS version"
dnl - ac_cv_func_<func> to yes / no / no dnl - ac_cv_func_<func> to yes / no / no
dnl The first variable allows distinguishing all three cases. dnl The first variable allows to distinguish all three cases.
dnl The second variable is set, so that an invocation dnl The second variable is set, so that an invocation
dnl gl_CHECK_FUNCS_MACOS([func], [[#include <foo.h>]]) dnl gl_CHECK_FUNCS_MACOS([func], [[#include <foo.h>]])
dnl can be used as a drop-in replacement for dnl can be used as a drop-in replacement for

View file

@ -83,6 +83,10 @@ AC_DEFUN([gl_EARLY],
# Code from module euidaccess: # Code from module euidaccess:
# Code from module execinfo: # Code from module execinfo:
# Code from module extensions: # Code from module extensions:
# This is actually already done in the pre-early phase.
# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
# Code from module extensions-aix:
AC_REQUIRE([gl_USE_AIX_EXTENSIONS])
# Code from module extern-inline: # Code from module extern-inline:
# Code from module faccessat: # Code from module faccessat:
# Code from module fchmodat: # Code from module fchmodat:
@ -129,6 +133,7 @@ AC_DEFUN([gl_EARLY],
# Code from module lchmod: # Code from module lchmod:
# Code from module libc-config: # Code from module libc-config:
# Code from module libgmp: # Code from module libgmp:
# Code from module libgmp-mpz:
# Code from module limits-h: # Code from module limits-h:
# Code from module lstat: # Code from module lstat:
# Code from module malloc-gnu: # Code from module malloc-gnu:
@ -339,6 +344,7 @@ AC_DEFUN([gl_INIT],
gl_CONDITIONAL([GL_COND_OBJ_FSTATAT], gl_CONDITIONAL([GL_COND_OBJ_FSTATAT],
[test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]) [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1])
gl_SYS_STAT_MODULE_INDICATOR([fstatat]) gl_SYS_STAT_MODULE_INDICATOR([fstatat])
gl_MODULE_INDICATOR([fstatat])
gl_FSUSAGE gl_FSUSAGE
gl_CONDITIONAL([GL_COND_OBJ_FSUSAGE], [test $gl_cv_fs_space = yes]) gl_CONDITIONAL([GL_COND_OBJ_FSUSAGE], [test $gl_cv_fs_space = yes])
AM_COND_IF([GL_COND_OBJ_FSUSAGE], [ AM_COND_IF([GL_COND_OBJ_FSUSAGE], [
@ -417,6 +423,7 @@ AC_DEFUN([gl_INIT],
gl_PREREQ_LSTAT gl_PREREQ_LSTAT
]) ])
gl_SYS_STAT_MODULE_INDICATOR([lstat]) gl_SYS_STAT_MODULE_INDICATOR([lstat])
gl_MODULE_INDICATOR([lstat])
gl_FUNC_MEMMEM_SIMPLE gl_FUNC_MEMMEM_SIMPLE
if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
AC_LIBOBJ([memmem]) AC_LIBOBJ([memmem])
@ -496,10 +503,12 @@ AC_DEFUN([gl_INIT],
gl_PREREQ_REGEX gl_PREREQ_REGEX
]) ])
gl_FUNC_SIG2STR gl_FUNC_SIG2STR
gl_CONDITIONAL([GL_COND_OBJ_SIG2STR], [test $ac_cv_func_sig2str = no]) gl_CONDITIONAL([GL_COND_OBJ_SIG2STR],
[test $HAVE_SIG2STR = 0 || test $HAVE_STR2SIG = 0])
AM_COND_IF([GL_COND_OBJ_SIG2STR], [ AM_COND_IF([GL_COND_OBJ_SIG2STR], [
gl_PREREQ_SIG2STR gl_PREREQ_SIG2STR
]) ])
gl_SIGNAL_MODULE_INDICATOR([sig2str])
gl_FUNC_SIGDESCR_NP gl_FUNC_SIGDESCR_NP
gl_CONDITIONAL([GL_COND_OBJ_SIGDESCR_NP], [test $HAVE_SIGDESCR_NP = 0]) gl_CONDITIONAL([GL_COND_OBJ_SIGDESCR_NP], [test $HAVE_SIGDESCR_NP = 0])
gl_STRING_MODULE_INDICATOR([sigdescr_np]) gl_STRING_MODULE_INDICATOR([sigdescr_np])
@ -626,7 +635,8 @@ AC_DEFUN([gl_INIT],
]) ])
gl_TIME_MODULE_INDICATOR([time_r]) gl_TIME_MODULE_INDICATOR([time_r])
gl_TIME_RZ gl_TIME_RZ
gl_CONDITIONAL([GL_COND_OBJ_TIME_RZ], [test $HAVE_TIMEZONE_T = 0]) gl_CONDITIONAL([GL_COND_OBJ_TIME_RZ],
[test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1])
gl_TIME_MODULE_INDICATOR([time_rz]) gl_TIME_MODULE_INDICATOR([time_rz])
gl_FUNC_TIMEGM gl_FUNC_TIMEGM
gl_CONDITIONAL([GL_COND_OBJ_TIMEGM], gl_CONDITIONAL([GL_COND_OBJ_TIMEGM],
@ -1521,6 +1531,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/errno_h.m4 m4/errno_h.m4
m4/euidaccess.m4 m4/euidaccess.m4
m4/execinfo.m4 m4/execinfo.m4
m4/extensions-aix.m4
m4/extensions.m4 m4/extensions.m4
m4/extern-inline.m4 m4/extern-inline.m4
m4/faccessat.m4 m4/faccessat.m4
@ -1557,7 +1568,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/lchmod.m4 m4/lchmod.m4
m4/libgmp.m4 m4/libgmp.m4
m4/limits-h.m4 m4/limits-h.m4
m4/locale-fr.m4 m4/locale-en.m4
m4/lstat.m4 m4/lstat.m4
m4/malloc.m4 m4/malloc.m4
m4/manywarnings-c++.m4 m4/manywarnings-c++.m4

137
m4/locale-en.m4 Normal file
View file

@ -0,0 +1,137 @@
# locale-en.m4
# serial 1
dnl Copyright (C) 2003-2024 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 Determine the name of an English (or American English) locale with
dnl UTF-8 encoding.
AC_DEFUN_ONCE([gt_LOCALE_EN_UTF8],
[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AM_LANGINFO_CODESET])
AC_CACHE_CHECK([for an english Unicode locale], [gt_cv_locale_en_utf8], [
case "$host_os" in
*-musl* | midipix*)
dnl On musl libc, all kinds of ll_CC.UTF-8 locales exist, even without
dnl any locale file on disk. But they are effectively equivalent to the
dnl C.UTF-8 locale, except for locale categories (such as LC_MESSSAGES)
dnl for which localizations (.mo files) have been installed.
gt_cv_locale_en_utf8=en_US.UTF-8
;;
*)
AC_LANG_CONFTEST([AC_LANG_SOURCE([[
#include <locale.h>
#include <time.h>
#if HAVE_LANGINFO_CODESET
# include <langinfo.h>
#endif
#include <stdlib.h>
#include <string.h>
struct tm t;
char buf[16];
int main () {
/* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
imitates locale dependent behaviour by looking at the environment
variables, and all locales use the UTF-8 encoding. */
#if !(defined __BEOS__ || defined __HAIKU__)
/* Check whether the given locale name is recognized by the system. */
# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
category of the locale to "C". */
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
return 1;
# else
if (setlocale (LC_ALL, "") == NULL) return 1;
# endif
/* Check whether nl_langinfo(CODESET) is "UTF-8" or equivalent. */
# if HAVE_LANGINFO_CODESET
{
const char *cs = nl_langinfo (CODESET);
if (!(strcmp (cs, "UTF-8") == 0 || strcmp (cs, "UTF8") == 0
|| strcmp (cs, "utf-8") == 0 || strcmp (cs, "utf8") == 0))
return 1;
}
# endif
# ifdef __CYGWIN__
/* On Cygwin, avoid locale names without encoding suffix, because the
locale_charset() function relies on the encoding suffix. Note that
LC_ALL is set on the command line. */
if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
# endif
/* Check the third month name. */
t.tm_year = 1975 - 1900; t.tm_mon = 3 - 1; t.tm_mday = 24;
if (strftime (buf, sizeof (buf), "%B", &t) < 5 || strcmp (buf, "March") != 0)
return 1;
#endif
#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
/* Check whether the decimal separator is a dot. */
if (localeconv () ->decimal_point[0] != '.') return 1;
#endif
return 0;
}
]])])
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
case "$host_os" in
# Handle native Windows specially, because there setlocale() interprets
# "ar" or "ara" as "Arabic" or "Arabic_Saudi Arabia.1256",
# "en" or "eng" as "English" or "English_United States.1252",
# "fr" or "fra" as "French" or "French_France.1252",
# "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
# "ja" or "jpn" as "Japanese" or "Japanese_Japan.932",
# and similar.
mingw* | windows*)
# Test for the hypothetical native Windows locale name.
if (LC_ALL='English_United States.65001' LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
gt_cv_locale_en_utf8='English_United States.65001'
else
# None found.
gt_cv_locale_en_utf8=none
fi
;;
*)
# Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
# otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
# configure script would override the LC_ALL setting. Likewise for
# LC_CTYPE, which is also set at the beginning of the configure script.
# Test for the locale name with explicit encoding suffix first
# (this is necessary on Haiku).
if (LC_ALL=en_US.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
gt_cv_locale_en_utf8=en_US.UTF-8
else
# Test for the locale name without encoding suffix.
if (LC_ALL=en_US LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
gt_cv_locale_en_utf8=en_US
else
# Test for the Solaris 10 locale name.
if (LC_ALL=en.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
gt_cv_locale_en_utf8=en.UTF-8
else
# None found.
gt_cv_locale_en_utf8=none
fi
fi
fi
;;
esac
fi
rm -fr conftest*
;;
esac
])
LOCALE_EN_UTF8="$gt_cv_locale_en_utf8"
case "$LOCALE_EN_UTF8" in #(
'' | *[[\"\$\'*@<:@]]*)
dnl The empty value occurs when the conftest.c program above could not
dnl be compiled. The other values might cause trouble with sh or make.
AC_MSG_WARN([invalid locale "$LOCALE_EN_UTF8"; assuming "none"])
LOCALE_EN_UTF8=none;;
esac
AC_SUBST([LOCALE_EN_UTF8])
])

View file

@ -1,5 +1,5 @@
# malloc.m4 # malloc.m4
# serial 31 # serial 34
dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -45,6 +45,11 @@ AC_DEFUN([gl_FUNC_MALLOC_GNU],
[ [
AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_REQUIRE([gl_FUNC_MALLOC_POSIX]) AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
dnl Through the dependency on module extensions-aix, _LINUX_SOURCE_COMPAT
dnl gets defined already before this macro gets invoked. This helps
dnl if !(__VEC__ || __AIXVEC), and doesn't hurt otherwise.
REPLACE_MALLOC_FOR_MALLOC_GNU="$REPLACE_MALLOC_FOR_MALLOC_POSIX" REPLACE_MALLOC_FOR_MALLOC_GNU="$REPLACE_MALLOC_FOR_MALLOC_POSIX"
if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 0; then if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 0; then
_AC_FUNC_MALLOC_IF([], [REPLACE_MALLOC_FOR_MALLOC_GNU=1]) _AC_FUNC_MALLOC_IF([], [REPLACE_MALLOC_FOR_MALLOC_GNU=1])

View file

@ -1,5 +1,5 @@
# realloc.m4 # realloc.m4
# serial 29 # serial 32
dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -45,6 +45,11 @@ AC_DEFUN([gl_FUNC_REALLOC_GNU],
[ [
AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_REQUIRE([gl_FUNC_REALLOC_POSIX]) AC_REQUIRE([gl_FUNC_REALLOC_POSIX])
dnl Through the dependency on module extensions-aix, _LINUX_SOURCE_COMPAT
dnl gets defined already before this macro gets invoked. This helps
dnl if !(__VEC__ || __AIXVEC), and doesn't hurt otherwise.
if test $REPLACE_REALLOC_FOR_REALLOC_GNU = 0; then if test $REPLACE_REALLOC_FOR_REALLOC_GNU = 0; then
_AC_FUNC_REALLOC_IF([], [REPLACE_REALLOC_FOR_REALLOC_GNU=1]) _AC_FUNC_REALLOC_IF([], [REPLACE_REALLOC_FOR_REALLOC_GNU=1])
fi fi

View file

@ -1,5 +1,5 @@
# sig2str.m4 # sig2str.m4
# serial 7 # serial 8
dnl Copyright (C) 2002, 2005-2006, 2009-2024 Free Software Foundation, Inc. dnl Copyright (C) 2002, 2005-2006, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -7,7 +7,14 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_SIG2STR], AC_DEFUN([gl_FUNC_SIG2STR],
[ [
AC_CHECK_FUNCS([sig2str]) AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
AC_CHECK_FUNCS([sig2str str2sig])
if test $ac_cv_func_sig2str = no; then
HAVE_SIG2STR=0
fi
if test $ac_cv_func_str2sig = no; then
HAVE_STR2SIG=0
fi
]) ])
# Prerequisites of lib/sig2str.c. # Prerequisites of lib/sig2str.c.

View file

@ -1,5 +1,5 @@
# signal_h.m4 # signal_h.m4
# serial 22 # serial 23
dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -32,7 +32,8 @@ AC_DEFUN_ONCE([gl_SIGNAL_H],
dnl Check for declarations of anything we want to poison if the dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use. dnl corresponding gnulib module is not in use.
gl_WARN_ON_USE_PREPARE([[#include <signal.h> gl_WARN_ON_USE_PREPARE([[#include <signal.h>
]], [pthread_sigmask sigaction ]], [sig2str str2sig
pthread_sigmask sigaction
sigaddset sigdelset sigemptyset sigfillset sigismember sigaddset sigdelset sigemptyset sigfillset sigismember
sigpending sigprocmask]) sigpending sigprocmask])
@ -74,6 +75,7 @@ AC_DEFUN([gl_SIGNAL_H_REQUIRE_DEFAULTS],
m4_defun(GL_MODULE_INDICATOR_PREFIX[_SIGNAL_H_MODULE_INDICATOR_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SIGNAL_H_MODULE_INDICATOR_DEFAULTS], [
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_SIGMASK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_SIGMASK])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAISE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAISE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIG2STR])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNAL_H_SIGPIPE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNAL_H_SIGPIPE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGPROCMASK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGPROCMASK])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGACTION]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGACTION])
@ -88,9 +90,11 @@ AC_DEFUN([gl_SIGNAL_H_DEFAULTS],
HAVE_POSIX_SIGNALBLOCKING=1; AC_SUBST([HAVE_POSIX_SIGNALBLOCKING]) HAVE_POSIX_SIGNALBLOCKING=1; AC_SUBST([HAVE_POSIX_SIGNALBLOCKING])
HAVE_PTHREAD_SIGMASK=1; AC_SUBST([HAVE_PTHREAD_SIGMASK]) HAVE_PTHREAD_SIGMASK=1; AC_SUBST([HAVE_PTHREAD_SIGMASK])
HAVE_RAISE=1; AC_SUBST([HAVE_RAISE]) HAVE_RAISE=1; AC_SUBST([HAVE_RAISE])
HAVE_SIG2STR=1; AC_SUBST([HAVE_SIG2STR])
HAVE_SIGSET_T=1; AC_SUBST([HAVE_SIGSET_T]) HAVE_SIGSET_T=1; AC_SUBST([HAVE_SIGSET_T])
HAVE_SIGINFO_T=1; AC_SUBST([HAVE_SIGINFO_T]) HAVE_SIGINFO_T=1; AC_SUBST([HAVE_SIGINFO_T])
HAVE_SIGACTION=1; AC_SUBST([HAVE_SIGACTION]) HAVE_SIGACTION=1; AC_SUBST([HAVE_SIGACTION])
HAVE_STR2SIG=1; AC_SUBST([HAVE_STR2SIG])
HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION]) AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION])
HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;

View file

@ -1,8 +1,11 @@
# std-gnu11.m4 # std-gnu11.m4
# serial 1 # serial 2
# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*- # Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*-
# The std-gnu23 module, which defines _AC_C_C23_OPTIONS, supersedes us.
m4_ifndef([_AC_C_C23_OPTIONS], [
# This implementation is taken from GNU Autoconf lib/autoconf/c.m4 # This implementation is taken from GNU Autoconf lib/autoconf/c.m4
# commit 017d5ddd82854911f0119691d91ea8a1438824d6 # commit 017d5ddd82854911f0119691d91ea8a1438824d6
# dated Sun Apr 3 13:57:17 2016 -0700 # dated Sun Apr 3 13:57:17 2016 -0700
@ -38,7 +41,7 @@ m4_version_prereq([2.70], [], [
# COMPILER ... is a space separated list of C compilers to search for. # COMPILER ... is a space separated list of C compilers to search for.
# This just gives the user an opportunity to specify an alternative # This just gives the user an opportunity to specify an alternative
# search list for the C compiler. # search list for the C compiler.
AC_DEFUN_ONCE([AC_PROG_CC], AC_DEFUN([AC_PROG_CC],
[AC_LANG_PUSH(C)dnl [AC_LANG_PUSH(C)dnl
AC_ARG_VAR([CC], [C compiler command])dnl AC_ARG_VAR([CC], [C compiler command])dnl
AC_ARG_VAR([CFLAGS], [C compiler flags])dnl AC_ARG_VAR([CFLAGS], [C compiler flags])dnl
@ -830,3 +833,4 @@ dnl with extended modes being tried first.
])# m4_version_prereq ])# m4_version_prereq
])# !_AC_C_C23_OPTIONS

View file

@ -1,5 +1,5 @@
# stdlib_h.m4 # stdlib_h.m4
# serial 78 # serial 81
dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -37,7 +37,7 @@ AC_DEFUN_ONCE([gl_STDLIB_H],
dnl On Solaris 10, in UTF-8 locales, its value is 3 but needs to be 4. dnl On Solaris 10, in UTF-8 locales, its value is 3 but needs to be 4.
dnl Fortunately, we can do this because on this platform MB_LEN_MAX is 5. dnl Fortunately, we can do this because on this platform MB_LEN_MAX is 5.
AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([gt_LOCALE_FR_UTF8]) AC_REQUIRE([gt_LOCALE_EN_UTF8])
AC_CACHE_CHECK([whether MB_CUR_MAX is correct], AC_CACHE_CHECK([whether MB_CUR_MAX is correct],
[gl_cv_macro_MB_CUR_MAX_good], [gl_cv_macro_MB_CUR_MAX_good],
[ [
@ -45,13 +45,13 @@ AC_DEFUN_ONCE([gl_STDLIB_H],
dnl is present. dnl is present.
changequote(,)dnl changequote(,)dnl
case "$host_os" in case "$host_os" in
# Guess no on Solaris. # Guess no on Solaris and Haiku.
solaris*) gl_cv_macro_MB_CUR_MAX_good="guessing no" ;; solaris* | haiku*) gl_cv_macro_MB_CUR_MAX_good="guessing no" ;;
# Guess yes otherwise. # Guess yes otherwise.
*) gl_cv_macro_MB_CUR_MAX_good="guessing yes" ;; *) gl_cv_macro_MB_CUR_MAX_good="guessing yes" ;;
esac esac
changequote([,])dnl changequote([,])dnl
if test $LOCALE_FR_UTF8 != none; then if test "$LOCALE_EN_UTF8" != none; then
AC_RUN_IFELSE( AC_RUN_IFELSE(
[AC_LANG_SOURCE([[ [AC_LANG_SOURCE([[
#include <locale.h> #include <locale.h>
@ -59,7 +59,7 @@ changequote([,])dnl
int main () int main ()
{ {
int result = 0; int result = 0;
if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) if (setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL)
{ {
if (MB_CUR_MAX < 4) if (MB_CUR_MAX < 4)
result |= 1; result |= 1;
@ -146,6 +146,7 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RPMATCH]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RPMATCH])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SECURE_GETENV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SECURE_GETENV])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETENV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETENV])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STACK_TRACE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOD]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOD])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOL])
@ -261,4 +262,5 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
REPLACE_STRTOULL=0; AC_SUBST([REPLACE_STRTOULL]) REPLACE_STRTOULL=0; AC_SUBST([REPLACE_STRTOULL])
REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV]) REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV])
REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB]) REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB])
CAN_PRINT_STACK_TRACE=0; AC_SUBST([CAN_PRINT_STACK_TRACE])
]) ])

View file

@ -1,5 +1,5 @@
# time_h.m4 # time_h.m4
# serial 26 # serial 27
dnl Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc. dnl Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -163,13 +163,16 @@ AC_DEFUN([gl_TIME_H_DEFAULTS],
HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM])
HAVE_TIMESPEC_GET=1; AC_SUBST([HAVE_TIMESPEC_GET]) HAVE_TIMESPEC_GET=1; AC_SUBST([HAVE_TIMESPEC_GET])
HAVE_TIMESPEC_GETRES=1; AC_SUBST([HAVE_TIMESPEC_GETRES]) HAVE_TIMESPEC_GETRES=1; AC_SUBST([HAVE_TIMESPEC_GETRES])
dnl Even GNU libc does not have timezone_t yet. dnl Even GNU libc does not have timezone_t and tzalloc() yet.
HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T]) HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T])
HAVE_TZALLOC=0; AC_SUBST([HAVE_TZALLOC])
REPLACE_CTIME=0; AC_SUBST([REPLACE_CTIME]) REPLACE_CTIME=0; AC_SUBST([REPLACE_CTIME])
REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME]) REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME])
REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME]) REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME])
REPLACE_LOCALTIME_R=0; AC_SUBST([REPLACE_LOCALTIME_R]) REPLACE_LOCALTIME_R=0; AC_SUBST([REPLACE_LOCALTIME_R])
REPLACE_LOCALTIME_RZ=0; AC_SUBST([REPLACE_LOCALTIME_RZ])
REPLACE_MKTIME=0; AC_SUBST([REPLACE_MKTIME]) REPLACE_MKTIME=0; AC_SUBST([REPLACE_MKTIME])
REPLACE_MKTIME_Z=0; AC_SUBST([REPLACE_MKTIME_Z])
REPLACE_NANOSLEEP=0; AC_SUBST([REPLACE_NANOSLEEP]) REPLACE_NANOSLEEP=0; AC_SUBST([REPLACE_NANOSLEEP])
REPLACE_STRFTIME=0; AC_SUBST([REPLACE_STRFTIME]) REPLACE_STRFTIME=0; AC_SUBST([REPLACE_STRFTIME])
REPLACE_TIME=0; AC_SUBST([REPLACE_TIME]) REPLACE_TIME=0; AC_SUBST([REPLACE_TIME])

View file

@ -1,5 +1,5 @@
# time_rz.m4 # time_rz.m4
# serial 2 # serial 3
dnl Copyright (C) 2015-2024 Free Software Foundation, Inc. dnl Copyright (C) 2015-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -11,8 +11,9 @@ dnl Written by Paul Eggert.
AC_DEFUN([gl_TIME_RZ], AC_DEFUN([gl_TIME_RZ],
[ [
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([gl_TIME_H_DEFAULTS]) AC_REQUIRE([gl_TIME_H_DEFAULTS])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([AC_CANONICAL_HOST])
# On Mac OS X 10.6, localtime loops forever with some time_t values. # On Mac OS X 10.6, localtime loops forever with some time_t values.
# See Bug#27706, Bug#27736, and # See Bug#27706, Bug#27736, and
@ -51,4 +52,29 @@ AC_DEFUN([gl_TIME_RZ],
if test "$ac_cv_type_timezone_t" = yes; then if test "$ac_cv_type_timezone_t" = yes; then
HAVE_TIMEZONE_T=1 HAVE_TIMEZONE_T=1
fi fi
gl_CHECK_FUNCS_ANDROID([tzalloc], [[#include <time.h>]])
if test $ac_cv_func_tzalloc = yes; then
HAVE_TZALLOC=1
fi
dnl Assume that tzalloc, localtime_rz, mktime_z are all defined together.
case "$gl_cv_onwards_func_tzalloc" in
yes)
case "$host_os" in
*-android*)
dnl The Android libc functions localtime_rz, mktime_z don't support
dnl a NULL timezone_t argument.
AC_DEFINE([NEED_TIMEZONE_NULL_SUPPORT], [1],
[Define to 1 if localtime_rz, mktime_z exist and can be used with
non-NULL timezone_t values.])
REPLACE_LOCALTIME_RZ=1
REPLACE_MKTIME_Z=1
;;
esac
;;
future*)
REPLACE_LOCALTIME_RZ=1
REPLACE_MKTIME_Z=1
;;
esac
]) ])

View file

@ -475,15 +475,3 @@ extern int emacs_setenv_TZ (char const *);
/* Emacs does not need glibc strftime behavior for AM and PM /* Emacs does not need glibc strftime behavior for AM and PM
indicators. */ indicators. */
#define REQUIRE_GNUISH_STRFTIME_AM_PM false #define REQUIRE_GNUISH_STRFTIME_AM_PM false
#if defined __ANDROID_API__ && __ANDROID_API__ < 35
/* Persuade lib/time.h to include the system's time.h, then... */
#define __need_time_t
#include <time.h>
#undef __need_time_t
/* ... redefine timezone_t to an Emacs-specific type, so that Gnulib's
replacement may not conflict with the OS type uselessly defined when
__ANDROID_API__ < 35. */
#define timezone_t rpl_timezone_t
#endif /* __ANDROID_API__ && __ANDROID_API__ < 35 */