Giter Club home page Giter Club logo

bsl's People

Contributors

chp-io avatar rianquinn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bsl's Issues

Preliminary test of GCC

First of all, thanks for a good library.

I had tested this library for use on armv7m architecture but sadly the Rust friendly design breaks it since uintmx is 64 bit (unsigned long long) on 32 bit architecture. uintptr_t and size_t is always a safe bet across architectures. I'm now considering what to do, but i found a few things to share, if there are any interest in GCC support.

  • Use: ´#pragma GCC diagnostic´ instead. since it works in both gcc and clang.
  • No -Wno-invalid-constexpr exists in gcc. I can currently not find an alternative, it might be a problem.
  • Return value in void functions? GCC don't like it.
    return ::exit(EXIT_FAILURE); // GRCOV_EXCLUDE
  • is_convertible has to be manually implemented. __is_convertible_to() is not available in GCC.
  • make_integer_sequence needs a fix
    template<typename T, T N>
    using make_integer_sequence = 
#if __has_builtin(__make_integer_seq)
        __make_integer_seq<integer_sequence, T, N>;
#else
        integer_sequence<T, __integer_pack(N)...>;
#endif
  • Doxygen/ansi flags is not supported in GCC.
  • -Weverything is considered a unreliable clang development only flag. See here. I recommend this instead:
set(CLANG_WARNINGS
      -Wall
      -Wextra # reasonable and standard
      -Wshadow # warn the user if a variable declaration shadows one from a parent context
      -Wnon-virtual-dtor # warn the user if a class with virtual functions has a non-virtual destructor. This helps
                         # catch hard to track down memory errors
      -Wold-style-cast # warn for c-style casts
      -Wcast-align # warn for potential performance problem casts
      -Wunused # warn on anything being unused
      -Woverloaded-virtual # warn if you overload (not override) a virtual function
      -Wpedantic # warn if non-standard C++ is used
      -Wconversion # warn on type conversions that may lose data
      -Wsign-conversion # warn on sign conversions
      -Wnull-dereference # warn if a null dereference is detected
      -Wdouble-promotion # warn if float is implicit promoted to double
      -Wformat=2 # warn on security issues around functions that format output (ie printf)
      -Wimplicit-fallthrough # warn on statements that fallthrough without an explicit annotation
  )
  set(GCC_WARNINGS
      ${CLANG_WARNINGS}
      -Wmisleading-indentation # warn if indentation implies blocks where blocks do not exist
      -Wduplicated-cond # warn if if / else chain has duplicated conditions
      -Wduplicated-branches # warn if if / else branches have duplicated code
      -Wlogical-op # warn about logical operations being used where bitwise were probably wanted
      #-Wuseless-cast # warn if you perform a cast to the same type (a lot of casting to same type exists in bsl)
  )

support for macOS Monterey 12.1 and XCode 13.2.1

Hi,

My mac has llvm/clang 12 (and I know your README says that only clang 11 is supported).

I have made some small changes to the CMake file to support "Darwin" (Apple macOS), but I have not managed to compile.

error.log

What would be needed to make the BSL build on this platform?

Regards.

Example test in readme.md doesn't really test addition

The example code in README.md aims to test the += operator of safe_umx, but because it adds 42 to 0, it would also pass if the operator was (incorrectly) implemented as an assignment instead of an addition (as zero is the identity element of addition).

The fix would be to initialize data2 to a non-zero value.

bsl/README.md

Lines 139 to 144 in 6509cff

constexpr auto data1{42_umx};
bsl::safe_umx data2{};
bsl::ut_when{} = [&]() noexcept {
data2 += data1;
bsl::ut_then{} = [&]() noexcept {
bsl::ut_check(data2.checked() == data1);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.