Add prototype for printf() and make type of "string" array be "char" in

order to avoid compile time warnings.
This commit is contained in:
Nick Clifton 2005-01-04 10:13:02 +00:00
parent 196e804018
commit c9bc3b3d29
2 changed files with 12 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2005-01-04 Martin Koegler <mkoegler@auto.tuwien.ac.at>
* binutils-all/testprog.c: Add prototype for printf() and make
type of "string" array be "char" in order to avoid compile time
warnings.
2004-12-31 Alan Modra <amodra@bigpond.net.au> 2004-12-31 Alan Modra <amodra@bigpond.net.au>
* binutils-all/readelf.ss: Allow for both .rel and .rela sections. * binutils-all/readelf.ss: Allow for both .rel and .rela sections.

View file

@ -1,20 +1,21 @@
/* This program is used to test objcopy, readelf and strip. */ /* This program is used to test objcopy, readelf and strip. */
extern int strcmp (char *, const char *); extern int strcmp (char *, const char *);
extern int printf (const char *, ...);
int common; int common;
int global = 1; int global = 1;
static int local = 2; static int local = 2;
static unsigned char string[] = "string"; static char string[] = "string";
int int
fn () fn (void)
{ {
return 3; return 3;
} }
int int
main () main (void)
{ {
if (common != 0 if (common != 0
|| global != 1 || global != 1
@ -22,9 +23,9 @@ main ()
|| strcmp (string, "string") != 0) || strcmp (string, "string") != 0)
{ {
printf ("failed\n"); printf ("failed\n");
return (1); return 1;
} }
printf ("ok\n"); printf ("ok\n");
return (0); return 0;
} }