Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate C++03 in Boost 1.73 as preparation for C+14 switch #689

Merged
merged 1 commit into from
Mar 28, 2020

Conversation

mloskot
Copy link
Member

@mloskot mloskot commented Mar 27, 2020

Following discussion in #590, we are identifying support for C++03
as a candidate for removal from future releases of Boost.Geometry.

Issue deprecation warning during compilation in C++03 conformance mode
Users can define BOOST_GEOMETRY_DISABLE_DEPRECATED_03_WARNING to disable it.

Tasklist

  • Decide between switch to C++11 or to C++14 - C++14 it is
  • Decide which Boost version, 1.74 or 1.75 or later, will require the later C++ version - 1.75 it is

@mloskot mloskot changed the title Deprecate C++03 in Boost 1.73 WIP: Deprecate C++03 in Boost 1.73 Mar 27, 2020
@mloskot mloskot mentioned this pull request Mar 27, 2020
@mloskot mloskot force-pushed the ml/announce-deprecate-cxx03 branch from a2f19ff to d6bc849 Compare March 28, 2020 20:22
@mloskot mloskot added this to the 1.73 milestone Mar 28, 2020
Following discussion in boostorg#590, we are identifying support for C++03
as a candidate for removal from future releases of Boost.Geometry.

Issue deprecation warning during compilation in C++03 conformance mode
Users can define BOOST_GEOMETRY_DISABLE_DEPRECATED_03_WARNING to disable it.
@barendgehrels barendgehrels self-requested a review March 28, 2020 22:34
Copy link
Collaborator

@barendgehrels barendgehrels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@mloskot mloskot changed the title WIP: Deprecate C++03 in Boost 1.73 Deprecate C++03 in Boost 1.73 and prepare for C+14 switch Mar 28, 2020
@mloskot mloskot changed the title Deprecate C++03 in Boost 1.73 and prepare for C+14 switch Deprecate C++03 in Boost 1.73 as preparation for C+14 switch Mar 28, 2020
@mloskot mloskot self-assigned this Mar 28, 2020
@mloskot mloskot merged commit 2dbe5bf into boostorg:develop Mar 28, 2020
@mloskot mloskot deleted the ml/announce-deprecate-cxx03 branch March 28, 2020 23:20
@Mike-Devel
Copy link

Mike-Devel commented Apr 14, 2020

@mloskot : The checks don't reflect the message: You are checking for c++11 stuff, but state that c++14 will be required.

wouldnt something like #if (__cplusplus < 201402L) && (_MSVC_LANG < 201402L) be more appropriate?

@mloskot
Copy link
Member Author

mloskot commented Apr 14, 2020

@Mike-Devel Yes, you are correct. Initially, before we settled at C++14, we only needed to distinguish between C++03 and later.

Why not Boost macros? For example, BOOST_NO_CXX14_CONSTEXPR,, BOOST_NO_CXX14_DECLTYPE_AUTO, BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION

@Mike-Devel
Copy link

Why not Boost macros?

Because I didn't know them offhand ;).

On the other hand - unless you already know exactly what features you want to use - doesn't it make more sense to simply test for the c++ language version instead for individual features?

@awulkiew
Copy link
Member

I'm leaning towards using Boost.Config macros. Even checking single BOOST_NO_CXX14_CONSTEXPR would probably be enough because this is one of the features that was added last to MSVC AFAIR.

The test based on __cplusplus and _MSVC_LANG would require more care and testing to make it right for all supported compilers/preprocessors. I'd assume that some compilers could complain that _MSVC_LANG is not defined. At least on MSVC __cplusplus is meaningless so it wouldn't surprise me that there is a different compiler which doesn't define _MSVC_LANG and also meaningless __cplusplus. Not to mention that earlier versions of MSVC doesn't define _MSVC_LANG. I also don't know what will be the values with Clang on Windows which partially emulates MSVC. Etc. Etc.

On the other hand we can assume that Boost.Config works.

Furthermore, this is not the only way of informing the users about the transition. In addition to this annoying macro we will also announce on the mailing lists, in the docs, release notes, slack channels, gitter, etc.

@mloskot
Copy link
Member Author

mloskot commented Apr 14, 2020

I agree. I also prefer the Boost Config macros. Moreover, even if _MSVC_LANG is defined regardlessoof CL.EXE switches, _MSVC_LANG < 201402 is never true.

It's good to provoke comments even on seemingly trivial issues :)

mloskot added a commit to mloskot/geometry that referenced this pull request Apr 14, 2020
@mloskot
Copy link
Member Author

mloskot commented Apr 14, 2020

@awulkiew I updated #696 to check for BOOST_NO_CXX14_CONSTEXPR. That should be enough approx. for the purpose of the deprecation warning.

@Mike-Devel
Copy link

Moreover, even if _MSVC_LANG is defined regardlessoof CL.EXE switches, _MSVC_LANG < 201402 is never true.

That is true, but the point is that it directly expresses what you say you want to check for (c++14 support) and older versions of msvc that don't support c++14 don't define that macro, so the expression evaluates to true and you get the desired warning .

Again, if you know what you want from c++14, then checking for features is a good approach, but checking for seemingly arbitrary macros that you expect are (not) defined on compilers you plan to support seems backwards to me.

Not that I have any stake in this - I don't use boost geometry.

@mloskot
Copy link
Member Author

mloskot commented Apr 14, 2020

Although I understand your point, it's valid, for this particular case of deprecation warning, any missing C++14 feature will serve fine.

Once migration starts, finer feature-wise control will be needed. Then, it may also turn out that VS 2015 with incomplete C++14 support, which AFAIK does not define the the lang macro, may work fine compiling the library.

@Mike-Devel
Copy link

It is definitely defined in VS2015 Update 3 (probably not RTM).

But it really doesn't matter. Sorry for arguing about it.

@mloskot
Copy link
Member Author

mloskot commented Apr 15, 2020

@Mike-Devel You pointed out a valid issue, so the arguing is not all that pointless :)

mloskot added a commit to mloskot/geometry that referenced this pull request Apr 15, 2020
@Mike-Devel
Copy link

I meant arguing about checking __cplusplus/_MSVC_LANG vs BOOST_NO_CXX14_CONSTEXPR ;)

@mloskot
Copy link
Member Author

mloskot commented Apr 15, 2020

Yes, I know what you mean :) It still provoked some extra considerations which is good.

@Mike-Devel
Copy link

Mike-Devel commented Apr 21, 2020

@awulkiew , @mloskot, @barendgehrels

Furthermore, this is not the only way of informing the users about the transition. In addition to this annoying macro we will also announce on the mailing lists, in the docs, release notes, slack channels, gitter, etc.

Speaking of which, I don't see release notes for boost geometry (and boost math for that matter) at https://github.com/boostorg/website/blob/master/feed/history/boost_1_73_0.qbk

@mloskot
Copy link
Member Author

mloskot commented Apr 21, 2020

@Mike-Devel I've just submitted the release notes boostorg/website#499

@mloskot
Copy link
Member Author

mloskot commented Apr 21, 2020

@awulkiew I also added in 56a9f79 the deprecation notice to doc/release_notes.qbk. It may be too late to merge the develop to master though.

@awulkiew
Copy link
Member

@mloskot Master is still opened so it's not too late. I'll do it today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants