* [PATCH] Fix build warnings in nptl/tst-eintr1.c
@ 2019-06-25 13:15 Stefan Liebler
2019-06-25 13:19 ` Florian Weimer
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Liebler @ 2019-06-25 13:15 UTC (permalink / raw
To: GNU C Library
[-- Attachment #1: Type: text/plain, Size: 561 bytes --]
Hi,
this patch fixes the gcc warnings seen with gcc 9.1 -O3 on s390x:
tst-eintr1.c: In function ‘tf1’:
tst-eintr1.c:46:1: error: no return statement in function returning
non-void [-Werror=return-type]
46 | }
| ^
tst-eintr1.c: In function ‘do_test’:
tst-eintr1.c:57:17: error: unused variable ‘th’ [-Werror=unused-variable]
57 | pthread_t th = xpthread_create (NULL, tf1, NULL);
| ^~
Bye
Stefan
ChangeLog:
* nptl/tst-eintr1.c (tf1): Add return statement.
(do_test): Remove unused th variable.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 20190624_warnings_nptl_tst-eintr1.patch --]
[-- Type: text/x-patch; name="20190624_warnings_nptl_tst-eintr1.patch", Size: 1277 bytes --]
commit 2d77bc90e2d16f88eb242c3daf2778b009a9234e
Author: Stefan Liebler <stli@linux.ibm.com>
Date: Mon Jun 24 12:11:48 2019 +0200
Fix build warnings in nptl/tst-eintr1.c
This patch fixes the gcc warnings seen with gcc 9.1 -O3 on s390x:
tst-eintr1.c: In function ‘tf1’:
tst-eintr1.c:46:1: error: no return statement in function returning non-void [-Werror=return-type]
46 | }
| ^
tst-eintr1.c: In function ‘do_test’:
tst-eintr1.c:57:17: error: unused variable ‘th’ [-Werror=unused-variable]
57 | pthread_t th = xpthread_create (NULL, tf1, NULL);
| ^~
ChangeLog:
* nptl/tst-eintr1.c (tf1): Add return statement.
(do_test): Remove unused th variable.
diff --git a/nptl/tst-eintr1.c b/nptl/tst-eintr1.c
index b60b796d61..256f5e94f8 100644
--- a/nptl/tst-eintr1.c
+++ b/nptl/tst-eintr1.c
@@ -43,6 +43,7 @@ tf1 (void *arg)
pthread_t th = xpthread_create (NULL, tf2, NULL);
xpthread_join (th);
}
+ return NULL;
}
@@ -54,7 +55,7 @@ do_test (void)
int i;
for (i = 0; i < 10; ++i)
{
- pthread_t th = xpthread_create (NULL, tf1, NULL);
+ xpthread_create (NULL, tf1, NULL);
}
delayed_exit (3);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix build warnings in nptl/tst-eintr1.c
2019-06-25 13:15 [PATCH] Fix build warnings in nptl/tst-eintr1.c Stefan Liebler
@ 2019-06-25 13:19 ` Florian Weimer
2019-06-25 13:33 ` Stefan Liebler
0 siblings, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2019-06-25 13:19 UTC (permalink / raw
To: Stefan Liebler; +Cc: GNU C Library
* Stefan Liebler:
> diff --git a/nptl/tst-eintr1.c b/nptl/tst-eintr1.c
> index b60b796d61..256f5e94f8 100644
> --- a/nptl/tst-eintr1.c
> +++ b/nptl/tst-eintr1.c
> @@ -43,6 +43,7 @@ tf1 (void *arg)
> pthread_t th = xpthread_create (NULL, tf2, NULL);
> xpthread_join (th);
> }
> + return NULL;
> }
>
>
> @@ -54,7 +55,7 @@ do_test (void)
> int i;
> for (i = 0; i < 10; ++i)
> {
> - pthread_t th = xpthread_create (NULL, tf1, NULL);
> + xpthread_create (NULL, tf1, NULL);
> }
Looks good. But you could remove the braces from the for loop, too.
Thanks,
Florian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix build warnings in nptl/tst-eintr1.c
2019-06-25 13:19 ` Florian Weimer
@ 2019-06-25 13:33 ` Stefan Liebler
2019-06-26 10:32 ` Stefan Liebler
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Liebler @ 2019-06-25 13:33 UTC (permalink / raw
To: Florian Weimer; +Cc: GNU C Library
On 6/25/19 3:19 PM, Florian Weimer wrote:
> * Stefan Liebler:
>
>> diff --git a/nptl/tst-eintr1.c b/nptl/tst-eintr1.c
>> index b60b796d61..256f5e94f8 100644
>> --- a/nptl/tst-eintr1.c
>> +++ b/nptl/tst-eintr1.c
>> @@ -43,6 +43,7 @@ tf1 (void *arg)
>> pthread_t th = xpthread_create (NULL, tf2, NULL);
>> xpthread_join (th);
>> }
>> + return NULL;
>> }
>>
>>
>> @@ -54,7 +55,7 @@ do_test (void)
>> int i;
>> for (i = 0; i < 10; ++i)
>> {
>> - pthread_t th = xpthread_create (NULL, tf1, NULL);
>> + xpthread_create (NULL, tf1, NULL);
>> }
>
> Looks good. But you could remove the braces from the for loop, too.
Okay. That's no problem. If no one opposes, I'll commit the patch
tomorrow without the braces.
>
> Thanks,
> Florian
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix build warnings in nptl/tst-eintr1.c
2019-06-25 13:33 ` Stefan Liebler
@ 2019-06-26 10:32 ` Stefan Liebler
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Liebler @ 2019-06-26 10:32 UTC (permalink / raw
To: libc-alpha
On 6/25/19 3:33 PM, Stefan Liebler wrote:
> On 6/25/19 3:19 PM, Florian Weimer wrote:
>> * Stefan Liebler:
>>
>>> diff --git a/nptl/tst-eintr1.c b/nptl/tst-eintr1.c
>>> index b60b796d61..256f5e94f8 100644
>>> --- a/nptl/tst-eintr1.c
>>> +++ b/nptl/tst-eintr1.c
>>> @@ -43,6 +43,7 @@ tf1 (void *arg)
>>> pthread_t th = xpthread_create (NULL, tf2, NULL);
>>> xpthread_join (th);
>>> }
>>> + return NULL;
>>> }
>>> @@ -54,7 +55,7 @@ do_test (void)
>>> int i;
>>> for (i = 0; i < 10; ++i)
>>> {
>>> - pthread_t th = xpthread_create (NULL, tf1, NULL);
>>> + xpthread_create (NULL, tf1, NULL);
>>> }
>>
>> Looks good. But you could remove the braces from the for loop, too.
> Okay. That's no problem. If no one opposes, I'll commit the patch
> tomorrow without the braces.
>>
>> Thanks,
>> Florian
>>
>
Committed.
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-06-26 10:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-25 13:15 [PATCH] Fix build warnings in nptl/tst-eintr1.c Stefan Liebler
2019-06-25 13:19 ` Florian Weimer
2019-06-25 13:33 ` Stefan Liebler
2019-06-26 10:32 ` 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).