public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/22423] Warnings when building libgfortran
Date: Thu, 18 Oct 2007 13:22:00 -0000	[thread overview]
Message-ID: <20071018132240.32609.qmail@sourceware.org> (raw)
In-Reply-To: <bug-22423-10258@http.gcc.gnu.org/bugzilla/>



------- Comment #14 from fxcoudert at gcc dot gnu dot org  2007-10-18 13:22 -------
(In reply to comment #13)
> ../../../libgfortran/runtime/environ.c:312: warning: 'init_choice' defined but
> not used
> ../../../libgfortran/runtime/environ.c:339: warning: 'show_choice' defined but
> not used

These two have been removed by Ben Elliston.

> ../../../libgfortran/runtime/backtrace.c:66: warning: 'local_strcasestr'
> defined but not used

Fixed by the following:

Index: runtime/backtrace.c
===================================================================
--- runtime/backtrace.c (revision 129403)
+++ runtime/backtrace.c (working copy)
@@ -60,7 +60,18 @@ Boston, MA 02110-1301, USA.  */
 #include <ctype.h>


+/* Macros for common sets of capabilities: can we fork and exec, can
+   we use glibc-style backtrace functions, and can we use pipes.  */
+#define CAN_FORK (defined(HAVE_FORK) && defined(HAVE_EXECVP) \
+                 && defined(HAVE_WAIT))
+#define GLIBC_BACKTRACE (defined(HAVE_BACKTRACE) \
+                        && defined(HAVE_BACKTRACE_SYMBOLS))
+#define CAN_PIPE (CAN_FORK && defined(HAVE_PIPE) \
+                 && defined(HAVE_DUP2) && defined(HAVE_FDOPEN) \
+                 && defined(HAVE_CLOSE))

+
+#if GLIBC_BACKTRACE && CAN_PIPE
 static char *
 local_strcasestr (const char *s1, const char *s2)
 {
@@ -85,14 +96,7 @@ local_strcasestr (const char *s1, const
     }
 #endif
 }
-
-#define CAN_FORK (defined(HAVE_FORK) && defined(HAVE_EXECVP) \
-                 && defined(HAVE_WAIT))
-#define GLIBC_BACKTRACE (defined(HAVE_BACKTRACE) \
-                        && defined(HAVE_BACKTRACE_SYMBOLS))
-#define CAN_PIPE (CAN_FORK && defined(HAVE_PIPE) \
-                 && defined(HAVE_DUP2) && defined(HAVE_FDOPEN) \
-                 && defined(HAVE_CLOSE))
+#endif


 #if GLIBC_BACKTRACE


> ../../../libgfortran/runtime/main.c:179: warning: passing argument 1 of 'free'
> discards qualifiers from pointer target type

Fixed by:

Index: runtime/main.c
===================================================================
--- runtime/main.c      (revision 129403)
+++ runtime/main.c      (working copy)
@@ -176,5 +176,5 @@ cleanup (void)
   close_units ();

   if (please_free_exe_path_when_done)
-    free (exe_path);
+    free ((char *) exe_path);
 }


> ../../../../libgfortran/intrinsics/signal.c:201: warning: cast to pointer from
> integer of different size
> ../../../../libgfortran/intrinsics/signal.c:208: warning: cast to pointer from
> integer of different size
> ../../../../libgfortran/intrinsics/signal.c:229: warning: cast to pointer from
> integer of different size
> ../../../../libgfortran/intrinsics/signal.c:236: warning: cast to pointer from
> integer of different size

This should be silenced by:

Index: intrinsics/signal.c
===================================================================
--- intrinsics/signal.c (revision 129403)
+++ intrinsics/signal.c (working copy)
@@ -198,14 +198,14 @@ alarm_sub_int_i4 (int *seconds, int *han
 #if defined (SIGALRM) && defined (HAVE_ALARM) && defined (HAVE_SIGNAL)
   if (status != NULL)
     {
-      if (signal (SIGALRM, (void (*)(int)) *handler) == SIG_ERR)
+      if (signal (SIGALRM, (void (*)(int)) (INTPTR_T) *handler) == SIG_ERR)
        *status = -1;
       else
        *status = alarm (*seconds);
     }
   else
     {
-      signal (SIGALRM, (void (*)(int)) *handler);
+      signal (SIGALRM, (void (*)(int)) (INTPTR_T) *handler);
       alarm (*seconds);
     }
 #else
@@ -226,14 +226,14 @@ alarm_sub_int_i8 (int *seconds, int *han
 #if defined (SIGALRM) && defined (HAVE_ALARM) && defined (HAVE_SIGNAL)
   if (status != NULL)
     {
-      if (signal (SIGALRM, (void (*)(int)) *handler) == SIG_ERR)
+      if (signal (SIGALRM, (void (*)(int)) (INTPTR_T) *handler) == SIG_ERR)
        *status = -1;
       else
        *status = alarm (*seconds);
     }
   else
     {
-      signal (SIGALRM, (void (*)(int)) *handler);
+      signal (SIGALRM, (void (*)(int)) (INTPTR_T) *handler);
       alarm (*seconds);
     }
 #else


> ../../../libgfortran/intrinsics/spread_generic.c:136: warning: format '%d'
> expects type 'int', but argument 2 has type 'long int'
> ../../../libgfortran/intrinsics/spread_generic.c:147: warning: format '%d'
> expects type 'int', but argument 2 has type 'long int'

Fixed by:

Index: intrinsics/spread_generic.c
===================================================================
--- intrinsics/spread_generic.c (revision 129403)
+++ intrinsics/spread_generic.c (working copy)
@@ -131,9 +131,9 @@ spread_internal (gfc_array_char *ret, co

                  if (ret_extent != ncopies)
                    runtime_error("Incorrect extent in return value of SPREAD"
-                                 " intrinsic in dimension %d: is %ld,"
-                                 " should be %ld", n+1, (long int) ret_extent,
-                                 (long int) ncopies);
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
                }
              else
                {
@@ -142,8 +142,9 @@ spread_internal (gfc_array_char *ret, co
                    - source->dim[dim].lbound;
                  if (ret_extent != extent[dim])
                    runtime_error("Incorrect extent in return value of SPREAD"
-                                 " intrinsic in dimension %d: is %ld,"
-                                 " should be %ld", n+1, (long int) ret_extent,
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
                                  (long int) extent[dim]);

                  if (extent[dim] <= 0)


> ../../../libgfortran/io/list_read.c:1518: warning: argument 'type' might be
> clobbered by 'longjmp' or 'vfork'

This one is longstanding. We need to audit and see if there is a potential
problem in making type volatile.


> ../../../libgfortran/intrinsics/pack_generic.c:316: warning: passing argument 3
> of 'pack_internal' from incompatible pointer type
> ../../../libgfortran/intrinsics/pack_generic.c:331: warning: passing argument 3
> of 'pack_internal' from incompatible pointer type
> ../../../libgfortran/intrinsics/unpack_generic.c:201: warning: passing argument
> 3 of 'unpack_internal' from incompatible pointer type
> ../../../libgfortran/intrinsics/unpack_generic.c:217: warning: passing argument
> 3 of 'unpack_internal' from incompatible pointer type
> ../../../libgfortran/intrinsics/unpack_generic.c:233: warning: passing argument
> 3 of 'unpack_internal' from incompatible pointer type
> ../../../libgfortran/intrinsics/unpack_generic.c:253: warning: passing argument
> 3 of 'unpack_internal' from incompatible pointer type

These ones are worrying me. I think they were introduced by Thomas Koenig.
Thomas, can you give it a look?


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu dot
                   |                            |org
   Last reconfirmed|2007-01-18 17:45:32         |2007-10-18 13:22:40
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22423


  parent reply	other threads:[~2007-10-18 13:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-22423-10258@http.gcc.gnu.org/bugzilla/>
2005-10-02 18:01 ` pinskia at gcc dot gnu dot org
2006-05-19 17:04 ` fxcoudert at gcc dot gnu dot org
2006-05-19 17:05 ` fxcoudert at gcc dot gnu dot org
2006-05-20  2:56 ` jvdelisle at gcc dot gnu dot org
2006-05-20  3:30 ` jvdelisle at gcc dot gnu dot org
2006-10-01  7:44 ` fxcoudert at gcc dot gnu dot org
2006-10-01 16:38 ` howarth at nitro dot med dot uc dot edu
2007-01-18 17:45 ` fxcoudert at gcc dot gnu dot org
2007-01-18 19:18 ` howarth at nitro dot med dot uc dot edu
2007-01-18 19:32 ` fxcoudert at gcc dot gnu dot org
2007-03-04  8:32 ` fxcoudert at gcc dot gnu dot org
2007-10-07 21:48 ` tobi at gcc dot gnu dot org
2007-10-18 13:22 ` fxcoudert at gcc dot gnu dot org [this message]
2007-12-27 15:00 ` tkoenig at gcc dot gnu dot org
2009-05-03 16:29 ` fxcoudert at gcc dot gnu dot org
2009-05-03 19:29 ` jvdelisle at gcc dot gnu dot org
2009-05-07 21:42 ` fxcoudert at gcc dot gnu dot org
2009-05-07 22:03 ` fxcoudert at gcc dot gnu dot org
2009-05-27  1:23 ` jvdelisle at gcc dot gnu dot org
2009-06-14  9:06 ` fxcoudert at gcc dot gnu dot org
2009-07-05  9:24 ` fxcoudert at gcc dot gnu dot org
2009-07-05  9:24 ` fxcoudert at gcc dot gnu dot org
2009-07-13  6:27 ` burnus at gcc dot gnu dot org
2009-07-13  6:32 ` burnus at gcc dot gnu dot org
2005-07-12  3:27 [Bug libfortran/22423] New: " fengwang at gcc dot gnu dot org
2005-09-24 13:14 ` [Bug libfortran/22423] " fxcoudert at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071018132240.32609.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).