diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-01 13:33:11 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-01 13:33:11 +0000 |
commit | a944f78c429515590b62c87db8ffe2660a111ffd (patch) | |
tree | d7953f4e908518a7557662d14866fda4cf962692 /gcc/testsuite/gcc.c-torture/execute/builtins | |
parent | 58e292f16c246d3565af35ec0b3f1c7a6b32bfb6 (diff) | |
download | gcc-a944f78c429515590b62c87db8ffe2660a111ffd.tar.gz |
* gcc.c-torture/execute/builtins/lib/strncat.c: Fix uninitialized var.
* gcc.c-torture/execute/builtins/lib/strpbrk.c: Fix discarded const.
* gcc.c-torture/execute/builtins/strlen-3.c: Fix uninitialized var.
* gcc.c-torture/execute/builtins/strncmp.c: Delete unused var.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97386 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/builtins')
4 files changed, 6 insertions, 4 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncat.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncat.c index 84f26260792..051dc46c723 100644 --- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncat.c +++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncat.c @@ -7,7 +7,7 @@ char * strncat (char *s1, const char *s2, size_t n) { char *dest = s1; - char c; + char c = '\0'; #ifdef __OPTIMIZE__ if (inside_main) abort(); diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strpbrk.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strpbrk.c index 1eb90ade5fb..f6bb0321020 100644 --- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strpbrk.c +++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strpbrk.c @@ -1,9 +1,10 @@ +extern void abort (void); extern int inside_main; char * strpbrk(const char *s1, const char *s2) { - char *p; + const char *p; #ifdef __OPTIMIZE__ if (inside_main) abort (); @@ -12,7 +13,7 @@ strpbrk(const char *s1, const char *s2) { for (p = s2; *p; p++) if (*s1 == *p) - return s1; + return (char *)s1; s1++; } return 0; diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/strlen-3.c b/gcc/testsuite/gcc.c-torture/execute/builtins/strlen-3.c index f912c0267db..74075fdd3c6 100644 --- a/gcc/testsuite/gcc.c-torture/execute/builtins/strlen-3.c +++ b/gcc/testsuite/gcc.c-torture/execute/builtins/strlen-3.c @@ -18,8 +18,10 @@ int x = 6; void main_test(void) { +#ifdef __OPTIMIZE__ const char *foo; int i; +#endif if (strlen (bar) != 13) abort (); diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/strncmp.c b/gcc/testsuite/gcc.c-torture/execute/builtins/strncmp.c index 888faf569e7..2c22b7d0112 100644 --- a/gcc/testsuite/gcc.c-torture/execute/builtins/strncmp.c +++ b/gcc/testsuite/gcc.c-torture/execute/builtins/strncmp.c @@ -14,7 +14,6 @@ main_test (void) { const char *const s1 = "hello world"; const char *s2, *s3; - int n = 6, x; if (strncmp (s1, "hello world", 12) != 0) abort(); |