Skip to content

Commit

Permalink
pirate: Fix unused warning
Browse files Browse the repository at this point in the history
Add a compiler attribute to silence warnings about the 'discard'
variable being unused.
  • Loading branch information
andysan committed Mar 19, 2013
1 parent 6e0b76f commit bc2ec35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions perfpirate.c
Expand Up @@ -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];
}
}
Expand All @@ -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];
}
}
Expand Down

0 comments on commit bc2ec35

Please sign in to comment.