Permalink
Browse files

pirate: Fix unused warning

Add a compiler attribute to silence warnings about the 'discard'
variable being unused.
  • Loading branch information...
1 parent 6e0b76f commit bc2ec35f4f1660107687cd9cc341bddd556d7160 @andysan committed Mar 19, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 perfpirate.c
View
4 perfpirate.c
@@ -333,7 +333,7 @@ pirate_loop(char *_data, const int size, const int stride)
while (1) {
for (int i = 0; i < size; i += stride) {
- char discard;
+ char discard __attribute__((unused));
discard = data[i];
}
}
@@ -351,7 +351,7 @@ pirate_loop_fix(char *_data, const int size, const int stride)
for (int i = 0; i < last_element; i += MEM_HUGE_SIZE) {
const int limit = MIN(i + way_size, last_element);
for (int j = i; j < limit; j += stride) {
- char discard;
+ char discard __attribute__((unused));
discard = data[j];
}
}

0 comments on commit bc2ec35

Please sign in to comment.