Qt patches (#147)

* Configure support for Green Hills compiler

Trust the GHS toolchain's floating-point libraries to handle double
conversions properly.

* Suppress MSVC warning C4244 in string-to-double.cc

MSVC 2015 and later warn:
C4244: 'argument': conversion from 'const uc16' to 'char', possible loss of data
in various character-handling templates, e.g. Advance.

* Limit MSVC-specific #proagma use to versions up to 2012

The optimisation-control on IsDecimalDigitForRadix(), to avoid a
warning, broke clang-cl builds (unknown #pragma); so refine the #if
condition to only apply it for versions up to MSVC2012, the one
documented to need it.

Mention the significance of suppressing optimisation in the comment
explaining it.  Also fix the grammar of the last sentence.  (The "By
moving it ..."  prefix on a sentence with "the compiler" as subject
tacitly claimed the compiler was doing the moving.)

* Suppress unused parameter warnings from compilers

Avoids breaking Qt's build, which uses -Werror=unused-parameter

Co-authored-by: Rolland Dudemaine <rolland@dudemaine.org>
Co-authored-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Co-authored-by: Andrei Golubev <andpgolubev@gmail.com>
3 files changed
tree: b34b3e68df83c028cb7fd457edfe78ec6c1ea38c
  1. cmake/
  2. double-conversion/
  3. msvc/
  4. test/
  5. .gitignore
  7. BUILD
  8. Changelog
  9. CMakeLists.txt
  12. Makefile
  13. README.md
  14. SConstruct


This project (double-conversion) provides binary-decimal and decimal-binary routines for IEEE doubles.

The library consists of efficient conversion routines that have been extracted from the V8 JavaScript engine. The code has been refactored and improved so that it can be used more easily in other projects.

There is extensive documentation in double-conversion/string-to-double.h and double-conversion/double-to-string.h. Other examples can be found in test/cctest/test-conversions.cc.


This library can be built with scons or cmake. The checked-in Makefile simply forwards to scons, and provides a shortcut to run all tests:

make test


The easiest way to install this library is to use scons. It builds the static and shared library, and is set up to install those at the correct locations:

scons install

Use the DESTDIR option to change the target directory:

scons DESTDIR=alternative_directory install


To use cmake run cmake . in the root directory. This overwrites the existing Makefile.

Use -DBUILD_SHARED_LIBS=ON to enable the compilation of shared libraries. Note that this disables static libraries. There is currently no way to build both libraries at the same time with cmake.

Use -DBUILD_TESTING=ON to build the test executable.

test/cctest/cctest --list | tr -d '<' | xargs test/cctest/cctest