Skip to content

Commit

Permalink
Avoid warnings in test cases.
Browse files Browse the repository at this point in the history
The posix/tst-rfc3484* test cases caused warnings in newer gccs
because the unused but copied sin_zero part of sockaddr_in wasn't
explicitly initialized.
  • Loading branch information
Ulrich Drepper committed Jul 23, 2009
1 parent 30a2dfd commit 666a987
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
2009-07-23 Ulrich Drepper <drepper@redhat.com>

* posix/tst-rfc3484.c (do_test): Initialize entire sockaddr_in
structure before copying it to avoid warning.
* posix/tst-rfc3484-2.c (do_test): Likewise.
* posix/tst-rfc3484-3.c (do_test): Likewise.

[BZ #10416]
* include/unistd.h: Make header file suitable for C++ test cases.
Patch by Duncan Simpson <dps@simpson.demon.co.uk>.
Expand Down
2 changes: 2 additions & 0 deletions posix/tst-rfc3484-2.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ do_test (void)
struct sockaddr_in so1;
so1.sin_family = AF_INET;
so1.sin_addr.s_addr = h (0xc0a85f19);
/* Clear the rest of the structure to avoid warnings. */
memset (so1.sin_zero, '\0', sizeof (so1.sin_zero));

struct sockaddr_in sa1;
sa1.sin_family = AF_INET;
Expand Down
2 changes: 2 additions & 0 deletions posix/tst-rfc3484-3.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ do_test (void)
struct sockaddr_in so;
so.sin_family = AF_INET;
so.sin_addr.s_addr = h (0x0aa85f19);
/* Clear the rest of the structure to avoid warnings. */
memset (so.sin_zero, '\0', sizeof (so.sin_zero));

for (int i = 0; i < naddrs; ++i)
{
Expand Down
2 changes: 2 additions & 0 deletions posix/tst-rfc3484.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ do_test (void)
struct sockaddr_in so;
so.sin_family = AF_INET;
so.sin_addr.s_addr = h (0xc0a85f19);
/* Clear the rest of the structure to avoid warnings. */
memset (so.sin_zero, '\0', sizeof (so.sin_zero));

for (int i = 0; i < naddrs; ++i)
{
Expand Down

0 comments on commit 666a987

Please sign in to comment.