]> git.efficios.com Git - deliverable/binutils-gdb.git/commitdiff
Fix testcases compilation failures due to unused variables.
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 17 Sep 2008 07:43:49 +0000 (07:43 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 17 Sep 2008 07:43:49 +0000 (07:43 +0000)
* ld-elfcomm/common1b.c (dummy1): Mark the variable for GCC as USED.
* ld-shared/main.c (main): Move the P variable only to the places where
it is used.

ld/testsuite/ChangeLog
ld/testsuite/ld-elfcomm/common1b.c
ld/testsuite/ld-shared/main.c

index cc898e6313e8350640cc4b4f6bb4cbea5c4f1569..8065033223a2747e70095ad9d0ed04551df907da 100644 (file)
@@ -1,3 +1,10 @@
+2008-09-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Fix testcases compilation failures due to unused variables.
+       * ld-elfcomm/common1b.c (dummy1): Mark the variable for GCC as USED.
+       * ld-shared/main.c (main): Move the P variable only to the places where
+       it is used.
+
 2008-09-16  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/6877
index 4ed9e039c0ed06841a306cd84dace623b3ead957..a375c90247104ace6d20dc9b2a41ad5f76da6547 100644 (file)
@@ -1,3 +1,7 @@
-static char dummy1 = 'X';
+static
+#if     __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
+  __attribute__((__used__))
+#endif  /* __GNUC__ */
+  char dummy1 = 'X';
 char foo1 [] = "Aligned at odd byte.";
 char foo2 [4];
index ce06261eb7ac57b1f84e10ff00e993c46ed4ba98..0817d2730a80a29a3ee29d1d32284fed6c837abf 100644 (file)
@@ -38,8 +38,6 @@ shlib_overriddencall2 ()
 int
 main ()
 {
-  int (*p) ();
-
   printf ("mainvar == %d\n", mainvar);
   printf ("overriddenvar == %d\n", overriddenvar);
   printf ("shlibvar1 == %d\n", shlibvar1);
@@ -62,21 +60,29 @@ main ()
   printf ("shlib_checkfunptr2 (main_called) == %d\n",
          shlib_checkfunptr2 (main_called));
 #endif
-  p = shlib_getfunptr1 ();
-  printf ("shlib_getfunptr1 () ");
-  if (p == shlib_shlibvar1)
-    printf ("==");
-  else
-    printf ("!=");
-  printf (" shlib_shlibvar1\n");
+  {
+    int (*p) ();
+
+    p = shlib_getfunptr1 ();
+    printf ("shlib_getfunptr1 () ");
+    if (p == shlib_shlibvar1)
+      printf ("==");
+    else
+      printf ("!=");
+    printf (" shlib_shlibvar1\n");
+  }
 #ifndef XCOFF_TEST
-  p = shlib_getfunptr2 ();
-  printf ("shlib_getfunptr2 () ");
-  if (p == main_called)
-    printf ("==");
-  else
-    printf ("!=");
-  printf (" main_called\n");
+  {
+    int (*p) ();
+
+    p = shlib_getfunptr2 ();
+    printf ("shlib_getfunptr2 () ");
+    if (p == main_called)
+      printf ("==");
+    else
+      printf ("!=");
+    printf (" main_called\n");
+  }
 #endif
 #endif
   printf ("shlib_check () == %d\n", shlib_check ());
This page took 0.029253 seconds and 4 git commands to generate.