762f774785
Several of the gdb.multi tests use the "nowarnings" option to suppress warnings. The warnings in question all come from missing headers, like e.g.: src/gdb/testsuite/gdb.multi/multi-arch-exec.c:28:3: warning: incompatible implicit declaration of built-in function 'exit' [enabled by default] exit (1); ^ There's no point in trying to avoid to include standard headers. In gdb.base/hangout.c's case, it's even dangerous, as that file calls printf. In order to compile a call to a variatic function correctly, a declaration must be visible. gdb/testsuite/ChangeLog: 2015-12-10 Pedro Alves <palves@redhat.com> * gdb.multi/base.exp: Don't use nowarnings. * gdb.multi/bkpt-multi-exec.exp: Don't use nowarnings. * gdb.multi/hangout.c: Include stdio.h. * gdb.multi/hello.c: Include stdlib.h. * gdb.multi/multi-arch-exec.c: Include stdlib.h. * gdb.multi/multi-arch-exec.exp: Don't use nowarnings. * gdb.multi/multi-arch.exp: Don't use nowarnings.
48 lines
1 KiB
C
48 lines
1 KiB
C
/* This testcase is part of GDB, the GNU debugger.
|
|
|
|
Copyright 2009-2015 Free Software Foundation, Inc.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
#include <stdlib.h>
|
|
|
|
short hglob = 1;
|
|
|
|
short glob = 92;
|
|
|
|
int commonfun() { bar(); } /* from hello */
|
|
|
|
bar()
|
|
{
|
|
if (glob == 0)
|
|
exit(1);
|
|
}
|
|
|
|
hello(int x)
|
|
{
|
|
x *= 2;
|
|
return x + 45;
|
|
}
|
|
|
|
main()
|
|
{
|
|
int tmpx;
|
|
|
|
bar();
|
|
tmpx = hello(glob);
|
|
commonfun();
|
|
glob = tmpx;
|
|
commonfun();
|
|
}
|
|
|