Make libgcc1-test.c compile without warnings
authorMichael Meissner <meissner@cygnus.com>
Tue, 5 Oct 1999 23:07:09 +0000 (23:07 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Tue, 5 Oct 1999 23:07:09 +0000 (23:07 +0000)
From-SVN: r29832

gcc/ChangeLog
gcc/libgcc1-test.c

index 261079c36135c33341ade1c7d0c1ed6db640a3d2..2a249a0aa50f9e2c923e7646b89a59d34f20d549 100644 (file)
@@ -1,4 +1,10 @@
-Tue Oct  5 15:37:04 1999  Michael Meissner  <meissner@cygnus.com>
+Tue Oct  5 16:14:40 1999  Michael Meissner  <meissner@cygnus.com>
+
+       * libgcc1-test.c (toplevel): Include stddef.h to get size_t.
+       ({,d}discard): Add forward declarations.  Declare parameter as
+       unused.
+       (main_without_main): Explicitly declare return type to be int.
+       (memcpy): Properly declare.
 
        * libgcc2.c (toplevel): If inhibit_libc is defined and not
        building the trampoline support, declare malloc, free, and
index d9c250e99d0087db359c0b16d6e6c12d0b69451f..67c7639deeac60a5b90f5b693abf5d9d9e3cd1d8 100644 (file)
@@ -3,12 +3,17 @@
    you have provided replacements for all the libgcc1.c functions that
    your target machine needs.  */
 
+#include <stddef.h>
+
 int foo ();
 double dfoo ();
+void discard (int);
+void ddiscard (double);
 
 /* We don't want __main here because that can drag in atexit (among other
    things) which won't necessarily exist yet.  */
 
+int
 main_without__main ()
 {
   int a = foo (), b = foo ();
@@ -65,14 +70,17 @@ main_without__main ()
   return 0;
 }
 
+void
 discard (x)
-     int x;
+     int x __attribute__((__unused__));
 {}
 
+void
 ddiscard (x)
-     double x;
+     double x __attribute__((__unused__));
 {}
 
+int
 foo ()
 {
   static int table[] = {20, 69, 4, 12};
@@ -98,7 +106,12 @@ extern void _start() __asm__("_start");
 extern void __start() __asm__("__start");
 
 /* Provide functions that might be needed by soft-float emulation routines.  */
-void memcpy() {}
+void *memcpy(void *to,
+            const void *from __attribute__((__unused__)),
+            size_t len __attribute__((__unused__)))
+{
+  return to;
+}
 
 void start() {}
 void _start() {}