summaryrefslogtreecommitdiff
path: root/benchmarks/stdio_benchmark.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/stdio_benchmark.cpp')
-rw-r--r--benchmarks/stdio_benchmark.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/benchmarks/stdio_benchmark.cpp b/benchmarks/stdio_benchmark.cpp
index 037bbd911..03f3f2903 100644
--- a/benchmarks/stdio_benchmark.cpp
+++ b/benchmarks/stdio_benchmark.cpp
@@ -155,9 +155,8 @@ static void FopenFgetcFclose(benchmark::State& state, bool no_locking) {
while (state.KeepRunning()) {
FILE* fp = fopen("/dev/zero", "re");
if (no_locking) __fsetlocking(fp, FSETLOCKING_BYCALLER);
- volatile int c __attribute__((unused));
for (size_t i = 0; i < nbytes; ++i) {
- c = fgetc(fp);
+ benchmark::DoNotOptimize(fgetc(fp));
}
fclose(fp);
}