This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] Avoid -Wall warnings in the testsuite
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 22 Jun 2011 23:46:19 +0100
- Subject: Re: [v3] Avoid -Wall warnings in the testsuite
- References: <4E02633B.9020902@oracle.com> <BANLkTimtwghORqvv9VO1c3OS-1sPq49bCw@mail.gmail.com>
On 22 June 2011 23:38, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 22 June 2011 22:48, Paolo Carlini <paolo.carlini@oracle.com> wrote:
>> ... all, besides that corresponding to c++/49508.
>>
>> Committed to mainline.
>>
>> Thanks,
>> Paolo.
>>
>> //////////////////
>>
>
> Oops, this bit is my bad, I'll fix it:
>
> Index: testsuite/20_util/bind/socket.cc
> ===================================================================
> --- testsuite/20_util/bind/socket.cc ? ?(revision 175315)
> +++ testsuite/20_util/bind/socket.cc ? ?(working copy)
> @@ -35,7 +35,7 @@
> ?{
> ? int fd = 1;
> ? my_sockaddr sa; ? ? ? ? ? // N.B. non-const
> - ?size_t len = sizeof(sa); ?// N.B. size_t not socklen_t
> + ?size_t len __attribute__((unused)) = sizeof(sa); // N.B. size_t not socklen_t
> ? return bind(fd, &sa, sizeof(sa));
> ?}
>
> I meant to use len, so the attribute isn't needed
2011-06-22 Jonathan Wakely <jwakely.gcc@gmail.com>
* testsuite/20_util/bind/socket.cc: Use variable and remove attribute.
Tested (this test only) on x86_64-linux and committed to trunk.
Index: testsuite/20_util/bind/socket.cc
===================================================================
--- testsuite/20_util/bind/socket.cc (revision 175321)
+++ testsuite/20_util/bind/socket.cc (working copy)
@@ -35,7 +35,7 @@
{
int fd = 1;
my_sockaddr sa; // N.B. non-const
- size_t len __attribute__((unused)) = sizeof(sa); // N.B. size_t not socklen_t
- return bind(fd, &sa, sizeof(sa));
+ size_t len = sizeof(sa); // N.B. size_t not my_socklen_t
+ return bind(fd, &sa, len);
}