Commit 454f8b2b by Martin Liska Committed by Martin Liska

Fix -Wreturn-type fallout.

2017-11-06  Martin Liska  <mliska@suse.cz>

	* c-c++-common/cilk-plus/AN/pr57541-2.c (foo1): Return a value
	for functions with non-void return type, or change type to void,
	or add -Wno-return-type for test.
	(foo2): Likewise.
	* c-c++-common/cilk-plus/AN/pr57541.c (foo): Likewise.
	(foo1): Likewise.
	* c-c++-common/cilk-plus/CK/errors.c: Likewise.
	* c-c++-common/cilk-plus/CK/pr60197.c: Likewise.
	* c-c++-common/cilk-plus/CK/spawn_in_return.c: Likewise.
	* c-c++-common/fold-masked-cmp-1.c (test_pic): Likewise.
	(test_exe): Likewise.
	* c-c++-common/fold-masked-cmp-2.c (test_exe): Likewise.
	* g++.dg/cilk-plus/AN/builtin_fn_mutating_tplt.cc (my_func): Likewise.
	* g++.dg/cilk-plus/CK/pr68997.cc (fa2): Likewise.
	* g++.dg/eh/sighandle.C (dosegv): Likewise.
	* g++.dg/ext/vector14.C (foo): Likewise.
	(main): Likewise.
	* g++.dg/graphite/pr41305.C: Likewise.
	* g++.dg/graphite/pr42930.C: Likewise.
	* g++.dg/opt/pr46640.C (struct QBasicAtomicInt): Likewise.
	(makeDir): Likewise.
	* g++.dg/other/i386-8.C (foo): Likewise.
	* g++.dg/pr45788.C: Likewise.
	* g++.dg/pr64688.C (at_c): Likewise.
	* g++.dg/pr65032.C (G::DecodeVorbis): Likewise.
	* g++.dg/pr71633.C (c3::fn2): Likewise.
	* g++.dg/stackprotectexplicit2.C (A): Likewise.
	* g++.old-deja/g++.law/weak.C (main): Likewise.
2017-11-06  Martin Liska  <mliska@suse.cz>

	* testsuite/libgomp.c++/loop-2.C: Return a value
	for functions with non-void return type, or change type to void,
	or add -Wno-return-type for test.
	* testsuite/libgomp.c++/loop-4.C: Likewise.
	* testsuite/libgomp.c++/parallel-1.C: Likewise.
	* testsuite/libgomp.c++/shared-1.C: Likewise.
	* testsuite/libgomp.c++/single-1.C: Likewise.
	* testsuite/libgomp.c++/single-2.C: Likewise.
2017-11-06  Martin Liska  <mliska@suse.cz>

	* testsuite/27_io/basic_fstream/cons/char/path.cc (main):
	  Return a value for functions with non-void return type,
	  or change type to void, or add -Wno-return-type for test.
	* testsuite/27_io/basic_ifstream/cons/char/path.cc (main):
	Likewise.
	* testsuite/27_io/basic_ofstream/open/char/path.cc (main):
	Likewise.

