After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 762065 - Delete obsolete configure-time checks
Delete obsolete configure-time checks
Status: RESOLVED FIXED
Product: libsigc++
Classification: Bindings
Component: build
2.6.x
Other All
: Normal minor
: ---
Assigned To: libsigc++ maintainer(s)
libsigc++ maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-02-15 09:21 UTC by Kjell Ahlstedt
Modified: 2016-03-10 18:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kjell Ahlstedt 2016-02-15 09:21:58 UTC
libsigc++2/configure performs some checks that are unneccesary now. Some of them
have been unnecessary for many years. Isn't it time to remove some of them?

The following list shows the names of the m4 macros used in configure.ac, the
names of the corresponding preprocessor constants, and whether those constants
are defined when gcc 5.2.1 is used.

SIGC_CXX_HAS_NAMESPACE_STD =>
  # define SIGC_HAVE_NAMESPACE_STD 1
Tests if some standard C++ symbols are defined in namespace std.
Of course they are. Unnecessary test. Determines the definition of
SIGC_USING_STD(). Neither SIGC_HAVE_NAMESPACE_STD nor SIGC_USING_STD() are used
by libsigc++ now. (Except that SIGC_HAVE_NAMESPACE_STD is unnecessarily used in
the m4 macro SIGC_CXX_HAS_SUN_REVERSE_ITERATOR.)

SIGC_CXX_HAS_SUN_REVERSE_ITERATOR =>
  /* # undef SIGC_HAVE_SUN_REVERSE_ITERATOR */
Do we still support compilers that don't accept a standard reverse iterator?

SIGC_CXX_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD =>
  # define SIGC_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD 1
Does the compiler accept
  thing_.template operator()<T2>(1, 2);
Bjarne Stroustrup, "The C++ Programming Language", 4th ed., section 26.3.1 says
that this is correct. The template keyword is required here.

SIGC_CXX_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD =>
  # define SIGC_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD 1
Does the compiler accept
  thing_.operator()<T2>(1, 2);
Syntax error, according to Stroustrup. But gcc 5.2.1 accepts it. And at least
old versions of MSVC probably accepted only this syntax. Don't know if
MSVC 2013 and later accept the correct syntax.

SIGC_CXX_SELF_REFERENCE_IN_MEMBER_INITIALIZATION =>
  # define SIGC_SELF_REFERENCE_IN_MEMBER_INITIALIZATION 1
Does the compiler accept
  struct test
  {
    static char test_function();
    static const bool test_value = (sizeof(test_function()) == sizeof(char));
  };
Not used by libsigc++ now. It was used in the removed sigc::is_base_and_derived
struct.
There is similar code in sigc::can_deduce_result_type_with_decltype and
Glib::RefPtr::is_allowed_type. Both libsigc++ and glibmm require a compiler that
accepts such initializations.

SIGC_CXX_PRAGMA_PUSH_POP_MACRO =>
  # define SIGC_PRAGMA_PUSH_POP_MACRO 1
New, not obsolete. Keep it until the next ABI break. See bug 695235.


If we decide that some config tests can be removed, can we also remove the
corresponding preprocessor constants in sigc++config.h.in?

Glibmm contains similar config tests.
Comment 1 Murray Cumming 2016-03-03 11:51:15 UTC
I have removed SIGC_CXX_SELF_REFERENCE_IN_MEMBER_INITIALIZATION:
https://git.gnome.org/browse/libsigc++2/commit/?id=473903c7aaad54d07d3c2d33166fd07af2f3efac

and SIGC_CXX_HAS_NAMESPACE_STD because I agree that was for awfully old compilers:
https://git.gnome.org/browse/libsigc++2/commit/?id=801bb2c67845538e1b80669681b1eb1c4a6994a7

I would prefer not to remove the other checks for now. They were necessary a few years ago, and we don't know for sure that newer versions of those compilers don't have this problem. Also, there is no good reason to stop libsigc++ building with those older compilers.

However, I have remove all these checks and workarounds from libsigc++-3.0, currently in the variadic_bind4 branch. That might let us discover if there are any compilers good enough to support the C++14 features that still haven't fixed these bugs.
Comment 2 Kjell Ahlstedt 2016-03-03 14:25:35 UTC
Fine, except for one line.
When you removed SIGC_CXX_HAS_NAMESPACE_STD(), you removed these lines from
build/cxx_std.m4:

  #ifdef SIGC_HAVE_NAMESPACE_STD
  using namespace std;
  #endif

But SIGC_HAVE_NAMESPACE_STD has been defined. The middle line should have
been kept, shouldn't it?
Comment 3 Murray Cumming 2016-03-03 17:25:39 UTC
Thanks. This should fix that, though we'd need to run it on bad compiler to be sure:
https://git.gnome.org/browse/libsigc++2/commit/?id=c4d9b98c65f9fe0d05e7367d876e361484f56d4f
Comment 4 Kjell Ahlstedt 2016-03-10 18:15:17 UTC
Fixed.
The purpose of this bug report was to discuss which configure-time checks could
be removed. Some have been removed in libsigc++-2.0, and all in libsigc++-3.0.