Skip to content

Commit

Permalink
Try to handle clang-tidy and clang bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos committed Mar 29, 2024
1 parent 078630b commit 1720624
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/mandelbrot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,13 @@ jobs:
cd jpeg
make all
cd ..
if [ "${{ matrix.compiler }}" = "clang++" ]; then
export EXTRA_FLAGS="-stdlib=libc++"
else
export EXTRA_FLAGS=""
fi
echo '${{ matrix.compiler }} -c -finline-functions -march=native -mtune=native -O3 -Wall -Wextra -Wpedantic -Werror -std=${{ matrix.standard }} -DMANDELBROT_USE_GMP_FLOAT -I. -Ijpeg/jpeg-6b-2022 -I../boost-root -pthread test/test_mandelbrot.cpp -o test_mandelbrot.o'
${{ matrix.compiler }} -c -finline-functions -march=native -mtune=native -O3 -Wall -Wextra -Wpedantic -Werror -std=${{ matrix.standard }} -DMANDELBROT_USE_GMP_FLOAT -I. -Ijpeg/jpeg-6b-2022 -I../boost-root -pthread test/test_mandelbrot.cpp -o test_mandelbrot.o
${{ matrix.compiler }} -c -finline-functions -march=native -mtune=native -O3 -Wall -Wextra -Wpedantic -Werror -std=${{ matrix.standard }} $EXTRA_FLAGS -DMANDELBROT_USE_GMP_FLOAT -I. -Ijpeg/jpeg-6b-2022 -I../boost-root -pthread test/test_mandelbrot.cpp -o test_mandelbrot.o
echo '${{ matrix.compiler }} test_mandelbrot.o -lpthread -lgmp -ljpeg-6b -Ljpeg/jpeg-6b-2022/obj -o test_mandelbrot.exe'
${{ matrix.compiler }} test_mandelbrot.o -lpthread -lgmp -ljpeg-6b -Ljpeg/jpeg-6b-2022/obj -o test_mandelbrot.exe
ls -la ./test_mandelbrot.exe
Expand Down
18 changes: 14 additions & 4 deletions concurrency/stopwatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,19 @@
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef STOPWATCH_2024_03_28_H
#ifndef STOPWATCH_2024_03_28_H // NOLINT(llvm-header-guard)
#define STOPWATCH_2024_03_28_H

#if defined(_MSC_VER) && !defined(__GNUC__)
#define STOPWATCH_NODISCARD
#else
#if (defined(__cplusplus) && (__cplusplus >= 201703L))
#define STOPWATCH_NODISCARD [[nodiscard]] // NOLINT(cppcoreguidelines-macro-usage)
#else
#define STOPWATCH_NODISCARD
#endif
#endif

#include <chrono>

template <class clock_type>
Expand Down Expand Up @@ -38,7 +48,7 @@
return *this;
}

~stopwatch() { }
~stopwatch() = default;

auto reset() -> void
{
Expand All @@ -52,9 +62,9 @@
}

private:
typename clock_type::time_point m_start;
typename clock_type::time_point m_start; // NOLINT(readability-identifier-naming)

auto elapsed() const -> duration_type
STOPWATCH_NODISCARD auto elapsed() const -> duration_type
{
return (clock_type::now() - m_start);
}
Expand Down

0 comments on commit 1720624

Please sign in to comment.