This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] ld testsuite fixes


Hi!

I have noticed 2 ld tests fail with ERROR because of warnings when built
with recentish GCC.
The following patch fixes that, ok for HEAD?

2006-02-14  Jakub Jelinek  <jakub@redhat.com>

	* ld-shared/main.c (main): Prevent warnings about unused p.
	* ld-elfcomm/common1b.c (dummy1): Add __attribute__((__used__)) for
	GCC 3.3+.

--- ld/testsuite/ld-shared/main.c.jj	2001-07-11 15:48:54.000000000 +0200
+++ ld/testsuite/ld-shared/main.c	2006-02-14 10:07:08.000000000 +0100
@@ -40,6 +40,8 @@ main ()
 {
   int (*p) ();
 
+  p = (void *) 0;
+  (void) p;
   printf ("mainvar == %d\n", mainvar);
   printf ("overriddenvar == %d\n", overriddenvar);
   printf ("shlibvar1 == %d\n", shlibvar1);
--- ld/testsuite/ld-elfcomm/common1b.c.jj	2003-04-15 11:38:10.000000000 +0200
+++ ld/testsuite/ld-elfcomm/common1b.c	2006-02-14 10:11:19.000000000 +0100
@@ -1,3 +1,7 @@
-static char dummy1 = 'X';
+static char dummy1
+#if defined __GNUC__ && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
+  __attribute__((__used__))
+#endif
+  = 'X';
 char foo1 [] = "Aligned at odd byte.";
 char foo2 [4];

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]