diff options
author | Bruno Haible <bruno@clisp.org> | 2009-05-14 01:39:07 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-05-14 01:39:46 +0200 |
commit | bb051a0a3c0febe9d3fabb21ae5b7fcc2ae7aa10 (patch) | |
tree | 3fd122ab88201bb57d17981f59ef912d36ba4cee /tests/test-memrchr.c | |
parent | 610a9cc95c2a1c9c0260ea7d0f9a850c6c017828 (diff) | |
download | gnulib-bb051a0a3c0febe9d3fabb21ae5b7fcc2ae7aa10.tar.gz |
Make some tests ISO C 99 compliant.
Diffstat (limited to 'tests/test-memrchr.c')
-rw-r--r-- | tests/test-memrchr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test-memrchr.c b/tests/test-memrchr.c index f829a226ae..63568c1566 100644 --- a/tests/test-memrchr.c +++ b/tests/test-memrchr.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Free Software Foundation + * Copyright (C) 2008-2009 Free Software Foundation * Written by Eric Blake and Bruno Haible * * This program is free software: you can redistribute it and/or modify @@ -22,6 +22,8 @@ #include <stdio.h> #include <stdlib.h> +#include "zerosize-ptr.h" + #define ASSERT(expr) \ do \ { \ @@ -41,8 +43,6 @@ int main () { - void *nil = NULL; /* Use to avoid gcc attribute((nonnull)) warnings. */ - size_t n = 0x100000; char *input = malloc (n); ASSERT (input); @@ -58,7 +58,7 @@ main () ASSERT (MEMRCHR (input, 'a', n) == input + n - 1); ASSERT (MEMRCHR (input, 'a', 0) == NULL); - ASSERT (MEMRCHR (nil, 'a', 0) == NULL); + ASSERT (MEMRCHR (zerosize_ptr (), 'a', 0) == NULL); ASSERT (MEMRCHR (input, 'b', n) == input + n - 2); ASSERT (MEMRCHR (input, 'c', n) == input + n - 3); |