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

compile error in benchmark.cc #1

Closed
tfarina opened this issue Jan 10, 2014 · 2 comments
Closed

compile error in benchmark.cc #1

tfarina opened this issue Jan 10, 2014 · 2 comments

Comments

@tfarina
Copy link

tfarina commented Jan 10, 2014

src/benchmark.cc:796:35: error: variable length array of non-POD element type 'std::unique_ptr'
std::unique_ptr runners[b.threads];

$ clang --version
clang version 3.4 (trunk 193323)
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ which clang
/home/tfarina/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang

$ uname -a
Linux i3 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Ubuntu 12.04

@dmah42
Copy link
Member

dmah42 commented Jan 10, 2014

Fixed in 77cd980

@dmah42 dmah42 closed this as completed Jan 10, 2014
@tfarina
Copy link
Author

tfarina commented Jan 10, 2014

Thanks! Fixed.

EricWF added a commit to efcs/benchmark that referenced this issue Mar 23, 2018
This patch addresses issue google#341 by adding the function MakeUnpredictable.
The MakeUnpredictable(...) functions can be used to prevent the optimizer
from knowing the value of the specified 'object'. The function returns
the "laundered" input, either by reference if the input was a non-const
lvalue reference, or by value (when the input was a const lvalue or rvalue).

When MakeUnpredictable is supplied a non-const lvalue, the object
referenced by the input is made unpredictable and the return value
can be ignored. Otherwise, only the return value is considered
"unpredictable". In the latter the MakeUnpredictable function
is marked [[nodiscard]] and a warning is emitted if the return
value is ignored. For example:

```c++
int divide_by_two(int Value) {
  const int Divisor = 2;
  DoNotOptimize(Divisor); // INCORRECT! Has no effect on Divisor
  MakeUnpredictable(Divisor); // INCORRECT! should warn that return is ignored.
  // Correct Usage google#1
  return Value / MakeUnpredictable(Divisor);
  // Correct Usage google#2
  const int Divisor = MakeUnpredictable(2);
  return Value / Divisor;
}
```
EricWF added a commit to efcs/benchmark that referenced this issue Mar 23, 2018
This patch addresses issue google#341 by adding the function MakeUnpredictable.
The MakeUnpredictable(...) functions can be used to prevent the optimizer
from knowing the value of the specified 'object'. The function returns
the "laundered" input, either by reference if the input was a non-const
lvalue reference, or by value (when the input was a const lvalue or rvalue).

When MakeUnpredictable is supplied a non-const lvalue, the object
referenced by the input is made unpredictable and the return value
can be ignored. Otherwise, only the return value is considered
"unpredictable". In the latter the MakeUnpredictable function
is marked [[nodiscard]] and a warning is emitted if the return
value is ignored. For example:

```c++
int divide_by_two(int Value) {
  const int Divisor = 2;
  DoNotOptimize(Divisor); // INCORRECT! Has no effect on Divisor
  MakeUnpredictable(Divisor); // INCORRECT! should warn that return is ignored.
  // Correct Usage google#1
  return Value / MakeUnpredictable(Divisor);
  // Correct Usage google#2
  const int Divisor = MakeUnpredictable(2);
  return Value / Divisor;
}
```
dmah42 pushed a commit that referenced this issue Aug 14, 2023
Support for `getloadavg` was added in API level 29.
GerHobbelt pushed a commit to GerHobbelt/benchmark that referenced this issue Mar 20, 2024
* premake: Use _PLATFORM booleans to clean up platform checks

* premake: Remove all winuwp arm configurations as it is deprecated

* premake: Add cocoa configurations or remove unneeded mobile configurations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants