Skip to content

errors building with clang on ubuntu 24.04 #464

@gregjhogan

Description

@gregjhogan

compiling with clang fails with errors related to enum values being out of bounds

In file included from bpl-subset/bpl_subset/libs/python/src/converter/builtin_converters.cpp:6:
In file included from bpl-subset/bpl_subset/boost/python/handle.hpp:10:
In file included from bpl-subset/bpl_subset/boost/python/cast.hpp:10:
In file included from bpl-subset/bpl_subset/boost/type_traits/same_traits.hpp:13:
In file included from bpl-subset/bpl_subset/boost/type_traits/is_same.hpp:31:
In file included from bpl-subset/bpl_subset/boost/type_traits/detail/bool_trait_def.hpp:15:
In file included from bpl-subset/bpl_subset/boost/type_traits/integral_constant.hpp:11:
In file included from bpl-subset/bpl_subset/boost/mpl/integral_c.hpp:32:
bpl-subset/bpl_subset/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'udt_builtin_mixture_enum' [-Wenum-constexpr-conversion]
   73 |     typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
      |                               ^

because clang no longer allows downgrading this to a warning
https://reviews.llvm.org/D150226

which it appears was fixed in boost version 1.81
https://reviews.llvm.org/D150226#4338856

and this project seems to still be on boost version 1.52
https://github.com/inducer/bpl-subset/blob/7bf979035e33df582cadf610a6645af1f6a62661/bpl_subset/boost/version.hpp#L30

clang++ version that doesn't work

$ clang++ --version
Ubuntu clang version 18.1.3 (1ubuntu1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

g++ version that works

$ g++ --version
g++ (Ubuntu 13.2.0-23ubuntu4) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

maybe you can force using g++ if this won't be fixed soon (I am having issues when both are installed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions