1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

tests: fix warn unused results

With fortification enabled, few function calls return result need to be
checked, has they get the __wur macro enabled.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
Frédéric Bérat
2023-06-01 16:27:47 +02:00
committed by Siddhesh Poyarekar
parent a952fcda58
commit 29e25f6f13
11 changed files with 60 additions and 22 deletions

View File

@@ -7,16 +7,16 @@ main (void)
int i;
int lost = 0;
scanf ("%2s", buf);
lost = (scanf ("%2s", buf) < 0);
lost |= (buf[0] != 'X' || buf[1] != 'Y' || buf[2] != '\0');
if (lost)
puts ("test of %2s failed.");
scanf (" ");
scanf ("%d", &i);
lost |= (scanf (" ") < 0);
lost |= (scanf ("%d", &i) < 0);
lost |= (i != 1234);
if (lost)
puts ("test of %d failed.");
scanf ("%c", buf);
lost |= (scanf ("%c", buf) < 0);
lost |= (buf[0] != 'L');
if (lost)
puts ("test of %c failed.\n");