[SERVER-23420] Remove use of GNU extensions in parse_number_test.cpp Created: 30/Mar/16  Updated: 12/Mar/18  Resolved: 27/Dec/16

Status: Closed
Project: Core Server
Component/s: Build, Internal Code, Packaging
Affects Version/s: 3.2.3
Fix Version/s: 3.4.14, 3.5.2

Type: Bug Priority: Minor - P4
Reporter: Marek Skalický Assignee: Mark Benvenuto
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Discovered in Fedora 24. I think it is not OS dependent.


Issue Links:
Backports
Duplicate
is duplicated by SERVER-28063 GCC 6.3 compiling issues Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.4
Steps To Reproduce:

Every build with enable c++11

Sprint: Platforms 2017-01-23
Participants:

 Description   

MongoDB in its code use hexadecimal floats. MongoDB requires c++11 support, but it enables it by -std=c++11 compiler flag.

It should be used -std=gnu++11 instead of it. Hexadecimal floats are not part of c++11 and are only in extensions. It was working but with latest version of gcc 6.0 it is failing.

See https://bugzilla.redhat.com/show_bug.cgi?id=1321986



 Comments   
Comment by Githook User [ 12/Mar/18 ]

Author:

{'email': 'mark.benvenuto@mongodb.com', 'name': 'Mark Benvenuto', 'username': 'markbenvenuto'}

Message: SERVER-23420 Remove use of GNU extensions in parse_number_test.cpp

(cherry picked from commit 86e6d8415f250e8b9806482d880e315283c6041b)
Branch: v3.4
https://github.com/mongodb/mongo/commit/29a3746e2a5d0d4489076d3860bdedadbca7fb2b

Comment by Githook User [ 27/Dec/16 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-23420 Remove use of GNU extensions in parse_number_test.cpp
Branch: master
https://github.com/mongodb/mongo/commit/86e6d8415f250e8b9806482d880e315283c6041b

Comment by Michael Hudson-Doyle [ 08/Aug/16 ]

I've just bumped into this too (building 3.2.8 on Ubuntu 16.10). I'm about to try building with -std=c++17, but maybe commenting out this line of the test is better...

Comment by Andrew Morrow (Inactive) [ 31/Mar/16 ]

Hex float is a GNU extension until C++17 and so cannot be used in portable C++11.

Comment by Marek Skalický [ 31/Mar/16 ]

You are right. Only parse_number_test.cpp is failing.

So could you please somehow fix this test? How can I update this bug (rename,...)?

Comment by Andrew Morrow (Inactive) [ 30/Mar/16 ]

If the issue is limited to parse_number_test.cpp, it is probably easier just to repair the test. If you comment out the offending part of the test in parse_number_test.cpp, does the rest of the tree build?

Comment by Marek Skalický [ 30/Mar/16 ]

My build failed in src/mongo/base/parse_number_test.cpp
(https://kojipkgs.fedoraproject.org//work/tasks/5376/13485376/build.log)

So I don't know now if it is somewhere else.

I may try to find it.

Comment by Andrew Morrow (Inactive) [ 30/Mar/16 ]

I think the bug here is actually use the use of a non-portable GNU extension. Our choice of -std=c++11 rather than -std=gnu++11 was deliberate. Can you instead identify where we use hex floats so we can correct it?

Generated at Thu Feb 08 04:03:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.