* [PATCH] Get rid of Werror=maybe-uninitialized in res_send.c.
@ 2019-12-03 8:50 Stefan Liebler
2019-12-09 13:00 ` Stefan Liebler
2020-01-20 8:27 ` Siddhesh Poyarekar
0 siblings, 2 replies; 8+ messages in thread
From: Stefan Liebler @ 2019-12-03 8:50 UTC (permalink / raw)
To: GNU C Library
[-- Attachment #1: Type: text/plain, Size: 569 bytes --]
Hi,
the commit 446997ff1433d33452b81dfa9e626b8dccf101a4 introduced
this new usage of resplen. If build with gcc 9 -march>=z13 on s390x,
the following warning occurs:
res_send.c: In function ‘__res_context_send’:
res_send.c:539:6: error: ‘resplen’ may be used uninitialized in this
function [-Werror=maybe-uninitialized]
539 | if (resplen > HFIXEDSZ)
| ^
Therefore this patch adds a further DIAG_IGNORE_NEEDS_COMMENT in the
same way as it was previously done for usages of resplen or n.
See commit d1bc2cbbed9aea2017ef941f63c8786571da5b4f.
Bye
Stefan
[-- Attachment #2: 20191202_werror_res_send.patch --]
[-- Type: text/x-patch, Size: 1510 bytes --]
commit bfd6a9fcd4fbbd19eb67b868a27f83c801e2e725
Author: Stefan Liebler <stli@linux.ibm.com>
Date: Mon Dec 2 13:11:52 2019 +0100
Get rid of Werror=maybe-uninitialized in res_send.c.
The commit 446997ff1433d33452b81dfa9e626b8dccf101a4 introduced
this new usage of resplen. If build with gcc 9 -march>=z13 on s390x,
the following warning occurs:
res_send.c: In function ‘__res_context_send’:
res_send.c:539:6: error: ‘resplen’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
539 | if (resplen > HFIXEDSZ)
| ^
Therefore this patch adds a further DIAG_IGNORE_NEEDS_COMMENT in the
same way as it was previously done for usages of resplen or n.
See commit d1bc2cbbed9aea2017ef941f63c8786571da5b4f.
diff --git a/resolv/res_send.c b/resolv/res_send.c
index fce810031f..975985f13a 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -534,6 +534,9 @@ __res_context_send (struct resolv_context *ctx,
resplen = n;
+ /* See comment at the declaration of n. Note: resplen = n; */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (9, "-Wmaybe-uninitialized");
/* Mask the AD bit in both responses unless it is
marked trusted. */
if (resplen > HFIXEDSZ)
@@ -543,6 +546,7 @@ __res_context_send (struct resolv_context *ctx,
else
mask_ad_bit (ctx, ans);
}
+ DIAG_POP_NEEDS_COMMENT;
if (resplen2 != NULL && *resplen2 > HFIXEDSZ)
mask_ad_bit (ctx, *ansp2);
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] Get rid of Werror=maybe-uninitialized in res_send.c.
2019-12-03 8:50 [PATCH] Get rid of Werror=maybe-uninitialized in res_send.c Stefan Liebler
@ 2019-12-09 13:00 ` Stefan Liebler
2019-12-13 12:43 ` Stefan Liebler
2020-01-20 8:27 ` Siddhesh Poyarekar
1 sibling, 1 reply; 8+ messages in thread
From: Stefan Liebler @ 2019-12-09 13:00 UTC (permalink / raw)
To: libc-alpha
On 12/3/19 9:50 AM, Stefan Liebler wrote:
> Hi,
>
> the commit 446997ff1433d33452b81dfa9e626b8dccf101a4 introduced
> this new usage of resplen. If build with gcc 9 -march>=z13 on s390x,
> the following warning occurs:
> res_send.c: In function ‘__res_context_send’:
> res_send.c:539:6: error: ‘resplen’ may be used uninitialized in this
> function [-Werror=maybe-uninitialized]
> 539 | if (resplen > HFIXEDSZ)
> | ^
>
> Therefore this patch adds a further DIAG_IGNORE_NEEDS_COMMENT in the
> same way as it was previously done for usages of resplen or n.
> See commit d1bc2cbbed9aea2017ef941f63c8786571da5b4f.
>
> Bye
> Stefan
ping
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Get rid of Werror=maybe-uninitialized in res_send.c.
2019-12-09 13:00 ` Stefan Liebler
@ 2019-12-13 12:43 ` Stefan Liebler
2020-01-08 7:47 ` Stefan Liebler
0 siblings, 1 reply; 8+ messages in thread
From: Stefan Liebler @ 2019-12-13 12:43 UTC (permalink / raw)
To: libc-alpha
On 12/9/19 2:00 PM, Stefan Liebler wrote:
> On 12/3/19 9:50 AM, Stefan Liebler wrote:
>> Hi,
>>
>> the commit 446997ff1433d33452b81dfa9e626b8dccf101a4 introduced
>> this new usage of resplen. If build with gcc 9 -march>=z13 on s390x,
>> the following warning occurs:
>> res_send.c: In function ‘__res_context_send’:
>> res_send.c:539:6: error: ‘resplen’ may be used uninitialized in this
>> function [-Werror=maybe-uninitialized]
>> 539 | if (resplen > HFIXEDSZ)
>> | ^
>>
>> Therefore this patch adds a further DIAG_IGNORE_NEEDS_COMMENT in the
>> same way as it was previously done for usages of resplen or n.
>> See commit d1bc2cbbed9aea2017ef941f63c8786571da5b4f.
>>
>> Bye
>> Stefan
>
> ping
>
ping
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Get rid of Werror=maybe-uninitialized in res_send.c.
2019-12-13 12:43 ` Stefan Liebler
@ 2020-01-08 7:47 ` Stefan Liebler
2020-01-14 8:22 ` Stefan Liebler
0 siblings, 1 reply; 8+ messages in thread
From: Stefan Liebler @ 2020-01-08 7:47 UTC (permalink / raw)
To: libc-alpha
On 12/13/19 1:43 PM, Stefan Liebler wrote:
> On 12/9/19 2:00 PM, Stefan Liebler wrote:
>> On 12/3/19 9:50 AM, Stefan Liebler wrote:
>>> Hi,
>>>
>>> the commit 446997ff1433d33452b81dfa9e626b8dccf101a4 introduced
>>> this new usage of resplen. If build with gcc 9 -march>=z13 on s390x,
>>> the following warning occurs:
>>> res_send.c: In function ‘__res_context_send’:
>>> res_send.c:539:6: error: ‘resplen’ may be used uninitialized in this
>>> function [-Werror=maybe-uninitialized]
>>> 539 | if (resplen > HFIXEDSZ)
>>> | ^
>>>
>>> Therefore this patch adds a further DIAG_IGNORE_NEEDS_COMMENT in the
>>> same way as it was previously done for usages of resplen or n.
>>> See commit d1bc2cbbed9aea2017ef941f63c8786571da5b4f.
>>>
>>> Bye
>>> Stefan
>>
>> ping
>>
> ping
>
ping
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Get rid of Werror=maybe-uninitialized in res_send.c.
2020-01-08 7:47 ` Stefan Liebler
@ 2020-01-14 8:22 ` Stefan Liebler
2020-01-20 8:17 ` Stefan Liebler
0 siblings, 1 reply; 8+ messages in thread
From: Stefan Liebler @ 2020-01-14 8:22 UTC (permalink / raw)
To: libc-alpha; +Cc: Siddhesh Poyarekar
On 1/8/20 8:47 AM, Stefan Liebler wrote:
> On 12/13/19 1:43 PM, Stefan Liebler wrote:
>> On 12/9/19 2:00 PM, Stefan Liebler wrote:
>>> On 12/3/19 9:50 AM, Stefan Liebler wrote:
>>>> Hi,
>>>>
>>>> the commit 446997ff1433d33452b81dfa9e626b8dccf101a4 introduced
>>>> this new usage of resplen. If build with gcc 9 -march>=z13 on s390x,
>>>> the following warning occurs:
>>>> res_send.c: In function ‘__res_context_send’:
>>>> res_send.c:539:6: error: ‘resplen’ may be used uninitialized in this
>>>> function [-Werror=maybe-uninitialized]
>>>> 539 | if (resplen > HFIXEDSZ)
>>>> | ^
>>>>
>>>> Therefore this patch adds a further DIAG_IGNORE_NEEDS_COMMENT in the
>>>> same way as it was previously done for usages of resplen or n.
>>>> See commit d1bc2cbbed9aea2017ef941f63c8786571da5b4f.
>>>>
>>>> Bye
>>>> Stefan
>>>
>>> ping
>>>
>> ping
>>
> ping
>
ping
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Get rid of Werror=maybe-uninitialized in res_send.c.
2020-01-14 8:22 ` Stefan Liebler
@ 2020-01-20 8:17 ` Stefan Liebler
0 siblings, 0 replies; 8+ messages in thread
From: Stefan Liebler @ 2020-01-20 8:17 UTC (permalink / raw)
To: libc-alpha
On 1/14/20 9:22 AM, Stefan Liebler wrote:
> On 1/8/20 8:47 AM, Stefan Liebler wrote:
>> On 12/13/19 1:43 PM, Stefan Liebler wrote:
>>> On 12/9/19 2:00 PM, Stefan Liebler wrote:
>>>> On 12/3/19 9:50 AM, Stefan Liebler wrote:
>>>>> Hi,
>>>>>
>>>>> the commit 446997ff1433d33452b81dfa9e626b8dccf101a4 introduced
>>>>> this new usage of resplen. If build with gcc 9 -march>=z13 on s390x,
>>>>> the following warning occurs:
>>>>> res_send.c: In function ‘__res_context_send’:
>>>>> res_send.c:539:6: error: ‘resplen’ may be used uninitialized in
>>>>> this function [-Werror=maybe-uninitialized]
>>>>> 539 | if (resplen > HFIXEDSZ)
>>>>> | ^
>>>>>
>>>>> Therefore this patch adds a further DIAG_IGNORE_NEEDS_COMMENT in the
>>>>> same way as it was previously done for usages of resplen or n.
>>>>> See commit d1bc2cbbed9aea2017ef941f63c8786571da5b4f.
>>>>>
>>>>> Bye
>>>>> Stefan
>>>>
>>>> ping
>>>>
>>> ping
>>>
>> ping
>>
> ping
>
ping
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Get rid of Werror=maybe-uninitialized in res_send.c.
2019-12-03 8:50 [PATCH] Get rid of Werror=maybe-uninitialized in res_send.c Stefan Liebler
2019-12-09 13:00 ` Stefan Liebler
@ 2020-01-20 8:27 ` Siddhesh Poyarekar
2020-01-20 10:02 ` Stefan Liebler
1 sibling, 1 reply; 8+ messages in thread
From: Siddhesh Poyarekar @ 2020-01-20 8:27 UTC (permalink / raw)
To: Stefan Liebler, GNU C Library
On 03/12/19 2:20 pm, Stefan Liebler wrote:
> Hi,
>
> the commit 446997ff1433d33452b81dfa9e626b8dccf101a4 introduced
> this new usage of resplen. If build with gcc 9 -march>=z13 on s390x,
> the following warning occurs:
> res_send.c: In function ‘__res_context_send’:
> res_send.c:539:6: error: ‘resplen’ may be used uninitialized in this
> function [-Werror=maybe-uninitialized]
> 539 | if (resplen > HFIXEDSZ)
> | ^
>
> Therefore this patch adds a further DIAG_IGNORE_NEEDS_COMMENT in the
> same way as it was previously done for usages of resplen or n.
> See commit d1bc2cbbed9aea2017ef941f63c8786571da5b4f.
This is fine. OK to commit to master.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
PS: Please send patches inline (using git send-email) since it's easier
to add review comments that way.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Get rid of Werror=maybe-uninitialized in res_send.c.
2020-01-20 8:27 ` Siddhesh Poyarekar
@ 2020-01-20 10:02 ` Stefan Liebler
0 siblings, 0 replies; 8+ messages in thread
From: Stefan Liebler @ 2020-01-20 10:02 UTC (permalink / raw)
To: Siddhesh Poyarekar, GNU C Library
On 1/20/20 9:27 AM, Siddhesh Poyarekar wrote:
> On 03/12/19 2:20 pm, Stefan Liebler wrote:
>> Hi,
>>
>> the commit 446997ff1433d33452b81dfa9e626b8dccf101a4 introduced
>> this new usage of resplen. If build with gcc 9 -march>=z13 on s390x,
>> the following warning occurs:
>> res_send.c: In function ‘__res_context_send’:
>> res_send.c:539:6: error: ‘resplen’ may be used uninitialized in this
>> function [-Werror=maybe-uninitialized]
>> 539 | if (resplen > HFIXEDSZ)
>> | ^
>>
>> Therefore this patch adds a further DIAG_IGNORE_NEEDS_COMMENT in the
>> same way as it was previously done for usages of resplen or n.
>> See commit d1bc2cbbed9aea2017ef941f63c8786571da5b4f.
>
> This is fine. OK to commit to master.
>
> Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
>
> PS: Please send patches inline (using git send-email) since it's easier
> to add review comments that way.
>
Okay.
Committed.
Thanks.
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-01-20 10:02 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-03 8:50 [PATCH] Get rid of Werror=maybe-uninitialized in res_send.c Stefan Liebler
2019-12-09 13:00 ` Stefan Liebler
2019-12-13 12:43 ` Stefan Liebler
2020-01-08 7:47 ` Stefan Liebler
2020-01-14 8:22 ` Stefan Liebler
2020-01-20 8:17 ` Stefan Liebler
2020-01-20 8:27 ` Siddhesh Poyarekar
2020-01-20 10:02 ` Stefan Liebler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).