From 31ab8f5c6d430148ba57e96074ae60a6af693324 Mon Sep 17 00:00:00 2001 From: Loris Ercole Date: Mon, 27 Apr 2026 14:46:52 +0200 Subject: [PATCH 1/5] Fix MSVC C1061 'blocks nested too deeply' in womersley.hpp MSVC has a hard limit of ~128 nesting levels for if-else chains. The Womersley quadrature traits had two functions exceeding this: - generate(): ~125-branch if-else dispatch. Split into two halves by extracting npts >= 2049 into a generate_large_npts_() helper, keeping each half under 64 branches. - next_algebraic_order(): ~125-branch if-else that simply returned the input clamped to [1, 125]. Replaced with a 3-line equivalent. --- .../integratorxx/quadratures/s2/womersley.hpp | 521 +++++------------- 1 file changed, 144 insertions(+), 377 deletions(-) diff --git a/include/integratorxx/quadratures/s2/womersley.hpp b/include/integratorxx/quadratures/s2/womersley.hpp index d4d9a0f..6394f9d 100644 --- a/include/integratorxx/quadratures/s2/womersley.hpp +++ b/include/integratorxx/quadratures/s2/womersley.hpp @@ -51,6 +51,141 @@ struct quadrature_traits> { using point_container = std::vector; using weight_container = std::vector; + // Helper: dispatch for large npts values (>= 2049). + // Split out from generate() to avoid MSVC C1061 "blocks nested too deeply" + // (MSVC has a hard limit of ~128 nesting levels for if-else chains). + inline static void generate_large_npts_( + size_t npts, point_container& points, weight_container& weights) { + using namespace WomersleyGrids; + + if(npts == 2049) + detail::copy_grid>(points, weights); + else if(npts == 2114) + detail::copy_grid>(points, weights); + else if(npts == 2179) + detail::copy_grid>(points, weights); + else if(npts == 2246) + detail::copy_grid>(points, weights); + else if(npts == 2313) + detail::copy_grid>(points, weights); + else if(npts == 2382) + detail::copy_grid>(points, weights); + else if(npts == 2451) + detail::copy_grid>(points, weights); + else if(npts == 2522) + detail::copy_grid>(points, weights); + else if(npts == 2593) + detail::copy_grid>(points, weights); + else if(npts == 2666) + detail::copy_grid>(points, weights); + else if(npts == 2739) + detail::copy_grid>(points, weights); + else if(npts == 2814) + detail::copy_grid>(points, weights); + else if(npts == 2889) + detail::copy_grid>(points, weights); + else if(npts == 2966) + detail::copy_grid>(points, weights); + else if(npts == 3043) + detail::copy_grid>(points, weights); + else if(npts == 3122) + detail::copy_grid>(points, weights); + else if(npts == 3201) + detail::copy_grid>(points, weights); + else if(npts == 3282) + detail::copy_grid>(points, weights); + else if(npts == 3363) + detail::copy_grid>(points, weights); + else if(npts == 3446) + detail::copy_grid>(points, weights); + else if(npts == 3529) + detail::copy_grid>(points, weights); + else if(npts == 3614) + detail::copy_grid>(points, weights); + else if(npts == 3699) + detail::copy_grid>(points, weights); + else if(npts == 3786) + detail::copy_grid>(points, weights); + else if(npts == 3873) + detail::copy_grid>(points, weights); + else if(npts == 3962) + detail::copy_grid>(points, weights); + else if(npts == 4051) + detail::copy_grid>(points, weights); + else if(npts == 4142) + detail::copy_grid>(points, weights); + else if(npts == 4233) + detail::copy_grid>(points, weights); + else if(npts == 4326) + detail::copy_grid>(points, weights); + else if(npts == 4419) + detail::copy_grid>(points, weights); + else if(npts == 4514) + detail::copy_grid>(points, weights); + else if(npts == 4609) + detail::copy_grid>(points, weights); + else if(npts == 4706) + detail::copy_grid>(points, weights); + else if(npts == 4803) + detail::copy_grid>(points, weights); + else if(npts == 4902) + detail::copy_grid>(points, weights); + else if(npts == 5001) + detail::copy_grid>(points, weights); + else if(npts == 5102) + detail::copy_grid>(points, weights); + else if(npts == 5203) + detail::copy_grid>(points, weights); + else if(npts == 5306) + detail::copy_grid>(points, weights); + else if(npts == 5409) + detail::copy_grid>(points, weights); + else if(npts == 5514) + detail::copy_grid>(points, weights); + else if(npts == 5619) + detail::copy_grid>(points, weights); + else if(npts == 5726) + detail::copy_grid>(points, weights); + else if(npts == 5833) + detail::copy_grid>(points, weights); + else if(npts == 5942) + detail::copy_grid>(points, weights); + else if(npts == 6051) + detail::copy_grid>(points, weights); + else if(npts == 6162) + detail::copy_grid>(points, weights); + else if(npts == 6273) + detail::copy_grid>(points, weights); + else if(npts == 6386) + detail::copy_grid>(points, weights); + else if(npts == 6499) + detail::copy_grid>(points, weights); + else if(npts == 6614) + detail::copy_grid>(points, weights); + else if(npts == 6729) + detail::copy_grid>(points, weights); + else if(npts == 6846) + detail::copy_grid>(points, weights); + else if(npts == 6963) + detail::copy_grid>(points, weights); + else if(npts == 7082) + detail::copy_grid>(points, weights); + else if(npts == 7201) + detail::copy_grid>(points, weights); + else if(npts == 7322) + detail::copy_grid>(points, weights); + else if(npts == 7443) + detail::copy_grid>(points, weights); + else if(npts == 7566) + detail::copy_grid>(points, weights); + else if(npts == 7689) + detail::copy_grid>(points, weights); + else if(npts == 7814) + detail::copy_grid>(points, weights); + else if(npts == 7939) + detail::copy_grid>(points, weights); + } + inline static std::tuple generate( size_t npts) { point_container points(npts); @@ -58,7 +193,9 @@ struct quadrature_traits> { using namespace WomersleyGrids; - if(npts == 3) + if(npts >= 2049) + generate_large_npts_(npts, points, weights); + else if(npts == 3) detail::copy_grid>(points, weights); else if(npts == 6) detail::copy_grid>(points, weights); @@ -182,132 +319,6 @@ struct quadrature_traits> { detail::copy_grid>(points, weights); else if(npts == 1986) detail::copy_grid>(points, weights); - else if(npts == 2049) - detail::copy_grid>(points, weights); - else if(npts == 2114) - detail::copy_grid>(points, weights); - else if(npts == 2179) - detail::copy_grid>(points, weights); - else if(npts == 2246) - detail::copy_grid>(points, weights); - else if(npts == 2313) - detail::copy_grid>(points, weights); - else if(npts == 2382) - detail::copy_grid>(points, weights); - else if(npts == 2451) - detail::copy_grid>(points, weights); - else if(npts == 2522) - detail::copy_grid>(points, weights); - else if(npts == 2593) - detail::copy_grid>(points, weights); - else if(npts == 2666) - detail::copy_grid>(points, weights); - else if(npts == 2739) - detail::copy_grid>(points, weights); - else if(npts == 2814) - detail::copy_grid>(points, weights); - else if(npts == 2889) - detail::copy_grid>(points, weights); - else if(npts == 2966) - detail::copy_grid>(points, weights); - else if(npts == 3043) - detail::copy_grid>(points, weights); - else if(npts == 3122) - detail::copy_grid>(points, weights); - else if(npts == 3201) - detail::copy_grid>(points, weights); - else if(npts == 3282) - detail::copy_grid>(points, weights); - else if(npts == 3363) - detail::copy_grid>(points, weights); - else if(npts == 3446) - detail::copy_grid>(points, weights); - else if(npts == 3529) - detail::copy_grid>(points, weights); - else if(npts == 3614) - detail::copy_grid>(points, weights); - else if(npts == 3699) - detail::copy_grid>(points, weights); - else if(npts == 3786) - detail::copy_grid>(points, weights); - else if(npts == 3873) - detail::copy_grid>(points, weights); - else if(npts == 3962) - detail::copy_grid>(points, weights); - else if(npts == 4051) - detail::copy_grid>(points, weights); - else if(npts == 4142) - detail::copy_grid>(points, weights); - else if(npts == 4233) - detail::copy_grid>(points, weights); - else if(npts == 4326) - detail::copy_grid>(points, weights); - else if(npts == 4419) - detail::copy_grid>(points, weights); - else if(npts == 4514) - detail::copy_grid>(points, weights); - else if(npts == 4609) - detail::copy_grid>(points, weights); - else if(npts == 4706) - detail::copy_grid>(points, weights); - else if(npts == 4803) - detail::copy_grid>(points, weights); - else if(npts == 4902) - detail::copy_grid>(points, weights); - else if(npts == 5001) - detail::copy_grid>(points, weights); - else if(npts == 5102) - detail::copy_grid>(points, weights); - else if(npts == 5203) - detail::copy_grid>(points, weights); - else if(npts == 5306) - detail::copy_grid>(points, weights); - else if(npts == 5409) - detail::copy_grid>(points, weights); - else if(npts == 5514) - detail::copy_grid>(points, weights); - else if(npts == 5619) - detail::copy_grid>(points, weights); - else if(npts == 5726) - detail::copy_grid>(points, weights); - else if(npts == 5833) - detail::copy_grid>(points, weights); - else if(npts == 5942) - detail::copy_grid>(points, weights); - else if(npts == 6051) - detail::copy_grid>(points, weights); - else if(npts == 6162) - detail::copy_grid>(points, weights); - else if(npts == 6273) - detail::copy_grid>(points, weights); - else if(npts == 6386) - detail::copy_grid>(points, weights); - else if(npts == 6499) - detail::copy_grid>(points, weights); - else if(npts == 6614) - detail::copy_grid>(points, weights); - else if(npts == 6729) - detail::copy_grid>(points, weights); - else if(npts == 6846) - detail::copy_grid>(points, weights); - else if(npts == 6963) - detail::copy_grid>(points, weights); - else if(npts == 7082) - detail::copy_grid>(points, weights); - else if(npts == 7201) - detail::copy_grid>(points, weights); - else if(npts == 7322) - detail::copy_grid>(points, weights); - else if(npts == 7443) - detail::copy_grid>(points, weights); - else if(npts == 7566) - detail::copy_grid>(points, weights); - else if(npts == 7689) - detail::copy_grid>(points, weights); - else if(npts == 7814) - detail::copy_grid>(points, weights); - else if(npts == 7939) - detail::copy_grid>(points, weights); return std::make_tuple(points, weights); } @@ -826,256 +837,12 @@ inline static int64_t algebraic_order_by_npts(int64_t npts) { } inline static int64_t next_algebraic_order(int64_t order) { - if(order <= 1) - return 1; - else if(order <= 2) - return 2; - else if(order <= 3) - return 3; - else if(order <= 4) - return 4; - else if(order <= 5) - return 5; - else if(order <= 6) - return 6; - else if(order <= 7) - return 7; - else if(order <= 8) - return 8; - else if(order <= 9) - return 9; - else if(order <= 10) - return 10; - else if(order <= 11) - return 11; - else if(order <= 12) - return 12; - else if(order <= 13) - return 13; - else if(order <= 14) - return 14; - else if(order <= 15) - return 15; - else if(order <= 16) - return 16; - else if(order <= 17) - return 17; - else if(order <= 18) - return 18; - else if(order <= 19) - return 19; - else if(order <= 20) - return 20; - else if(order <= 21) - return 21; - else if(order <= 22) - return 22; - else if(order <= 23) - return 23; - else if(order <= 24) - return 24; - else if(order <= 25) - return 25; - else if(order <= 26) - return 26; - else if(order <= 27) - return 27; - else if(order <= 28) - return 28; - else if(order <= 29) - return 29; - else if(order <= 30) - return 30; - else if(order <= 31) - return 31; - else if(order <= 32) - return 32; - else if(order <= 33) - return 33; - else if(order <= 34) - return 34; - else if(order <= 35) - return 35; - else if(order <= 36) - return 36; - else if(order <= 37) - return 37; - else if(order <= 38) - return 38; - else if(order <= 39) - return 39; - else if(order <= 40) - return 40; - else if(order <= 41) - return 41; - else if(order <= 42) - return 42; - else if(order <= 43) - return 43; - else if(order <= 44) - return 44; - else if(order <= 45) - return 45; - else if(order <= 46) - return 46; - else if(order <= 47) - return 47; - else if(order <= 48) - return 48; - else if(order <= 49) - return 49; - else if(order <= 50) - return 50; - else if(order <= 51) - return 51; - else if(order <= 52) - return 52; - else if(order <= 53) - return 53; - else if(order <= 54) - return 54; - else if(order <= 55) - return 55; - else if(order <= 56) - return 56; - else if(order <= 57) - return 57; - else if(order <= 58) - return 58; - else if(order <= 59) - return 59; - else if(order <= 60) - return 60; - else if(order <= 61) - return 61; - else if(order <= 62) - return 62; - else if(order <= 63) - return 63; - else if(order <= 64) - return 64; - else if(order <= 65) - return 65; - else if(order <= 66) - return 66; - else if(order <= 67) - return 67; - else if(order <= 68) - return 68; - else if(order <= 69) - return 69; - else if(order <= 70) - return 70; - else if(order <= 71) - return 71; - else if(order <= 72) - return 72; - else if(order <= 73) - return 73; - else if(order <= 74) - return 74; - else if(order <= 75) - return 75; - else if(order <= 76) - return 76; - else if(order <= 77) - return 77; - else if(order <= 78) - return 78; - else if(order <= 79) - return 79; - else if(order <= 80) - return 80; - else if(order <= 81) - return 81; - else if(order <= 82) - return 82; - else if(order <= 83) - return 83; - else if(order <= 84) - return 84; - else if(order <= 85) - return 85; - else if(order <= 86) - return 86; - else if(order <= 87) - return 87; - else if(order <= 88) - return 88; - else if(order <= 89) - return 89; - else if(order <= 90) - return 90; - else if(order <= 91) - return 91; - else if(order <= 92) - return 92; - else if(order <= 93) - return 93; - else if(order <= 94) - return 94; - else if(order <= 95) - return 95; - else if(order <= 96) - return 96; - else if(order <= 97) - return 97; - else if(order <= 98) - return 98; - else if(order <= 99) - return 99; - else if(order <= 100) - return 100; - else if(order <= 101) - return 101; - else if(order <= 102) - return 102; - else if(order <= 103) - return 103; - else if(order <= 104) - return 104; - else if(order <= 105) - return 105; - else if(order <= 106) - return 106; - else if(order <= 107) - return 107; - else if(order <= 108) - return 108; - else if(order <= 109) - return 109; - else if(order <= 110) - return 110; - else if(order <= 111) - return 111; - else if(order <= 112) - return 112; - else if(order <= 113) - return 113; - else if(order <= 114) - return 114; - else if(order <= 115) - return 115; - else if(order <= 116) - return 116; - else if(order <= 117) - return 117; - else if(order <= 118) - return 118; - else if(order <= 119) - return 119; - else if(order <= 120) - return 120; - else if(order <= 121) - return 121; - else if(order <= 122) - return 122; - else if(order <= 123) - return 123; - else if(order <= 124) - return 124; - else - return 125; + // Clamp to the supported range [1, 125]. + // (The original if-else chain returned order for 1 <= order <= 124, else 125. + // Replaced to avoid MSVC C1061 "blocks nested too deeply" with ~125 branches.) + if(order < 1) return 1; + if(order > 125) return 125; + return order; } }; namespace detail { From 161b1ccf31deae83e8a0a12af1e6c108796c026f Mon Sep 17 00:00:00 2001 From: Loris Ercole Date: Mon, 27 Apr 2026 14:54:26 +0200 Subject: [PATCH 2/5] Fix MSVC native cl.exe build compatibility MSVC does not support C++ alternative operator tokens (and, or, not) without /permissive-. Replace with standard &&, ||, ! across all headers (11 files). Also add MSVC-specific flags to CMakeLists.txt: - _USE_MATH_DEFINES: needed for M_PI in MSVC CRT - /bigobj: test TUs exceed default COFF section limit --- CMakeLists.txt | 6 ++++++ include/integratorxx/batch/spherical_micro_batcher.hpp | 10 +++++----- .../pruned_spherical_quadrature.hpp | 4 ++-- include/integratorxx/generators/spherical_factory.hpp | 8 ++++---- include/integratorxx/quadrature.hpp | 2 +- .../quadratures/primitive/gausslegendre.hpp | 2 +- .../quadratures/primitive/gausslobatto.hpp | 2 +- include/integratorxx/quadratures/radial/becke.hpp | 2 +- include/integratorxx/quadratures/radial/mhl.hpp | 2 +- .../integratorxx/quadratures/radial/muraknowles.hpp | 4 ++-- .../quadratures/radial/treutlerahlrichs.hpp | 2 +- include/integratorxx/util/bound_transform.hpp | 6 +++--- 12 files changed, 28 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c56855e..d1587b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,12 @@ if( INTEGRATORXX_HAS_NO_MISSING_BRACES ) target_compile_options( integratorxx INTERFACE $<$: -Wno-missing-braces> ) endif() +# MSVC: define _USE_MATH_DEFINES for M_PI etc., and /bigobj for large TUs +if(MSVC) + target_compile_definitions( integratorxx ${INTEGRATORXX_TARGET_TYPE} _USE_MATH_DEFINES ) + target_compile_options( integratorxx ${INTEGRATORXX_TARGET_TYPE} /bigobj ) +endif() + diff --git a/include/integratorxx/batch/spherical_micro_batcher.hpp b/include/integratorxx/batch/spherical_micro_batcher.hpp index e0f3214..759fd70 100644 --- a/include/integratorxx/batch/spherical_micro_batcher.hpp +++ b/include/integratorxx/batch/spherical_micro_batcher.hpp @@ -20,9 +20,9 @@ bool point_in_box( const cartesian_pt_t& pt ) { - if( pt[0] > up[0] or pt[0] < lo[0] ) return false; - else if( pt[1] > up[1] or pt[1] < lo[1] ) return false; - else if( pt[2] > up[2] or pt[2] < lo[2] ) return false; + if( pt[0] > up[0] || pt[0] < lo[0] ) return false; + else if( pt[1] > up[1] || pt[1] < lo[1] ) return false; + else if( pt[2] > up[2] || pt[2] < lo[2] ) return false; else return true; } @@ -281,7 +281,7 @@ class SphericalMicroBatcher { } bool operator==( iterator other ){ return idx_it == other.idx_it; } - bool operator!=( iterator other ){ return not (*this == other); } + bool operator!=( iterator other ){ return !(*this == other); } @@ -352,7 +352,7 @@ class SphericalMicroBatcher { } bool operator==( iterator other ){ return idx_it == other.idx_it; } - bool operator!=( iterator other ){ return not (*this == other); } + bool operator!=( iterator other ){ return !(*this == other); } diff --git a/include/integratorxx/composite_quadratures/pruned_spherical_quadrature.hpp b/include/integratorxx/composite_quadratures/pruned_spherical_quadrature.hpp index cb460b0..d90305f 100644 --- a/include/integratorxx/composite_quadratures/pruned_spherical_quadrature.hpp +++ b/include/integratorxx/composite_quadratures/pruned_spherical_quadrature.hpp @@ -110,9 +110,9 @@ class RadialGridPartition { } bool operator==(rgp_iterator other) const { - return idx_it == other.idx_it and quad_it == other.quad_it; + return idx_it == other.idx_it && quad_it == other.quad_it; } - bool operator!=(rgp_iterator other) const { return not (*this == other); } + bool operator!=(rgp_iterator other) const { return !(*this == other); } value_type operator*() { return std::make_pair( std::make_pair(*idx_it, *(idx_it+1)), *quad_it ); diff --git a/include/integratorxx/generators/spherical_factory.hpp b/include/integratorxx/generators/spherical_factory.hpp index 43e2844..701cacc 100644 --- a/include/integratorxx/generators/spherical_factory.hpp +++ b/include/integratorxx/generators/spherical_factory.hpp @@ -51,8 +51,8 @@ struct PruningRegion { /// Check equality of `PruningRegion` instances inline bool operator==(const PruningRegion& other) const noexcept { - return other.idx_st == idx_st and - other.idx_en == idx_en and + return other.idx_st == idx_st && + other.idx_en == idx_en && other.angular_size == angular_size; } }; @@ -85,8 +85,8 @@ struct PrunedSphericalGridSpecification { } inline bool operator==(const PrunedSphericalGridSpecification& other) const noexcept { - return radial_quad == other.radial_quad and - (radial_traits ? (other.radial_traits and radial_traits->compare(*other.radial_traits)) : !other.radial_traits) and + return radial_quad == other.radial_quad && + (radial_traits ? (other.radial_traits && radial_traits->compare(*other.radial_traits)) : !other.radial_traits) && pruning_regions == other.pruning_regions; } }; diff --git a/include/integratorxx/quadrature.hpp b/include/integratorxx/quadrature.hpp index 4903ee8..151992f 100644 --- a/include/integratorxx/quadrature.hpp +++ b/include/integratorxx/quadrature.hpp @@ -222,7 +222,7 @@ class Quadrature : public template , std::decay_t... >::value and + detail::all_are_not< Quadrature, std::decay_t... >::value && detail::all_are_not< Derived , std::decay_t... >::value > > diff --git a/include/integratorxx/quadratures/primitive/gausslegendre.hpp b/include/integratorxx/quadratures/primitive/gausslegendre.hpp index fb62050..d8fef17 100644 --- a/include/integratorxx/quadratures/primitive/gausslegendre.hpp +++ b/include/integratorxx/quadratures/primitive/gausslegendre.hpp @@ -80,7 +80,7 @@ struct quadrature_traits< } } // end while - if(not converged) { + if(!converged) { throw std::runtime_error( "Gauss-Legendre Newton Iterations Failed to Converge" ); diff --git a/include/integratorxx/quadratures/primitive/gausslobatto.hpp b/include/integratorxx/quadratures/primitive/gausslobatto.hpp index 2de2629..1d5d9eb 100644 --- a/include/integratorxx/quadratures/primitive/gausslobatto.hpp +++ b/include/integratorxx/quadratures/primitive/gausslobatto.hpp @@ -76,7 +76,7 @@ struct quadrature_traits> { } } // end while - if(not converged) { + if(!converged) { throw std::runtime_error( "Gauss-Lobatto Newton Iterations Failed to Converge"); } diff --git a/include/integratorxx/quadratures/radial/becke.hpp b/include/integratorxx/quadratures/radial/becke.hpp index 98fb2f9..68a88ad 100644 --- a/include/integratorxx/quadratures/radial/becke.hpp +++ b/include/integratorxx/quadratures/radial/becke.hpp @@ -40,7 +40,7 @@ class BeckeRadialTraits : public RadialTraits { } bool operator==(const BeckeRadialTraits& other) const noexcept { - return npts_ == other.npts_ and R_ == other.R_; + return npts_ == other.npts_ && R_ == other.R_; } /** diff --git a/include/integratorxx/quadratures/radial/mhl.hpp b/include/integratorxx/quadratures/radial/mhl.hpp index 7065ff1..23eb6b6 100644 --- a/include/integratorxx/quadratures/radial/mhl.hpp +++ b/include/integratorxx/quadratures/radial/mhl.hpp @@ -39,7 +39,7 @@ class MurrayHandyLamingRadialTraits : public RadialTraits { } bool operator==(const MurrayHandyLamingRadialTraits& other) const noexcept { - return npts_ == other.npts_ and R_ == other.R_; + return npts_ == other.npts_ && R_ == other.R_; } /** diff --git a/include/integratorxx/quadratures/radial/muraknowles.hpp b/include/integratorxx/quadratures/radial/muraknowles.hpp index 9d242e4..883ccb2 100644 --- a/include/integratorxx/quadratures/radial/muraknowles.hpp +++ b/include/integratorxx/quadratures/radial/muraknowles.hpp @@ -64,7 +64,7 @@ template struct quadrature_traits< MuraKnowles, std::enable_if_t< - std::is_floating_point_v and + std::is_floating_point_v && std::is_floating_point_v > > { @@ -157,7 +157,7 @@ class MuraKnowlesRadialTraits : public RadialTraits { } bool operator==(const MuraKnowlesRadialTraits& other) const noexcept { - return npts_ == other.npts_ and R_ == other.R_; + return npts_ == other.npts_ && R_ == other.R_; } template diff --git a/include/integratorxx/quadratures/radial/treutlerahlrichs.hpp b/include/integratorxx/quadratures/radial/treutlerahlrichs.hpp index c22dab0..43e141d 100644 --- a/include/integratorxx/quadratures/radial/treutlerahlrichs.hpp +++ b/include/integratorxx/quadratures/radial/treutlerahlrichs.hpp @@ -50,7 +50,7 @@ class TreutlerAhlrichsRadialTraits : public RadialTraits { } bool operator==(const TreutlerAhlrichsRadialTraits& other) const noexcept { - return npts_ == other.npts_ and R_ == other.R_ and alpha_ == other.alpha_; + return npts_ == other.npts_ && R_ == other.R_ && alpha_ == other.alpha_; } /** diff --git a/include/integratorxx/util/bound_transform.hpp b/include/integratorxx/util/bound_transform.hpp index 6b28132..dcf4ecd 100644 --- a/include/integratorxx/util/bound_transform.hpp +++ b/include/integratorxx/util/bound_transform.hpp @@ -17,7 +17,7 @@ constexpr inline auto transform_minus_one_to_one( // Both upper and lower bounds are finite: Map (-1,1) -> (lo,up) - if( not up_is_inf and not lo_is_minf ) { + if( !up_is_inf && !lo_is_minf ) { // Factor jacobian into the weights // dx' = ((b-a)/2) * dx @@ -28,7 +28,7 @@ constexpr inline auto transform_minus_one_to_one( pt = (up - lo) * pt / 2. + (up + lo) / 2.; // Lower bound is finite, upper is infinite: Map (-1,1) -> (lo,inf) - } else if( not lo_is_minf ) { + } else if( !lo_is_minf ) { // Factor jacobian into the weights // dx' = \frac{2}{(1-x)^2} dx @@ -39,7 +39,7 @@ constexpr inline auto transform_minus_one_to_one( pt = lo + (1 + pt) / (1 - pt); // Upper bound is finite, low is infinite: Map (-1,1) -> (inf,up) - } else if( not up_is_inf ) { + } else if( !up_is_inf ) { // Factor jacobian into the weights // dx' = - \frac{2}{(1+x)^2} dx From 60e45e74b4a8939a4b0fb9ca3e9e2a7304f9356f Mon Sep 17 00:00:00 2001 From: Loris Ercole Date: Tue, 5 May 2026 10:53:54 +0200 Subject: [PATCH 3/5] silence noisy warnings --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1587b4..de0f04b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,12 @@ endif() if(MSVC) target_compile_definitions( integratorxx ${INTEGRATORXX_TARGET_TYPE} _USE_MATH_DEFINES ) target_compile_options( integratorxx ${INTEGRATORXX_TARGET_TYPE} /bigobj ) + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options( integratorxx ${INTEGRATORXX_TARGET_TYPE} + -Wno-unused-but-set-variable + -Wno-suggest-override + ) + endif() endif() From bbcd89f3272235feff4650ae83e8cc4d44bdc7fc Mon Sep 17 00:00:00 2001 From: Loris Ercole Date: Wed, 6 May 2026 11:58:09 +0200 Subject: [PATCH 4/5] Fix -Wno-missing-braces not applying to compiled library sources The flag was hardcoded as INTERFACE, which only propagates to consumers. When IntegratorXX builds as a compiled library (INTEGRATORXX_HEADER_ONLY=OFF), its own sources never received the suppression. Use INTEGRATORXX_TARGET_TYPE (PUBLIC or INTERFACE) so it matches the other target_compile_options calls. GCC hides this because it removed -Wmissing-braces from -Wall in GCC 4.8; Clang still enables it, causing thousands of warnings on clang-cl builds. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index de0f04b..f304914 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ target_include_directories( integratorxx include(CheckCXXCompilerFlag) check_cxx_compiler_flag("-Wno-missing-braces" INTEGRATORXX_HAS_NO_MISSING_BRACES ) if( INTEGRATORXX_HAS_NO_MISSING_BRACES ) - target_compile_options( integratorxx INTERFACE $<$: -Wno-missing-braces> ) + target_compile_options( integratorxx ${INTEGRATORXX_TARGET_TYPE} $<$: -Wno-missing-braces> ) endif() # MSVC: define _USE_MATH_DEFINES for M_PI etc., and /bigobj for large TUs From 58012a0b32c45f5b403380fab594047dd4587f55 Mon Sep 17 00:00:00 2001 From: Loris Ercole Date: Wed, 6 May 2026 12:35:01 +0200 Subject: [PATCH 5/5] Add missing numeric header for composite quadratures tests --- test/composite_quadratures.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/test/composite_quadratures.cxx b/test/composite_quadratures.cxx index d1d14f0..435cd8a 100644 --- a/test/composite_quadratures.cxx +++ b/test/composite_quadratures.cxx @@ -5,6 +5,7 @@ #include #include #include +#include //#include //#include