I'm seeing a compilation error in C++ mode on FreeBSD 13.1, and am wondering whether it comes from <spawn.h> or from <sched.h>. In order to determine this, a C++ test for <sched.h> is needed. While at it, I'm also adding C++ tests for other .h files, such as <stdalign.h> and <sys/file.h>.
2022-09-03 Bruno Haible <[email protected]> stdnoreturn: Document relation to C++. * doc/posix-headers/stdnoreturn.texi: Document FreeBSD problem. 2022-09-03 Bruno Haible <[email protected]> sysexits: Add C++ tests. * tests/test-sysexits-c++.cc: New file. * modules/sysexits-c++-tests: New file. * modules/sysexits-tests (Depends-on): Add sysexits-c++-tests. 2022-09-03 Bruno Haible <[email protected]> sys_utsname: Add C++ tests. * tests/test-sys_utsname-c++.cc: New file. * modules/sys_utsname-c++-tests: New file. * modules/sys_utsname-tests (Depends-on): Add sys_utsname-c++-tests. 2022-09-03 Bruno Haible <[email protected]> sys_uio: Add C++ tests. * tests/test-sys_uio-c++.cc: New file. * modules/sys_uio-c++-tests: New file. * modules/sys_uio-tests (Depends-on): Add sys_uio-c++-tests. 2022-09-03 Bruno Haible <[email protected]> sys_times: Add C++ tests. * tests/test-sys_times-c++.cc: New file. * modules/sys_times-c++-tests: New file. * modules/sys_times-tests (Depends-on): Add sys_times-c++-tests. 2022-09-03 Bruno Haible <[email protected]> sys_file: Add C++ tests. * tests/test-sys_file-c++.cc: New file. * modules/sys_file-c++-tests: New file. * modules/sys_file-tests (Depends-on): Add sys_file-c++-tests. sys_file: Document this module. * doc/glibc-headers/sys_file.texi: New file. * doc/gnulib.texi (Glibc Header File Substitutes): Include it. 2022-09-03 Bruno Haible <[email protected]> stdckdint: Add C++ tests. * tests/test-stdckdint-c++.cc: New file. * modules/stdckdint-c++-tests: New file. * modules/stdckdint-tests (Depends-on): Add stdckdint-c++-tests. 2022-09-03 Bruno Haible <[email protected]> stdalign: Add C++ tests. * tests/test-stdalign-c++.cc: New file. * modules/stdalign-c++-tests: New file. * modules/stdalign-tests (Depends-on): Add stdalign-c++-tests. 2022-09-03 Bruno Haible <[email protected]> sched: Add C++ tests. * tests/test-sched-c++.cc: New file. * modules/sched-c++-tests: New file. * modules/sched-tests (Depends-on): Add sched-c++-tests. 2022-09-03 Bruno Haible <[email protected]> netinet_in: Add C++ tests. * tests/test-netinet_in-c++.cc: New file. * modules/netinet_in-c++-tests: New file. * modules/netinet_in-tests (Depends-on): Add netinet_in-c++-tests. 2022-09-03 Bruno Haible <[email protected]> net_if: Add C++ tests. * tests/test-net_if-c++.cc: New file. * modules/net_if-c++-tests: New file. * modules/net_if-tests (Depends-on): Add net_if-c++-tests. * doc/posix-headers/net_if.texi: Fix documentation.
>From 9873e7b560392a33250c9ee7cbb7d3d235fc1c5b Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sat, 3 Sep 2022 20:21:37 +0200 Subject: [PATCH 01/14] net_if: Add C++ tests. * tests/test-net_if-c++.cc: New file. * modules/net_if-c++-tests: New file. * modules/net_if-tests (Depends-on): Add net_if-c++-tests. * doc/posix-headers/net_if.texi: Fix documentation. --- ChangeLog | 8 ++++++++ doc/posix-headers/net_if.texi | 6 +++--- modules/net_if-c++-tests | 19 +++++++++++++++++++ modules/net_if-tests | 1 + tests/test-net_if-c++.cc | 28 ++++++++++++++++++++++++++++ 5 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 modules/net_if-c++-tests create mode 100644 tests/test-net_if-c++.cc diff --git a/ChangeLog b/ChangeLog index b81480470a..f01394ba19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2022-09-03 Bruno Haible <[email protected]> + + net_if: Add C++ tests. + * tests/test-net_if-c++.cc: New file. + * modules/net_if-c++-tests: New file. + * modules/net_if-tests (Depends-on): Add net_if-c++-tests. + * doc/posix-headers/net_if.texi: Fix documentation. + 2022-09-03 Bruno Haible <[email protected]> termcap: Fix link error on AIX 7. diff --git a/doc/posix-headers/net_if.texi b/doc/posix-headers/net_if.texi index 48ffa502ae..7d967a815c 100644 --- a/doc/posix-headers/net_if.texi +++ b/doc/posix-headers/net_if.texi @@ -8,6 +8,9 @@ Gnulib module: net_if Portability problems fixed by Gnulib: @itemize @item +This header file is missing on some platforms: +mingw, MSVC 14. +@item This header file is not self-contained on some platforms (needing <sys/socket.h> to be included first): Mac OS X 10.5, FreeBSD 8.2, OpenBSD 5.2. @@ -15,7 +18,4 @@ Mac OS X 10.5, FreeBSD 8.2, OpenBSD 5.2. Portability problems not fixed by Gnulib: @itemize -@item -This header file is missing on some platforms: -mingw, MSVC 14. @end itemize diff --git a/modules/net_if-c++-tests b/modules/net_if-c++-tests new file mode 100644 index 0000000000..211169674b --- /dev/null +++ b/modules/net_if-c++-tests @@ -0,0 +1,19 @@ +Files: +tests/test-net_if-c++.cc + +Status: +c++-test + +Depends-on: +ansi-c++-opt +net_if-tests + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-net_if-c++ +check_PROGRAMS += test-net_if-c++ +test_net_if_c___SOURCES = test-net_if-c++.cc +test_net_if_c___LDADD = $(LDADD) @NET_IF_LIB@ +endif diff --git a/modules/net_if-tests b/modules/net_if-tests index 131880383e..116bf62ea6 100644 --- a/modules/net_if-tests +++ b/modules/net_if-tests @@ -3,6 +3,7 @@ tests/test-net_if.c tests/signature.h Depends-on: +net_if-c++-tests configure.ac: NET_IF_LIB= diff --git a/tests/test-net_if-c++.cc b/tests/test-net_if-c++.cc new file mode 100644 index 0000000000..b78d00be95 --- /dev/null +++ b/tests/test-net_if-c++.cc @@ -0,0 +1,28 @@ +/* Test of <net/if.h> substitute in C++ mode. + Copyright (C) 2022 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <[email protected]>, 2022. */ + +#define GNULIB_NAMESPACE gnulib +#include <config.h> + +#include <net/if.h> + + +int +main () +{ +} -- 2.34.1
>From c6dc4ec6cac1c2ecac037df50d83ff7267eb144a Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sat, 3 Sep 2022 20:33:32 +0200 Subject: [PATCH 02/14] netinet_in: Add C++ tests. * tests/test-netinet_in-c++.cc: New file. * modules/netinet_in-c++-tests: New file. * modules/netinet_in-tests (Depends-on): Add netinet_in-c++-tests. --- ChangeLog | 7 +++++++ modules/netinet_in-c++-tests | 17 +++++++++++++++++ modules/netinet_in-tests | 1 + tests/test-netinet_in-c++.cc | 28 ++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 modules/netinet_in-c++-tests create mode 100644 tests/test-netinet_in-c++.cc diff --git a/ChangeLog b/ChangeLog index f01394ba19..787971efab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2022-09-03 Bruno Haible <[email protected]> + + netinet_in: Add C++ tests. + * tests/test-netinet_in-c++.cc: New file. + * modules/netinet_in-c++-tests: New file. + * modules/netinet_in-tests (Depends-on): Add netinet_in-c++-tests. + 2022-09-03 Bruno Haible <[email protected]> net_if: Add C++ tests. diff --git a/modules/netinet_in-c++-tests b/modules/netinet_in-c++-tests new file mode 100644 index 0000000000..c84cba55cc --- /dev/null +++ b/modules/netinet_in-c++-tests @@ -0,0 +1,17 @@ +Files: +tests/test-netinet_in-c++.cc + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-netinet_in-c++ +check_PROGRAMS += test-netinet_in-c++ +test_netinet_in_c___SOURCES = test-netinet_in-c++.cc +endif diff --git a/modules/netinet_in-tests b/modules/netinet_in-tests index 08d1a28fde..c68cfbf12a 100644 --- a/modules/netinet_in-tests +++ b/modules/netinet_in-tests @@ -2,6 +2,7 @@ Files: tests/test-netinet_in.c Depends-on: +netinet_in-c++-tests configure.ac: diff --git a/tests/test-netinet_in-c++.cc b/tests/test-netinet_in-c++.cc new file mode 100644 index 0000000000..e28192573f --- /dev/null +++ b/tests/test-netinet_in-c++.cc @@ -0,0 +1,28 @@ +/* Test of <netinet/in.h> substitute in C++ mode. + Copyright (C) 2022 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <[email protected]>, 2022. */ + +#define GNULIB_NAMESPACE gnulib +#include <config.h> + +#include <netinet/in.h> + + +int +main () +{ +} -- 2.34.1
>From 263beff33db15c12cf425f991e95f13a91350f8d Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sat, 3 Sep 2022 20:39:11 +0200 Subject: [PATCH 03/14] sched: Add C++ tests. * tests/test-sched-c++.cc: New file. * modules/sched-c++-tests: New file. * modules/sched-tests (Depends-on): Add sched-c++-tests. --- ChangeLog | 7 +++++++ modules/sched-c++-tests | 19 +++++++++++++++++++ modules/sched-tests | 1 + tests/test-sched-c++.cc | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 modules/sched-c++-tests create mode 100644 tests/test-sched-c++.cc diff --git a/ChangeLog b/ChangeLog index 787971efab..2ac7ffd2e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2022-09-03 Bruno Haible <[email protected]> + + sched: Add C++ tests. + * tests/test-sched-c++.cc: New file. + * modules/sched-c++-tests: New file. + * modules/sched-tests (Depends-on): Add sched-c++-tests. + 2022-09-03 Bruno Haible <[email protected]> netinet_in: Add C++ tests. diff --git a/modules/sched-c++-tests b/modules/sched-c++-tests new file mode 100644 index 0000000000..28c6ea184d --- /dev/null +++ b/modules/sched-c++-tests @@ -0,0 +1,19 @@ +Files: +tests/test-sched-c++.cc +tests/signature.h + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-sched-c++ +check_PROGRAMS += test-sched-c++ +test_sched_c___SOURCES = test-sched-c++.cc +test_sched_c___LDADD = $(LDADD) $(LIB_SCHED_YIELD) +endif diff --git a/modules/sched-tests b/modules/sched-tests index 8427490f57..52eed8bc25 100644 --- a/modules/sched-tests +++ b/modules/sched-tests @@ -2,6 +2,7 @@ Files: tests/test-sched.c Depends-on: +sched-c++-tests configure.ac: diff --git a/tests/test-sched-c++.cc b/tests/test-sched-c++.cc new file mode 100644 index 0000000000..7ba8aaac06 --- /dev/null +++ b/tests/test-sched-c++.cc @@ -0,0 +1,35 @@ +/* Test of <sched.h> substitute in C++ mode. + Copyright (C) 2022 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <[email protected]>, 2022. */ + +#define GNULIB_NAMESPACE gnulib +#include <config.h> + +#include <sched.h> + +#include "signature.h" + + +#if GNULIB_TEST_SCHED_YIELD +SIGNATURE_CHECK (GNULIB_NAMESPACE::sched_yield, int, (void)); +#endif + + +int +main () +{ +} -- 2.34.1
>From 37d478a82a2889c7726206c0e0710a0e12cc4c3e Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sat, 3 Sep 2022 20:42:51 +0200 Subject: [PATCH 04/14] stdalign: Add C++ tests. * tests/test-stdalign-c++.cc: New file. * modules/stdalign-c++-tests: New file. * modules/stdalign-tests (Depends-on): Add stdalign-c++-tests. --- ChangeLog | 7 +++++++ modules/stdalign-c++-tests | 17 +++++++++++++++++ modules/stdalign-tests | 1 + tests/test-stdalign-c++.cc | 28 ++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 modules/stdalign-c++-tests create mode 100644 tests/test-stdalign-c++.cc diff --git a/ChangeLog b/ChangeLog index 2ac7ffd2e9..0dab05a998 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2022-09-03 Bruno Haible <[email protected]> + + stdalign: Add C++ tests. + * tests/test-stdalign-c++.cc: New file. + * modules/stdalign-c++-tests: New file. + * modules/stdalign-tests (Depends-on): Add stdalign-c++-tests. + 2022-09-03 Bruno Haible <[email protected]> sched: Add C++ tests. diff --git a/modules/stdalign-c++-tests b/modules/stdalign-c++-tests new file mode 100644 index 0000000000..bc7a1f7f1c --- /dev/null +++ b/modules/stdalign-c++-tests @@ -0,0 +1,17 @@ +Files: +tests/test-stdalign-c++.cc + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-stdalign-c++ +check_PROGRAMS += test-stdalign-c++ +test_stdalign_c___SOURCES = test-stdalign-c++.cc +endif diff --git a/modules/stdalign-tests b/modules/stdalign-tests index 6d97a3d2a4..138fe3550e 100644 --- a/modules/stdalign-tests +++ b/modules/stdalign-tests @@ -5,6 +5,7 @@ tests/macros.h Depends-on: verify stdint +stdalign-c++-tests configure.ac: diff --git a/tests/test-stdalign-c++.cc b/tests/test-stdalign-c++.cc new file mode 100644 index 0000000000..8d5258e5f9 --- /dev/null +++ b/tests/test-stdalign-c++.cc @@ -0,0 +1,28 @@ +/* Test of <stdalign.h> substitute in C++ mode. + Copyright (C) 2022 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <[email protected]>, 2022. */ + +#define GNULIB_NAMESPACE gnulib +#include <config.h> + +#include <stdalign.h> + + +int +main () +{ +} -- 2.34.1
>From eec1cf9601d6f1a67691dc72024f9e55950af6f3 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sat, 3 Sep 2022 20:48:58 +0200 Subject: [PATCH 05/14] stdckdint: Add C++ tests. * tests/test-stdckdint-c++.cc: New file. * modules/stdckdint-c++-tests: New file. * modules/stdckdint-tests (Depends-on): Add stdckdint-c++-tests. --- ChangeLog | 7 +++++++ modules/stdckdint-c++-tests | 17 +++++++++++++++++ modules/stdckdint-tests | 1 + tests/test-stdckdint-c++.cc | 28 ++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 modules/stdckdint-c++-tests create mode 100644 tests/test-stdckdint-c++.cc diff --git a/ChangeLog b/ChangeLog index 0dab05a998..30cf81091c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2022-09-03 Bruno Haible <[email protected]> + + stdckdint: Add C++ tests. + * tests/test-stdckdint-c++.cc: New file. + * modules/stdckdint-c++-tests: New file. + * modules/stdckdint-tests (Depends-on): Add stdckdint-c++-tests. + 2022-09-03 Bruno Haible <[email protected]> stdalign: Add C++ tests. diff --git a/modules/stdckdint-c++-tests b/modules/stdckdint-c++-tests new file mode 100644 index 0000000000..8eb4b48844 --- /dev/null +++ b/modules/stdckdint-c++-tests @@ -0,0 +1,17 @@ +Files: +tests/test-stdckdint-c++.cc + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-stdckdint-c++ +check_PROGRAMS += test-stdckdint-c++ +test_stdckdint_c___SOURCES = test-stdckdint-c++.cc +endif diff --git a/modules/stdckdint-tests b/modules/stdckdint-tests index 153a1fbb42..fb809dac3e 100644 --- a/modules/stdckdint-tests +++ b/modules/stdckdint-tests @@ -7,6 +7,7 @@ Depends-on: inttypes stdbool verify +stdckdint-c++-tests configure.ac: diff --git a/tests/test-stdckdint-c++.cc b/tests/test-stdckdint-c++.cc new file mode 100644 index 0000000000..8be05bad10 --- /dev/null +++ b/tests/test-stdckdint-c++.cc @@ -0,0 +1,28 @@ +/* Test of <stdckdint.h> substitute in C++ mode. + Copyright (C) 2022 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <[email protected]>, 2022. */ + +#define GNULIB_NAMESPACE gnulib +#include <config.h> + +#include <stdckdint.h> + + +int +main () +{ +} -- 2.34.1
>From 4413450467fda40f599a9d4a8f9cc0d542bf3d73 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sat, 3 Sep 2022 20:57:14 +0200 Subject: [PATCH 06/14] sys_file: Document this module. * doc/glibc-headers/sys_file.texi: New file. * doc/gnulib.texi (Glibc Header File Substitutes): Include it. --- ChangeLog | 6 ++++++ doc/glibc-headers/sys_file.texi | 20 ++++++++++++++++++++ doc/gnulib.texi | 2 ++ 3 files changed, 28 insertions(+) create mode 100644 doc/glibc-headers/sys_file.texi diff --git a/ChangeLog b/ChangeLog index 30cf81091c..e6a48eb067 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2022-09-03 Bruno Haible <[email protected]> + + sys_file: Document this module. + * doc/glibc-headers/sys_file.texi: New file. + * doc/gnulib.texi (Glibc Header File Substitutes): Include it. + 2022-09-03 Bruno Haible <[email protected]> stdckdint: Add C++ tests. diff --git a/doc/glibc-headers/sys_file.texi b/doc/glibc-headers/sys_file.texi new file mode 100644 index 0000000000..42ccdf960b --- /dev/null +++ b/doc/glibc-headers/sys_file.texi @@ -0,0 +1,20 @@ +@node sys/file.h +@section @file{sys/file.h} + +Declares the function @code{flock}. + +Gnulib module: sys_file + +Portability problems fixed by Gnulib: +@itemize +@item +This header file is missing on some platforms: +MSVC 14. +@end itemize + +Portability problems not fixed by Gnulib: +@itemize +@item +This header file does not declare the @code{flock} function on some platforms: +AIX 7.1, HP-UX 11.23, Solaris 11.4. +@end itemize diff --git a/doc/gnulib.texi b/doc/gnulib.texi index ec5891e57f..0cc25f9e88 100644 --- a/doc/gnulib.texi +++ b/doc/gnulib.texi @@ -3755,6 +3755,7 @@ not worked around by Gnulib. * pty.h:: * resolv.h:: * shadow.h:: +* sys/file.h:: * sys/ioctl.h:: * sys/random.h:: * sysexits.h:: @@ -3792,6 +3793,7 @@ not worked around by Gnulib. @include glibc-headers/pty.texi @include glibc-headers/resolv.texi @include glibc-headers/shadow.texi +@include glibc-headers/sys_file.texi @include glibc-headers/sys_ioctl.texi @include glibc-headers/sys_random.texi @include glibc-headers/sysexits.texi -- 2.34.1
>From d5046bf23fde7c080388403666958240df29abfa Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sat, 3 Sep 2022 20:58:32 +0200 Subject: [PATCH 07/14] sys_file: Add C++ tests. * tests/test-sys_file-c++.cc: New file. * modules/sys_file-c++-tests: New file. * modules/sys_file-tests (Depends-on): Add sys_file-c++-tests. --- ChangeLog | 5 +++++ modules/sys_file-c++-tests | 17 +++++++++++++++++ modules/sys_file-tests | 1 + tests/test-sys_file-c++.cc | 28 ++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 modules/sys_file-c++-tests create mode 100644 tests/test-sys_file-c++.cc diff --git a/ChangeLog b/ChangeLog index e6a48eb067..d19e201a07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2022-09-03 Bruno Haible <[email protected]> + sys_file: Add C++ tests. + * tests/test-sys_file-c++.cc: New file. + * modules/sys_file-c++-tests: New file. + * modules/sys_file-tests (Depends-on): Add sys_file-c++-tests. + sys_file: Document this module. * doc/glibc-headers/sys_file.texi: New file. * doc/gnulib.texi (Glibc Header File Substitutes): Include it. diff --git a/modules/sys_file-c++-tests b/modules/sys_file-c++-tests new file mode 100644 index 0000000000..7c2af85f02 --- /dev/null +++ b/modules/sys_file-c++-tests @@ -0,0 +1,17 @@ +Files: +tests/test-sys_file-c++.cc + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-sys_file-c++ +check_PROGRAMS += test-sys_file-c++ +test_sys_file_c___SOURCES = test-sys_file-c++.cc +endif diff --git a/modules/sys_file-tests b/modules/sys_file-tests index f52629d545..2fdaf0b354 100644 --- a/modules/sys_file-tests +++ b/modules/sys_file-tests @@ -2,6 +2,7 @@ Files: tests/test-sys_file.c Depends-on: +sys_file-c++-tests configure.ac: diff --git a/tests/test-sys_file-c++.cc b/tests/test-sys_file-c++.cc new file mode 100644 index 0000000000..e87e2471c7 --- /dev/null +++ b/tests/test-sys_file-c++.cc @@ -0,0 +1,28 @@ +/* Test of <sys/file.h> substitute in C++ mode. + Copyright (C) 2022 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <[email protected]>, 2022. */ + +#define GNULIB_NAMESPACE gnulib +#include <config.h> + +#include <sys/file.h> + + +int +main () +{ +} -- 2.34.1
>From 7a5d8aeaa6ce87556658034db96a456690e0e227 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sat, 3 Sep 2022 21:02:30 +0200 Subject: [PATCH 08/14] sys_times: Add C++ tests. * tests/test-sys_times-c++.cc: New file. * modules/sys_times-c++-tests: New file. * modules/sys_times-tests (Depends-on): Add sys_times-c++-tests. --- ChangeLog | 7 +++++++ modules/sys_times-c++-tests | 17 +++++++++++++++++ modules/sys_times-tests | 5 +++++ tests/test-sys_times-c++.cc | 28 ++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 modules/sys_times-c++-tests create mode 100644 tests/test-sys_times-c++.cc diff --git a/ChangeLog b/ChangeLog index d19e201a07..60a289c1c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2022-09-03 Bruno Haible <[email protected]> + + sys_times: Add C++ tests. + * tests/test-sys_times-c++.cc: New file. + * modules/sys_times-c++-tests: New file. + * modules/sys_times-tests (Depends-on): Add sys_times-c++-tests. + 2022-09-03 Bruno Haible <[email protected]> sys_file: Add C++ tests. diff --git a/modules/sys_times-c++-tests b/modules/sys_times-c++-tests new file mode 100644 index 0000000000..a55256d2ea --- /dev/null +++ b/modules/sys_times-c++-tests @@ -0,0 +1,17 @@ +Files: +tests/test-sys_times-c++.cc + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-sys_times-c++ +check_PROGRAMS += test-sys_times-c++ +test_sys_times_c___SOURCES = test-sys_times-c++.cc +endif diff --git a/modules/sys_times-tests b/modules/sys_times-tests index f622157035..f5d4021bdd 100644 --- a/modules/sys_times-tests +++ b/modules/sys_times-tests @@ -1,6 +1,11 @@ Files: tests/test-sys_times.c +Depends-on: +sys_times-c++-tests + +configure.ac: + Makefile.am: TESTS += test-sys_times check_PROGRAMS += test-sys_times diff --git a/tests/test-sys_times-c++.cc b/tests/test-sys_times-c++.cc new file mode 100644 index 0000000000..4b26814b61 --- /dev/null +++ b/tests/test-sys_times-c++.cc @@ -0,0 +1,28 @@ +/* Test of <sys/times.h> substitute in C++ mode. + Copyright (C) 2022 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <[email protected]>, 2022. */ + +#define GNULIB_NAMESPACE gnulib +#include <config.h> + +#include <sys/times.h> + + +int +main () +{ +} -- 2.34.1
>From 4e99bbd6bcf2778f12b854050eb6c22062c502e1 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sat, 3 Sep 2022 21:07:36 +0200 Subject: [PATCH 09/14] sys_uio: Add C++ tests. * tests/test-sys_uio-c++.cc: New file. * modules/sys_uio-c++-tests: New file. * modules/sys_uio-tests (Depends-on): Add sys_uio-c++-tests. --- ChangeLog | 7 +++++++ modules/sys_uio-c++-tests | 17 +++++++++++++++++ modules/sys_uio-tests | 1 + tests/test-sys_uio-c++.cc | 28 ++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 modules/sys_uio-c++-tests create mode 100644 tests/test-sys_uio-c++.cc diff --git a/ChangeLog b/ChangeLog index 60a289c1c3..ea2a9d8baa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2022-09-03 Bruno Haible <[email protected]> + + sys_uio: Add C++ tests. + * tests/test-sys_uio-c++.cc: New file. + * modules/sys_uio-c++-tests: New file. + * modules/sys_uio-tests (Depends-on): Add sys_uio-c++-tests. + 2022-09-03 Bruno Haible <[email protected]> sys_times: Add C++ tests. diff --git a/modules/sys_uio-c++-tests b/modules/sys_uio-c++-tests new file mode 100644 index 0000000000..15765d8419 --- /dev/null +++ b/modules/sys_uio-c++-tests @@ -0,0 +1,17 @@ +Files: +tests/test-sys_uio-c++.cc + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-sys_uio-c++ +check_PROGRAMS += test-sys_uio-c++ +test_sys_uio_c___SOURCES = test-sys_uio-c++.cc +endif diff --git a/modules/sys_uio-tests b/modules/sys_uio-tests index 0258579530..699431cc4e 100644 --- a/modules/sys_uio-tests +++ b/modules/sys_uio-tests @@ -2,6 +2,7 @@ Files: tests/test-sys_uio.c Depends-on: +sys_uio-c++-tests configure.ac: diff --git a/tests/test-sys_uio-c++.cc b/tests/test-sys_uio-c++.cc new file mode 100644 index 0000000000..537947ba8e --- /dev/null +++ b/tests/test-sys_uio-c++.cc @@ -0,0 +1,28 @@ +/* Test of <sys/uio.h> substitute in C++ mode. + Copyright (C) 2022 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <[email protected]>, 2022. */ + +#define GNULIB_NAMESPACE gnulib +#include <config.h> + +#include <sys/uio.h> + + +int +main () +{ +} -- 2.34.1
>From 0839c678348e6b5e5965dc9b5eb62770dab31c3d Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sat, 3 Sep 2022 21:10:07 +0200 Subject: [PATCH 10/14] sys_utsname: Add C++ tests. * tests/test-sys_utsname-c++.cc: New file. * modules/sys_utsname-c++-tests: New file. * modules/sys_utsname-tests (Depends-on): Add sys_utsname-c++-tests. --- ChangeLog | 7 +++++++ modules/sys_utsname-c++-tests | 17 +++++++++++++++++ modules/sys_utsname-tests | 1 + tests/test-sys_utsname-c++.cc | 28 ++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 modules/sys_utsname-c++-tests create mode 100644 tests/test-sys_utsname-c++.cc diff --git a/ChangeLog b/ChangeLog index ea2a9d8baa..9bfc6173a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2022-09-03 Bruno Haible <[email protected]> + + sys_utsname: Add C++ tests. + * tests/test-sys_utsname-c++.cc: New file. + * modules/sys_utsname-c++-tests: New file. + * modules/sys_utsname-tests (Depends-on): Add sys_utsname-c++-tests. + 2022-09-03 Bruno Haible <[email protected]> sys_uio: Add C++ tests. diff --git a/modules/sys_utsname-c++-tests b/modules/sys_utsname-c++-tests new file mode 100644 index 0000000000..2f2a1b39dd --- /dev/null +++ b/modules/sys_utsname-c++-tests @@ -0,0 +1,17 @@ +Files: +tests/test-sys_utsname-c++.cc + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-sys_utsname-c++ +check_PROGRAMS += test-sys_utsname-c++ +test_sys_utsname_c___SOURCES = test-sys_utsname-c++.cc +endif diff --git a/modules/sys_utsname-tests b/modules/sys_utsname-tests index 8d95351f47..9b958c7a74 100644 --- a/modules/sys_utsname-tests +++ b/modules/sys_utsname-tests @@ -2,6 +2,7 @@ Files: tests/test-sys_utsname.c Depends-on: +sys_utsname-c++-tests configure.ac: diff --git a/tests/test-sys_utsname-c++.cc b/tests/test-sys_utsname-c++.cc new file mode 100644 index 0000000000..9bf20802b6 --- /dev/null +++ b/tests/test-sys_utsname-c++.cc @@ -0,0 +1,28 @@ +/* Test of <sys/utsname.h> substitute in C++ mode. + Copyright (C) 2022 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <[email protected]>, 2022. */ + +#define GNULIB_NAMESPACE gnulib +#include <config.h> + +#include <sys/utsname.h> + + +int +main () +{ +} -- 2.34.1
>From 753806a3a15d1a8021e6edc465b965fd5e6a3a81 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sat, 3 Sep 2022 21:13:35 +0200 Subject: [PATCH 11/14] sysexits: Add C++ tests. * tests/test-sysexits-c++.cc: New file. * modules/sysexits-c++-tests: New file. * modules/sysexits-tests (Depends-on): Add sysexits-c++-tests. --- ChangeLog | 7 +++++++ modules/sysexits-c++-tests | 17 +++++++++++++++++ modules/sysexits-tests | 1 + tests/test-sysexits-c++.cc | 28 ++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 modules/sysexits-c++-tests create mode 100644 tests/test-sysexits-c++.cc diff --git a/ChangeLog b/ChangeLog index 9bfc6173a1..eb6a269b24 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2022-09-03 Bruno Haible <[email protected]> + + sysexits: Add C++ tests. + * tests/test-sysexits-c++.cc: New file. + * modules/sysexits-c++-tests: New file. + * modules/sysexits-tests (Depends-on): Add sysexits-c++-tests. + 2022-09-03 Bruno Haible <[email protected]> sys_utsname: Add C++ tests. diff --git a/modules/sysexits-c++-tests b/modules/sysexits-c++-tests new file mode 100644 index 0000000000..e937d82017 --- /dev/null +++ b/modules/sysexits-c++-tests @@ -0,0 +1,17 @@ +Files: +tests/test-sysexits-c++.cc + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-sysexits-c++ +check_PROGRAMS += test-sysexits-c++ +test_sysexits_c___SOURCES = test-sysexits-c++.cc +endif diff --git a/modules/sysexits-tests b/modules/sysexits-tests index 7794cf05b1..e8de13a1c2 100644 --- a/modules/sysexits-tests +++ b/modules/sysexits-tests @@ -2,6 +2,7 @@ Files: tests/test-sysexits.c Depends-on: +sysexits-c++-tests configure.ac: diff --git a/tests/test-sysexits-c++.cc b/tests/test-sysexits-c++.cc new file mode 100644 index 0000000000..619369d5a0 --- /dev/null +++ b/tests/test-sysexits-c++.cc @@ -0,0 +1,28 @@ +/* Test of <sysexits.h> substitute in C++ mode. + Copyright (C) 2022 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <[email protected]>, 2022. */ + +#define GNULIB_NAMESPACE gnulib +#include <config.h> + +#include <sysexits.h> + + +int +main () +{ +} -- 2.34.1
>From 28ee2afa64498f5e7e397dfc66e0a6c9bf339d65 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sat, 3 Sep 2022 22:12:42 +0200 Subject: [PATCH 12/14] stdnoreturn: Document relation to C++. * doc/posix-headers/stdnoreturn.texi: Document FreeBSD problem. --- ChangeLog | 5 +++++ doc/posix-headers/stdnoreturn.texi | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index eb6a269b24..7316fb0f12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2022-09-03 Bruno Haible <[email protected]> + + stdnoreturn: Document relation to C++. + * doc/posix-headers/stdnoreturn.texi: Document FreeBSD problem. + 2022-09-03 Bruno Haible <[email protected]> sysexits: Add C++ tests. diff --git a/doc/posix-headers/stdnoreturn.texi b/doc/posix-headers/stdnoreturn.texi index f37228536c..3e1c5882db 100644 --- a/doc/posix-headers/stdnoreturn.texi +++ b/doc/posix-headers/stdnoreturn.texi @@ -22,6 +22,9 @@ MSVC/clang. Portability problems not fixed by Gnulib: @itemize @item +@code{<stdnoreturn.h>} cannot be #included in C++ mode on some platforms: +FreeBSD 13.1. +@item @code{<stdnoreturn.h>} should be #included before @samp{_Noreturn} is used. @item You cannot assume that @code{_Noreturn} is a reserved word; -- 2.34.1