From-SVN: r254451
parent 98910bc2
2017-11-06 Martin Liska <mliska@suse.cz>
* c-c++-common/cilk-plus/AN/pr57541-2.c (foo1): Return a value
for functions with non-void return type, or change type to void,
or add -Wno-return-type for test.
(foo2): Likewise.
* c-c++-common/cilk-plus/AN/pr57541.c (foo): Likewise.
(foo1): Likewise.
* c-c++-common/cilk-plus/CK/errors.c: Likewise.
* c-c++-common/cilk-plus/CK/pr60197.c: Likewise.
* c-c++-common/cilk-plus/CK/spawn_in_return.c: Likewise.
* c-c++-common/fold-masked-cmp-1.c (test_pic): Likewise.
(test_exe): Likewise.
* c-c++-common/fold-masked-cmp-2.c (test_exe): Likewise.
* g++.dg/cilk-plus/AN/builtin_fn_mutating_tplt.cc (my_func): Likewise.
* g++.dg/cilk-plus/CK/pr68997.cc (fa2): Likewise.
* g++.dg/eh/sighandle.C (dosegv): Likewise.
* g++.dg/ext/vector14.C (foo): Likewise.
(main): Likewise.
* g++.dg/graphite/pr41305.C: Likewise.
* g++.dg/graphite/pr42930.C: Likewise.
* g++.dg/opt/pr46640.C (struct QBasicAtomicInt): Likewise.
(makeDir): Likewise.
* g++.dg/other/i386-8.C (foo): Likewise.
* g++.dg/pr45788.C: Likewise.
* g++.dg/pr64688.C (at_c): Likewise.
* g++.dg/pr65032.C (G::DecodeVorbis): Likewise.
* g++.dg/pr71633.C (c3::fn2): Likewise.
* g++.dg/stackprotectexplicit2.C (A): Likewise.
* g++.old-deja/g++.law/weak.C (main): Likewise.
2017-11-06 Eric Botcazou <ebotcazou@adacore.com> 2017-11-06 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/gcov: New directory. * gnat.dg/gcov: New directory.
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fcilkplus" } */ /* { dg-options "-fcilkplus" } */
int foo1 () void foo1 ()
{ {
int a; int a;
a = __sec_reduce_add (1); /* { dg-error "Invalid builtin arguments" } */ a = __sec_reduce_add (1); /* { dg-error "Invalid builtin arguments" } */
} }
int foo2 () void foo2 ()
{ {
int a; int a;
a = __sec_reduce_add (); /* { dg-error "Invalid builtin arguments" } */ a = __sec_reduce_add (); /* { dg-error "Invalid builtin arguments" } */
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
int A[10]; int A[10];
int foo () { void foo () {
/* C compiler uses the term "undeclared" whereas C++ compiler uses /* C compiler uses the term "undeclared" whereas C++ compiler uses
"not declared". Thus, grepping for declared seem to be the easiest. */ "not declared". Thus, grepping for declared seem to be the easiest. */
char c = (char)N; /* { dg-error "declared" } */ char c = (char)N; /* { dg-error "declared" } */
...@@ -15,12 +14,8 @@ int foo () { ...@@ -15,12 +14,8 @@ int foo () {
A[l:s:c]; A[l:s:c];
} }
int foo1 (int N) { void foo1 (int N) {
char c = (char)N; char c = (char)N;
short s = (short)N; short s = (short)N;
A[l:s:c]; /* { dg-error "declared" } */ A[l:s:c]; /* { dg-error "declared" } */
} }
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fcilkplus" } */ /* { dg-options "-fcilkplus -Wno-return-type" } */
int func_2(void); int func_2(void);
......
/* PR c/60197 */ /* PR c/60197 */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fcilkplus" } */ /* { dg-options "-fcilkplus -Wno-return-type" } */
extern int foo (void); extern int foo (void);
extern int bar (int); extern int bar (int);
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fcilkplus" } */ /* { dg-options "-fcilkplus -Wno-return-type" } */
int main (void) int main (void)
{ {
......
...@@ -29,13 +29,15 @@ int result; ...@@ -29,13 +29,15 @@ int result;
void test_pic (struct bfd_link_info *info) void test_pic (struct bfd_link_info *info)
{ {
if (bfd_link_pic (info)) if (bfd_link_pic (info))
result++; result++;
} }
int test_exe (struct bfd_link_info *info) int test_exe (struct bfd_link_info *info)
{ {
if (bfd_link_executable (info)) if (bfd_link_executable (info))
result++; result++;
return 0;
} }
/* { dg-final { scan-assembler-times "testn?b" 2 } } */ /* { dg-final { scan-assembler-times "testn?b" 2 } } */
...@@ -36,6 +36,8 @@ int test_exe (struct bfd_link_info *info) ...@@ -36,6 +36,8 @@ int test_exe (struct bfd_link_info *info)
{ {
if (bfd_link_executable (info)) if (bfd_link_executable (info))
result++; result++;
return 0;
} }
/* { dg-final { scan-assembler-times "testn?b" 2 } } */ /* { dg-final { scan-assembler-times "testn?b" 2 } } */
......
...@@ -15,6 +15,8 @@ T my_func (T *x, T y) ...@@ -15,6 +15,8 @@ T my_func (T *x, T y)
*x = y; *x = y;
else else
*x = *x; *x = *x;
return T();
} }
template <class T> T my_func (T *x, T y); template <class T> T my_func (T *x, T y);
......
...@@ -16,7 +16,7 @@ struct A2 { ...@@ -16,7 +16,7 @@ struct A2 {
}; };
A2 fa2 () { A2 fa2 () {
A2 (); return A2 ();
} }
struct B1 { struct B1 {
......
...@@ -12,6 +12,7 @@ void sighandler (int signo, siginfo_t * si, void * uc) ...@@ -12,6 +12,7 @@ void sighandler (int signo, siginfo_t * si, void * uc)
char * dosegv () char * dosegv ()
{ {
* ((volatile int *)0) = 12; * ((volatile int *)0) = 12;
return 0;
} }
int main () int main ()
......
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
#define vector __attribute__((vector_size(16))) #define vector __attribute__((vector_size(16)))
template<int N> vector signed int foo (vector float value) {} template<int N> vector signed int foo (vector float value)
{
vector signed int a;
return a;
}
template<int> void foo (float) {} template<int> void foo (float) {}
...@@ -19,4 +23,6 @@ main () ...@@ -19,4 +23,6 @@ main ()
float f; float f;
foo<1> (v); foo<1> (v);
foo<1> (f); foo<1> (f);
return 0;
} }
// { dg-do compile } // { dg-do compile }
// { dg-options "-O3 -floop-interchange -Wno-conversion-null" } // { dg-options "-O3 -floop-interchange -Wno-conversion-null -Wno-return-type" }
void __throw_bad_alloc (); void __throw_bad_alloc ();
......
/* { dg-options "-O1 -floop-block" } */ /* { dg-options "-O1 -floop-block -Wno-return-type" } */
typedef unsigned char byte; typedef unsigned char byte;
typedef unsigned int uint; typedef unsigned int uint;
......
...@@ -7,6 +7,7 @@ struct QBasicAtomicInt ...@@ -7,6 +7,7 @@ struct QBasicAtomicInt
bool deref () bool deref ()
{ {
asm volatile ("":"=m" (i), "=qm" (j)); asm volatile ("":"=m" (i), "=qm" (j));
return true;
} }
}; };
...@@ -41,4 +42,6 @@ bool makeDir (unsigned len) ...@@ -41,4 +42,6 @@ bool makeDir (unsigned len)
return false; return false;
i = pos; i = pos;
} }
return true;
} }
...@@ -19,4 +19,6 @@ foo (float *x, short *y) ...@@ -19,4 +19,6 @@ foo (float *x, short *y)
__m64 c = _mm_cvtps_pi16 (b); __m64 c = _mm_cvtps_pi16 (b);
__builtin_memcpy (y, &c, sizeof (short) * 4); __builtin_memcpy (y, &c, sizeof (short) * 4);
y[0] = bar (y[0]); y[0] = bar (y[0]);
return 0;
} }
// { dg-do compile { target i?86-*-* x86_64-*-* } } // { dg-do compile { target i?86-*-* x86_64-*-* } }
// { dg-options "-O3 -fwhole-program -msse2" } // { dg-options "-O3 -fwhole-program -msse2 -Wno-return-type" }
typedef long unsigned int __darwin_size_t; typedef long unsigned int __darwin_size_t;
typedef __darwin_size_t size_t; typedef __darwin_size_t size_t;
......
...@@ -24,7 +24,10 @@ template <typename> struct F; ...@@ -24,7 +24,10 @@ template <typename> struct F;
template <typename> struct G; template <typename> struct G;
template <typename, typename, int> struct H; template <typename, typename, int> struct H;
template <typename Element, typename Layout> struct H<Element, Layout, 3> {}; template <typename Element, typename Layout> struct H<Element, Layout, 3> {};
template <int, typename E, typename L, int N> unsigned char at_c(H<E, L, N>) {} template <int, typename E, typename L, int N> unsigned char at_c(H<E, L, N>)
{
return 0;
}
template <typename> class I; template <typename> class I;
template <typename> class J; template <typename> class J;
template <typename> class K; template <typename> class K;
......
...@@ -84,4 +84,6 @@ G::DecodeVorbis (int *p1) ...@@ -84,4 +84,6 @@ G::DecodeVorbis (int *p1)
mDecodedAudioFrames -= b; mDecodedAudioFrames -= b;
fn2 (b); fn2 (b);
} }
return nsresult();
} }
...@@ -20,6 +20,7 @@ class c3 : c1, c2 ...@@ -20,6 +20,7 @@ class c3 : c1, c2
int *c3::fn2 () const int *c3::fn2 () const
{ {
return 0;
} }
int *c3::fn3 (int p) const int *c3::fn3 (int p) const
......
...@@ -7,6 +7,7 @@ int A() ...@@ -7,6 +7,7 @@ int A()
{ {
int A[23]; int A[23];
char b[22]; char b[22];
return 0;
} }
int __attribute__((stack_protect)) B() int __attribute__((stack_protect)) B()
...@@ -24,4 +25,4 @@ int __attribute__((stack_protect)) c() ...@@ -24,4 +25,4 @@ int __attribute__((stack_protect)) c()
} }
/* { dg-final { scan-assembler-times "stack_chk_fail" 2 } } */ /* { dg-final { scan-assembler-times "stack_chk_fail" 2 } } */
\ No newline at end of file
...@@ -11,10 +11,12 @@ ...@@ -11,10 +11,12 @@
std::istream x (0); std::istream x (0);
int
main () { main () {
x.get(); x.get();
std::putc(0, 0); std::putc(0, 0);
std::fgets(0, 0, 0); std::fgets(0, 0, 0);
x.get((char*) 0, 0); x.get((char*) 0, 0);
return 0;
} }
2017-11-06 Martin Liska <mliska@suse.cz>
* testsuite/libgomp.c++/loop-2.C: Return a value
for functions with non-void return type, or change type to void,
or add -Wno-return-type for test.
* testsuite/libgomp.c++/loop-4.C: Likewise.
* testsuite/libgomp.c++/parallel-1.C: Likewise.
* testsuite/libgomp.c++/shared-1.C: Likewise.
* testsuite/libgomp.c++/single-1.C: Likewise.
* testsuite/libgomp.c++/single-2.C: Likewise.
2017-10-31 Tom de Vries <tom@codesourcery.com> 2017-10-31 Tom de Vries <tom@codesourcery.com>
* plugin/plugin-hsa.c (HSA_LOG): Remove semicolon after * plugin/plugin-hsa.c (HSA_LOG): Remove semicolon after
......
...@@ -15,6 +15,7 @@ void parloop (int *a) ...@@ -15,6 +15,7 @@ void parloop (int *a)
a[i] = i + 3; a[i] = i + 3;
} }
int
main() main()
{ {
int i, a[N]; int i, a[N];
......
extern "C" void abort (void); extern "C" void abort (void);
int
main() main()
{ {
int i, a; int i, a;
......
...@@ -8,6 +8,7 @@ foo (void) ...@@ -8,6 +8,7 @@ foo (void)
return 10; return 10;
} }
int
main () main ()
{ {
int A = 0; int A = 0;
......
...@@ -53,6 +53,7 @@ parallel (int a, int b) ...@@ -53,6 +53,7 @@ parallel (int a, int b)
abort (); abort ();
} }
int
main() main()
{ {
parallel (1, 2); parallel (1, 2);
......
extern "C" void abort (void); extern "C" void abort (void);
int
main() main()
{ {
int i = 0; int i = 0;
......
...@@ -7,6 +7,7 @@ struct X ...@@ -7,6 +7,7 @@ struct X
int c; int c;
}; };
int
main() main()
{ {
int i = 0; int i = 0;
......
2017-11-06 Martin Liska <mliska@suse.cz>
* testsuite/27_io/basic_fstream/cons/char/path.cc (main):
Return a value for functions with non-void return type,
or change type to void, or add -Wno-return-type for test.
* testsuite/27_io/basic_ifstream/cons/char/path.cc (main):
Likewise.
* testsuite/27_io/basic_ofstream/open/char/path.cc (main):
Likewise.
2017-11-06 Paolo Carlini <paolo.carlini@oracle.com> 2017-11-06 Paolo Carlini <paolo.carlini@oracle.com>
* testsuite/20_util/optional/cons/deduction.cc: Avoid -Wreturn-type * testsuite/20_util/optional/cons/deduction.cc: Avoid -Wreturn-type
......
...@@ -45,4 +45,5 @@ main() ...@@ -45,4 +45,5 @@ main()
{ {
test01(); test01();
test02(); test02();
return 0;
} }
...@@ -45,4 +45,5 @@ main() ...@@ -45,4 +45,5 @@ main()
{ {
test01(); test01();
test02(); test02();
return 0;
} }
...@@ -47,4 +47,5 @@ main() ...@@ -47,4 +47,5 @@ main()
{ {
test01(); test01();
test02(); test02();
return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment