Patchwork [FORTRAN] Variable "value" possibly unused in io/read.c

login
register
mail settings
Submitter David Edelsohn
Date May 4, 2013, 9:06 p.m.
Message ID <CAGWvnykEhW6pUMWNgjqk4X3nFPevKfRpQ44tX6Vp15=hOy2d9g@mail.gmail.com>
Download mbox | patch
Permalink /patch/241479/
State New
Headers show

Comments

David Edelsohn - May 4, 2013, 9:06 p.m.
All uses of "value" are protected by

#if defined HAVE_GFC_REAL_16 || defined HAVE_GFC_REAL_10

so it may be unused, which generates a warning on some platforms.

Bootstrapped on powerpc-ibm-aix7.1.0.0.

Okay for trunk?

Thanks, David


       * io/read.c (si_max): Annotate value with attribute unused.
Tobias Burnus - May 4, 2013, 9:14 p.m.
David Edelsohn wrote:
> All uses of "value" are protected by
> #if defined HAVE_GFC_REAL_16 || defined HAVE_GFC_REAL_10
> so it may be unused, which generates a warning on some platforms.
>
> Bootstrapped on powerpc-ibm-aix7.1.0.0.
> Okay for trunk?
>
>         * io/read.c (si_max): Annotate value with attribute unused.

I think using

#if defined HAVE_GFC_REAL_16 || defined HAVE_GFC_REAL_10
   GFC_UINTEGER_LARGEST value;
#endif

is cleaner than using the unused attribute.

OK with that change. And thanks for the the cleanup!

Tobias

> Index: io/read.c
> ===================================================================
> --- io/read.c   (revision 198587)
> +++ io/read.c   (working copy)
> @@ -91,7 +91,7 @@
>   GFC_UINTEGER_LARGEST
>   si_max (int length)
>   {
> -  GFC_UINTEGER_LARGEST value;
> +  GFC_UINTEGER_LARGEST value __attribute__((unused));
>
>     switch (length)
>         {
>

Patch

Index: io/read.c
===================================================================
--- io/read.c   (revision 198587)
+++ io/read.c   (working copy)
@@ -91,7 +91,7 @@ 
 GFC_UINTEGER_LARGEST
 si_max (int length)
 {
-  GFC_UINTEGER_LARGEST value;
+  GFC_UINTEGER_LARGEST value __attribute__((unused));

   switch (length)
       {