bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

stdbit-h: Add tests


From: Bruno Haible
Subject: stdbit-h: Add tests
Date: Thu, 16 May 2024 01:28:44 +0200

Like for the other *.in.h files, it makes sense to add a unit test
for this .h file. Done through the second patch below.

It uncovers a compilation error:

g++ -ftrapv -DHAVE_CONFIG_H -I. -I../../gltests -I..  
-DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I.. 
-I../../gltests/.. -I../gllib -I../../gltests/../gllib 
-I/media/develdata/devel/inst-x86_64-64/include -Wall  -Wno-error -O0 
-fno-omit-frame-pointer -ggdb -MT test-stdbit-h-c++.o -MD -MP -MF 
.deps/test-stdbit-h-c++.Tpo -c -o test-stdbit-h-c++.o 
../../gltests/test-stdbit-h-c++.cc
In file included from /usr/include/c++/11/bits/stringfwd.h:40,
                 from /usr/include/c++/11/iosfwd:39,
                 from /usr/include/c++/11/ios:38,
                 from /usr/include/c++/11/ostream:38,
                 from /usr/include/c++/11/iostream:39,
                 from ../../gltests/test-stdbit-h-c++.cc:26:
/usr/include/c++/11/bits/memoryfwd.h:63:3: error: template with C linkage
   63 |   template<typename>
      |   ^~~~~~~~
In file included from ../../gltests/test-stdbit-h-c++.cc:22:
../gllib/stdbit.h:78:1: note: ‘extern "C"’ linkage started here
   78 | extern "C" {
      | ^~~~~~~~~~
In file included from /usr/include/c++/11/bits/stringfwd.h:40,
                 from /usr/include/c++/11/iosfwd:39,
                 from /usr/include/c++/11/ios:38,
                 from /usr/include/c++/11/ostream:38,
                 from /usr/include/c++/11/iostream:39,
                 from ../../gltests/test-stdbit-h-c++.cc:26:
...

The first patch below fixes it.


2024-05-15  Bruno Haible  <bruno@clisp.org>

        stdbit-h: Add tests.
        * tests/test-stdbit-h.c: New file.
        * tests/test-stdbit-h-c++.cc: New file.
        * modules/stdbit-h-tests: New file.
        * modules/stdbit-h-c++-tests: New file.

2024-05-15  Bruno Haible  <bruno@clisp.org>

        stdbit-h: Make it work in C++ mode.
        * lib/stdbit.in.h: Remove extraneous 'extern "C" {' marker.

Attachment: 0001-stdbit-h-Make-it-work-in-C-mode.patch
Description: Text Data

Attachment: 0002-stdbit-h-Add-tests.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]