bug-gnulib
[Top][All Lists]
Advanced

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

hard-locale tests: fix a conflict with the C++ tests


From: Bruno Haible
Subject: hard-locale tests: fix a conflict with the C++ tests
Date: Wed, 01 Jan 2020 16:43:24 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-170-generic; KDE/5.18.0; x86_64; ; )

On Mac OS X 10.5, in a testdir with --with-c++-tests, I see this compilation
error:

In file included from /usr/include/c++/4.0.0/bits/istream.tcc:45,
                 from /usr/include/c++/4.0.0/istream:814,
                 from /usr/include/c++/4.0.0/sstream:44,
                 from ../../gltests/test-wchar-c++3.cc:22:
./locale:1: error: stray ‘\207’ in program
./locale:1: error: stray ‘\250’ in program
./locale:1: error: stray ‘\237’ in program

The cause is that the 'hard-locale' test, since 2019-12-18, creates
a program named 'locale', and a statement
  #include <locale>
causes the compiler to parse this file as a C++ header file.


2020-01-01  Bruno Haible  <address@hidden>

        hard-locale tests: Fix a conflict with the C++ tests.
        * modules/hard-locale-tests (Makefile.am): Build a program named
        'current-locale', not 'locale'.

diff --git a/modules/hard-locale-tests b/modules/hard-locale-tests
index ddd101f..ac7fcb2 100644
--- a/modules/hard-locale-tests
+++ b/modules/hard-locale-tests
@@ -15,5 +15,8 @@ AC_CHECK_FUNCS_ONCE([duplocale])
 Makefile.am:
 TESTS += test-hard-locale
 check_PROGRAMS += test-hard-locale
-noinst_PROGRAMS += locale
 test_hard_locale_LDADD = $(LDADD) $(LIB_SETLOCALE) @LIB_HARD_LOCALE@
+# We cannot call this program 'locale', because the C++ compiler on Mac OS X
+# would then barf upon '#include <locale>'. So, call it 'current-locale'.
+noinst_PROGRAMS += current-locale
+current_locale_SOURCES = locale.c




reply via email to

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