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

Break it asan #974

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/conan/profiles/osx-clang-13
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ compiler.libcxx=libc++
[options]
[build_requires]
[env]
CC=/usr/local/opt/llvm/bin/clang
CXX=/usr/local/opt/llvm/bin/clang++
CC=/usr/bin/clang
CXX=/usr/bin/clang++
CONAN_CMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_DIR/clang-libc++.cmake
58 changes: 37 additions & 21 deletions .github/conan/settings.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---

# Only for cross building, 'os_build/arch_build' is the system that runs Conan
os_build: [Windows, WindowsStore, Linux, Macos, FreeBSD, SunOS, AIX]
os_build: [Windows, WindowsStore, Linux, Macos, FreeBSD, SunOS, AIX, VxWorks]
arch_build: [x86, x86_64, ppc32be, ppc32, ppc64le, ppc64, armv5el, armv5hf, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr, s390, s390x, sh4le, e2k-v2, e2k-v3, e2k-v4, e2k-v5, e2k-v6, e2k-v7]

# Only for building cross compilation tools, 'os_target/arch_target' is the system for
# which the tools generate code
os_target: [Windows, Linux, Macos, Android, iOS, watchOS, tvOS, FreeBSD, SunOS, AIX, Arduino, Neutrino]
arch_target: [x86, x86_64, ppc32be, ppc32, ppc64le, ppc64, armv5el, armv5hf, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr, s390, s390x, asm.js, wasm, sh4le, e2k-v2, e2k-v3, e2k-v4, e2k-v5, e2k-v6, e2k-v7, xtensalx6, xtensalx106]
arch_target: [x86, x86_64, ppc32be, ppc32, ppc64le, ppc64, armv5el, armv5hf, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr, s390, s390x, asm.js, wasm, sh4le, e2k-v2, e2k-v3, e2k-v4, e2k-v5, e2k-v6, e2k-v7, xtensalx6, xtensalx106, xtensalx7]

# Rest of the settings are "host" settings:
# - For native building/cross building: Where the library/program will run.
Expand All @@ -20,27 +20,40 @@ os:
platform: ANY
version: ["5.0", "6.0", "7.0", "8.0"]
Linux:
Macos:
version: [None, "10.6", "10.7", "10.8", "10.9", "10.10", "10.11", "10.12", "10.13", "10.14", "10.15", "11.0", "12.0", "13.0"]
sdk: [None, "macosx"]
subsystem: [None, catalyst]
Android:
api_level: ANY
iOS:
version: ["7.0", "7.1", "8.0", "8.1", "8.2", "8.3", "9.0", "9.1", "9.2", "9.3", "10.0", "10.1", "10.2", "10.3",
version: &ios_version
["7.0", "7.1", "8.0", "8.1", "8.2", "8.3", "9.0", "9.1", "9.2", "9.3", "10.0", "10.1", "10.2", "10.3",
"11.0", "11.1", "11.2", "11.3", "11.4", "12.0", "12.1", "12.2", "12.3", "12.4",
"13.0", "13.1", "13.2", "13.3", "13.4", "13.5", "13.6", "13.7",
"14.0", "14.1", "14.2", "14.3", "14.4", "14.5", "14.6", "14.7", "14.8", "15.0", "15.1"]
"14.0", "14.1", "14.2", "14.3", "14.4", "14.5", "14.6", "14.7", "14.8",
"15.0", "15.1", "15.2", "15.3", "15.4"]
sdk: [None, "iphoneos", "iphonesimulator"]
sdk_version: [None, "11.3", "11.4", "12.0", "12.1", "12.2", "12.4",
"13.0", "13.1", "13.2", "13.4", "13.5", "13.6", "13.7",
"14.0", "14.1", "14.2", "14.3", "14.4", "14.5", "15.0", "15.2", "15.4"]
watchOS:
version: ["4.0", "4.1", "4.2", "4.3", "5.0", "5.1", "5.2", "5.3", "6.0", "6.1", "6.2",
"7.0", "7.1", "7.2", "7.3", "7.4", "7.5", "7.6", "8.0", "8.1"]
"7.0", "7.1", "7.2", "7.3", "7.4", "7.5", "7.6", "8.0", "8.1", "8.3", "8.4", "8.5"]
sdk: [None, "watchos", "watchsimulator"]
sdk_version: [None, "4.3", "5.0", "5.1", "5.2", "5.3", "6.0", "6.1", "6.2",
"7.0", "7.1", "7.2", "7.4", "8.0", "8.0.1", "8.3", "8.5"]
tvOS:
version: ["11.0", "11.1", "11.2", "11.3", "11.4", "12.0", "12.1", "12.2", "12.3", "12.4",
"13.0", "13.2", "13.3", "13.4", "14.0", "14.2", "14.3", "14.4", "14.5", "14.6", "14.7",
"15.0", "15.1"]
"15.0", "15.1", "15.2", "15.3", "15.4"]
sdk: [None, "appletvos", "appletvsimulator"]
sdk_version: [None, "11.3", "11.4", "12.0", "12.1", "12.2", "12.4",
"13.0", "13.1", "13.2", "13.4", "14.0", "14.2", "14.3", "14.5", "15.0", "15.2", "15.4"]
Macos:
version: [None, "10.6", "10.7", "10.8", "10.9", "10.10", "10.11", "10.12", "10.13", "10.14", "10.15", "11.0", "12.0", "13.0"]
sdk: [None, "macosx"]
sdk_version: [None, "10.13", "10.14", "10.15", "11.0", "11.1", "11.3", "12.0", "12.1", "12.3"]
subsystem:
None:
catalyst:
ios_version: *ios_version
Android:
api_level: ANY
FreeBSD:
SunOS:
AIX:
Expand All @@ -50,7 +63,9 @@ os:
Neutrino:
version: ["6.4", "6.5", "6.6", "7.0", "7.1"]
baremetal:
arch: [x86, x86_64, ppc32be, ppc32, ppc64le, ppc64, armv4, armv4i, armv5el, armv5hf, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr, s390, s390x, asm.js, wasm, sh4le, e2k-v2, e2k-v3, e2k-v4, e2k-v5, e2k-v6, e2k-v7, xtensalx6, xtensalx106]
VxWorks:
version: ["7"]
arch: [x86, x86_64, ppc32be, ppc32, ppc64le, ppc64, armv4, armv4i, armv5el, armv5hf, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr, s390, s390x, asm.js, wasm, sh4le, e2k-v2, e2k-v3, e2k-v4, e2k-v5, e2k-v6, e2k-v7, xtensalx6, xtensalx106, xtensalx7]
compiler:
sun-cc:
version: ["5.10", "5.11", "5.12", "5.13", "5.14", "5.15"]
Expand All @@ -62,7 +77,7 @@ compiler:
"6", "6.1", "6.2", "6.3", "6.4", "6.5",
"7", "7.1", "7.2", "7.3", "7.4", "7.5",
"8", "8.1", "8.2", "8.3", "8.4",
"9", "9.1", "9.2", "9.3",
"9", "9.1", "9.2", "9.3", "9.4",
"10", "10.1", "10.2", "10.3",
"11", "11.1", "11.2",
"12"]
Expand All @@ -80,20 +95,22 @@ compiler:
llvm, ClangCL, v143]
cppstd: [None, 14, 17, 20, 23]
msvc:
version: [190, 191, 192, 193]
version: [170, 180, 190, 191, 192, 193]
update: [None, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
runtime: [static, dynamic]
runtime_type: [Debug, Release]
cppstd: [14, 17, 20, 23]
cppstd: [98, 14, 17, 20, 23]
toolset: [None, v110_xp, v120_xp, v140_xp, v141_xp]
clang:
version: ["3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "4.0",
"5.0", "6.0", "7.0", "7.1",
"8", "9", "10", "11", "12", "13", "14"]
"8", "9", "10", "11", "12", "13", "14", "15"]
libcxx: [None, libstdc++, libstdc++11, libc++, c++_shared, c++_static]
cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20, 23, gnu23]
runtime: [None, MD, MT, MTd, MDd]
runtime: [None, MD, MT, MTd, MDd, static, dynamic]
runtime_type: [None, Debug, Release]
apple-clang: &apple_clang
version: ["5.0", "5.1", "6.0", "6.1", "7.0", "7.3", "8.0", "8.1", "9.0", "9.1", "10.0", "11.0", "12.0", "13.0"]
version: ["5.0", "5.1", "6.0", "6.1", "7.0", "7.3", "8.0", "8.1", "9.0", "9.1", "10.0", "11.0", "12.0", "13", "13.0", "13.1"]
libcxx: [libstdc++, libc++]
cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]
intel:
Expand Down Expand Up @@ -132,4 +149,3 @@ build_type: [None, Debug, Release, RelWithDebInfo, MinSizeRel]


cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20, 23, gnu23] # Deprecated, use compiler.cppstd
...
9 changes: 6 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
# Build and test many combinations on Linux/OS X using Conan
clang-tidy:
strategy:
fail-fast: false
matrix:
int128: ["True", "False"]

Expand Down Expand Up @@ -70,6 +71,7 @@ jobs:
# Build and test many combinations on Linux/OS X using Conan
conan:
strategy:
fail-fast: false
matrix:
name: [
clang-14-libc++, clang-14-libstdc++,
Expand Down Expand Up @@ -140,12 +142,12 @@ jobs:

# OS X Clang (latest)
- name: osx-clang-13
os-version: macos-10.15
os-version: macos-12
profile: osx-clang-13

# OS X GCC-11
- name: osx-gcc-11
os-version: macos-10.15
os-version: macos-12
profile: osx-gcc-11

# GCC-10 (for ARMv7)
Expand Down Expand Up @@ -175,7 +177,7 @@ jobs:
${{ env.CACHE_SLUG }}-

- name: Install Brew packages
if: ( matrix.os-version == 'macos-10.15' )
if: ( matrix.os-version == 'macos-12' )
run: brew install ccache conan ninja

- name: Restore Compiler Cache
Expand Down Expand Up @@ -225,6 +227,7 @@ jobs:
# Build and test on Windows using Conan
windows:
strategy:
fail-fast: false
matrix:
name: [2022-64, 2022-32, 2019-64, 2019-32]
include:
Expand Down
9 changes: 7 additions & 2 deletions test/unit/cmath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ static_assert(identical(2, cnl::sqrt(4)));

TEST(cmake, sqrt_float) // NOLINT
{
auto const expected{3.5};
auto const expected{new double{3.5}};
auto const actual{cnl::sqrt(12.25)};
ASSERT_EQ(expected, actual);
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
ASSERT_EQ(*expected, actual);
if (actual > 42) {
// NOLINTNEXTLINE(cppcoreguidelines-owning-memory)
delete expected;
}
}