* tests/test-ffsl.c (main): Use variable x, not i.
* tests/test-posix_spawn3.c (parent_main): Consider the return value of
freopen.
* tests/test-sethostname1.c (main): Explicitly ignore the return value
of sethostname.
+2016-10-16 Bruno Haible <bruno@clisp.org>
+
+ Fix some "gcc -Wall" warnings.
+ * tests/test-ffsl.c (main): Use variable x, not i.
+ * tests/test-posix_spawn3.c (parent_main): Consider the return value of
+ freopen.
+ * tests/test-sethostname1.c (main): Explicitly ignore the return value
+ of sethostname.
+
2016-10-16 Bruno Haible <bruno@clisp.org>
gnulib-tool: Make --create-testdir on all modules work again.
long int x;
int i;
- for (i = -128; i <= 128; i++)
- ASSERT (ffsl (i) == naive (i));
+ for (x = -128; x <= 128; x++)
+ ASSERT (ffsl (x) == naive (x));
for (i = 0; i < NBITS; i++)
{
ASSERT (ffsl (1UL << i) == naive (1UL << i));
}
/* Avoid reading from our stdin, as it could block. */
- freopen ("/dev/null", "rb", stdin);
+ if (freopen ("/dev/null", "rb", stdin) == NULL)
+ {
+ perror ("cannot redirect stdin");
+ return 1;
+ }
/* Test whether posix_spawn_file_actions_addopen with this file name
actually works, but spawning a child that reads from this file. */
/* Some code that has a link-time dependency to the sethostname() function
and that is likely not optimized away by compilers. */
if (do_dangerous_things)
- /* Never executed. */
- sethostname ("oprah", 5);
+ {
+ /* Never executed. */
+ int ret = sethostname ("oprah", 5);
+ (void) ret;
+ }
return 0;
}