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
This commit is contained in:
Martin Liska 2017-11-06 14:41:35 +01:00 committed by Martin Liska
parent 98910bc2b9
commit 454f8b2b0c
33 changed files with 103 additions and 20 deletions

View File

@ -1,3 +1,34 @@
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>
* gnat.dg/gcov: New directory.

View File

@ -2,13 +2,13 @@
/* { dg-do compile } */
/* { dg-options "-fcilkplus" } */
int foo1 ()
void foo1 ()
{
int a;
a = __sec_reduce_add (1); /* { dg-error "Invalid builtin arguments" } */
}
int foo2 ()
void foo2 ()
{
int a;
a = __sec_reduce_add (); /* { dg-error "Invalid builtin arguments" } */

View File

@ -4,8 +4,7 @@
int A[10];
int foo () {
void foo () {
/* C compiler uses the term "undeclared" whereas C++ compiler uses
"not declared". Thus, grepping for declared seem to be the easiest. */
char c = (char)N; /* { dg-error "declared" } */
@ -15,12 +14,8 @@ int foo () {
A[l:s:c];
}
int foo1 (int N) {
void foo1 (int N) {
char c = (char)N;
short s = (short)N;
A[l:s:c]; /* { dg-error "declared" } */
}

View File

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-fcilkplus" } */
/* { dg-options "-fcilkplus -Wno-return-type" } */
int func_2(void);

View File

@ -1,6 +1,6 @@
/* PR c/60197 */
/* { dg-do compile } */
/* { dg-options "-fcilkplus" } */
/* { dg-options "-fcilkplus -Wno-return-type" } */
extern int foo (void);
extern int bar (int);

View File

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-fcilkplus" } */
/* { dg-options "-fcilkplus -Wno-return-type" } */
int main (void)
{

View File

@ -29,13 +29,15 @@ int result;
void test_pic (struct bfd_link_info *info)
{
if (bfd_link_pic (info))
result++;
result++;
}
int test_exe (struct bfd_link_info *info)
{
if (bfd_link_executable (info))
result++;
return 0;
}
/* { dg-final { scan-assembler-times "testn?b" 2 } } */

View File

@ -36,6 +36,8 @@ int test_exe (struct bfd_link_info *info)
{
if (bfd_link_executable (info))
result++;
return 0;
}
/* { dg-final { scan-assembler-times "testn?b" 2 } } */

View File

@ -15,6 +15,8 @@ T my_func (T *x, T y)
*x = y;
else
*x = *x;
return T();
}
template <class T> T my_func (T *x, T y);

View File

@ -16,7 +16,7 @@ struct A2 {
};
A2 fa2 () {
A2 ();
return A2 ();
}
struct B1 {

View File

@ -12,6 +12,7 @@ void sighandler (int signo, siginfo_t * si, void * uc)
char * dosegv ()
{
* ((volatile int *)0) = 12;
return 0;
}
int main ()

View File

@ -8,7 +8,11 @@
#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) {}
@ -19,4 +23,6 @@ main ()
float f;
foo<1> (v);
foo<1> (f);
return 0;
}

View File

@ -1,5 +1,5 @@
// { 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 ();

View File

@ -1,4 +1,4 @@
/* { dg-options "-O1 -floop-block" } */
/* { dg-options "-O1 -floop-block -Wno-return-type" } */
typedef unsigned char byte;
typedef unsigned int uint;

View File

@ -7,6 +7,7 @@ struct QBasicAtomicInt
bool deref ()
{
asm volatile ("":"=m" (i), "=qm" (j));
return true;
}
};
@ -41,4 +42,6 @@ bool makeDir (unsigned len)
return false;
i = pos;
}
return true;
}

View File

@ -19,4 +19,6 @@ foo (float *x, short *y)
__m64 c = _mm_cvtps_pi16 (b);
__builtin_memcpy (y, &c, sizeof (short) * 4);
y[0] = bar (y[0]);
return 0;
}

View File

@ -1,5 +1,5 @@
// { 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 __darwin_size_t size_t;

View File

@ -24,7 +24,10 @@ template <typename> struct F;
template <typename> struct G;
template <typename, typename, int> struct H;
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 J;
template <typename> class K;

View File

@ -84,4 +84,6 @@ G::DecodeVorbis (int *p1)
mDecodedAudioFrames -= b;
fn2 (b);
}
return nsresult();
}

View File

@ -20,6 +20,7 @@ class c3 : c1, c2
int *c3::fn2 () const
{
return 0;
}
int *c3::fn3 (int p) const

View File

@ -7,6 +7,7 @@ int A()
{
int A[23];
char b[22];
return 0;
}
int __attribute__((stack_protect)) B()
@ -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 } } */

View File

@ -11,10 +11,12 @@
std::istream x (0);
int
main () {
x.get();
std::putc(0, 0);
std::fgets(0, 0, 0);
x.get((char*) 0, 0);
return 0;
}

View File

@ -1,3 +1,14 @@
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>
* plugin/plugin-hsa.c (HSA_LOG): Remove semicolon after

View File

@ -15,6 +15,7 @@ void parloop (int *a)
a[i] = i + 3;
}
int
main()
{
int i, a[N];

View File

@ -1,5 +1,6 @@
extern "C" void abort (void);
int
main()
{
int i, a;

View File

@ -8,6 +8,7 @@ foo (void)
return 10;
}
int
main ()
{
int A = 0;

View File

@ -53,6 +53,7 @@ parallel (int a, int b)
abort ();
}
int
main()
{
parallel (1, 2);

View File

@ -1,5 +1,6 @@
extern "C" void abort (void);
int
main()
{
int i = 0;

View File

@ -7,6 +7,7 @@ struct X
int c;
};
int
main()
{
int i = 0;

View File

@ -1,3 +1,13 @@
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>
* testsuite/20_util/optional/cons/deduction.cc: Avoid -Wreturn-type

View File

@ -45,4 +45,5 @@ main()
{
test01();
test02();
return 0;
}

View File

@ -45,4 +45,5 @@ main()
{
test01();
test02();
return 0;
}

View File

@ -47,4 +47,5 @@ main()
{
test01();
test02();
return 0;
}