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

[Bug] i386 (32-bit) fails to compile #308

Open
werdahias opened this issue Jan 20, 2023 · 0 comments · May be fixed by #322
Open

[Bug] i386 (32-bit) fails to compile #308

werdahias opened this issue Jan 20, 2023 · 0 comments · May be fixed by #322

Comments

@werdahias
Copy link

Please include the following information in your issue:

  1. Which version of units you are using 2.3.3
  2. Which compiler exhibited the problem (including compiler version) gcc-12 i386 12.2.0-14

Building 2.3.3 with gcc-12 (32-bit) fails to compile:


/builds/werdahias/units/debian/output/source_dir/include/units.h:2161:179:   in 'constexpr' expansion of 'units::convert<unit<std::ratio<60>, unit<std::ratio<60>, unit<std::ratio<1>, base_unit<std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<1> > > > >, unit<std::ratio<1, 1000000000>, base_unit<std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<1> > >, double>(((const units::unit_t<units::unit<std::ratio<60>, units::unit<std::ratio<60>, units::unit<std::ratio<1>, units::base_unit<std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<1> > > > > >*)this)->units::unit_t<units::unit<std::ratio<60>, units::unit<std::ratio<60>, units::unit<std::ratio<1>, units::base_unit<std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<1> > > > > >::<anonymous>.units::linear_scale<double>::operator()())'
/builds/werdahias/units/debian/output/source_dir/include/units.h:1571:72: error: narrowing conversion of '3600000000000' from 'intmax_t' {aka 'long long int'} to 'unsigned int' [-Wnarrowing]
/builds/werdahias/units/debian/output/source_dir/include/units.h: In instantiation of 'constexpr T units::detail::convert(const T&, std::false_type, std::false_type, std::false_type) [with Ratio = std::ratio<21071715921, 2441406250000>; PiRatio = std::ratio<0, 1>; Translation = std::ratio<0, 1>; T = double; std::false_type = std::integral_constant<bool, false>]':
/builds/werdahias/units/debian/output/source_dir/include/units.h:1651:4:   required from 'constexpr T units::convert(const T&) [with UnitFrom = unit<std::ratio<21071715921, 2441406250000>, base_unit<std::ratio<4>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1> >, std::ratio<0, 1>, std::ratio<0, 1> >; UnitTo = unit<std::ratio<1>, base_unit<std::ratio<4>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1> >, std::ratio<0, 1>, std::ratio<0, 1> >; T = double]'
/builds/werdahias/units/debian/output/source_dir/include/units.h:2213:34:   required from 'std::ostream& units::operator<<(std::ostream&, const unit_t<Units, T, NonLinearScale>&) [with Units = unit<std::ratio<21071715921, 2441406250000>, base_unit<std::ratio<4>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1>, std::ratio<0, 1> >, std::ratio<0, 1>, std::ratio<0, 1> >; T = double; NonLinearScale = linear_scale; std::ostream = std::basic_ostream<char>]'
/builds/werdahias/units/debian/output/source_dir/unitTests/main.cpp:1370:69:   required from here
/builds/werdahias/units/debian/output/source_dir/include/units.h:1571:72: error: narrowing conversion of '21071715921' from 'intmax_t' {aka 'long long int'} to 'unsigned int' [-Wnarrowing]
/builds/werdahias/units/debian/output/source_dir/include/units.h:1571:72: error: narrowing conversion of '2441406250000' from 'intmax_t' {aka 'long long int'} to 'unsigned int' [-Wnarrowing]
Elapsed time: 10 s. (time), 0.001163 s. (clock)
make[3]: *** [unitTests/CMakeFiles/unitLibTest.dir/build.make:79: unitTests/CMakeFiles/unitLibTest.dir/main.cpp.o] Error 1

Full log:
error.txt

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

Successfully merging a pull request may close this issue.

1 participant