Skip to content

Commit

Permalink
Fix some GCC workflow runner bug
Browse files Browse the repository at this point in the history
  • Loading branch information
alainesp committed Feb 3, 2024
1 parent 02bd451 commit 0bf8b83
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
c_compiler: cl
cpp_compiler: cl
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
c_compiler: gcc-13
cpp_compiler: g++-13
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
c_compiler: clang-17
cpp_compiler: clang++17
exclude:
- os: windows-latest
c_compiler: gcc
Expand Down
7 changes: 3 additions & 4 deletions example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <wy.hpp>
#include <random>

void main_rand()
static void main_rand()
{
// Create a pseudo-random generator
wy::rand r;
Expand All @@ -34,15 +34,14 @@ void main_rand()

#include <unordered_map>
#include <iostream>
#include <format>

struct Person
{
std::string name;
std::string surname;
};

void main_hash()
static void main_hash()
{
// Create random persons
std::vector<Person> persons;
Expand All @@ -61,7 +60,7 @@ void main_hash()
for (size_t i = 0; i < persons.size() * 2; i++)
persons_found += h.count(std::string("Person Name") + std::to_string(i));

std::cout << std::format("Found {} persons", persons_found) << std::endl;
std::cout << "Found " << persons_found << " persons" << std::endl;
}

int main()
Expand Down
4 changes: 2 additions & 2 deletions performance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <iostream>
#include <format>

void main_rand()
static void main_rand()
{
constexpr size_t numIter = 1'000'000'000;
constexpr size_t numIterStream = 10'000'000;
Expand Down Expand Up @@ -119,7 +119,7 @@ void main_rand()
std::cout << std::format("{}", (no_op + no_opd) ? "" : "Bad luck!");
}

void main_hash()
static void main_hash()
{
constexpr size_t numIter = 100'000'000;
uint64_t no_op = 0;// variable to restrict compiler optimizations
Expand Down

0 comments on commit 0bf8b83

Please sign in to comment.