summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-06-11 11:03:54 +0200
committerJim Meyering <meyering@redhat.com>2010-06-11 11:12:37 +0200
commit9e1e9d8f3bac7fb52b026f0b628eb37d3a839097 (patch)
tree2b9b32a6ef8cad4ca17350e38b2eafeb5a998e06 /tests
parentd4ee8943cf24b460e938e903c0bfaaaf25706fe9 (diff)
downloadgnulib-9e1e9d8f3bac7fb52b026f0b628eb37d3a839097.tar.gz
test-xvasprintf: avoid 'const' discard warnings
* tests/test-xvasprintf.c (test_xvasprintf, test_xasprintf): Use "const" when assigning from literal strings. (test_xasprintf): Add "void" in function argument list to placate -Wstrict-prototypes and to be consistent with test_xvasprintf above.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-xvasprintf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test-xvasprintf.c b/tests/test-xvasprintf.c
index df6c2009de..023067a457 100644
--- a/tests/test-xvasprintf.c
+++ b/tests/test-xvasprintf.c
@@ -55,7 +55,7 @@ test_xvasprintf (void)
{
/* Silence gcc warning about zero-length format string. */
- char *empty = "";
+ const char *empty = "";
result = my_xasprintf (empty);
ASSERT (result != NULL);
ASSERT (strcmp (result, "") == 0);
@@ -79,7 +79,7 @@ test_xvasprintf (void)
}
static void
-test_xasprintf ()
+test_xasprintf (void)
{
int repeat;
char *result;
@@ -94,7 +94,7 @@ test_xasprintf ()
{
/* Silence gcc warning about zero-length format string. */
- char *empty = "";
+ const char *empty = "";
result = xasprintf (empty);
ASSERT (result != NULL);
ASSERT (strcmp (result, "") == 0);