Skip to content

Commit

Permalink
hexdump: avoid warning in test function
Browse files Browse the repository at this point in the history
The test_data_1_le[] array is a const array of const char *.  To avoid
dropping any const information, we need to use "const char * const *",
not just "const char **".

I'm not sure why the different test arrays end up having different
const'ness, but let's make the pointer we use to traverse them as const
as possible, since we modify neither the array of pointers _or_ the
pointers we find in the array.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Linus Torvalds committed Apr 19, 2015
1 parent 8b01fc8 commit 17974c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/test-hexdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static void __init test_hexdump(size_t len, int rowsize, int groupsize,
char test[32 * 3 + 2 + 32 + 1];
char real[32 * 3 + 2 + 32 + 1];
char *p;
const char **result;
const char * const *result;
size_t l = len;
int gs = groupsize, rs = rowsize;
unsigned int i;
Expand Down

0 comments on commit 17974c0

Please sign in to comment.