* configure.ac: Add additional warning flags.
authoraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 May 2005 16:54:58 +0000 (16:54 +0000)
committeraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 May 2005 16:54:58 +0000 (16:54 +0000)
* configure: Regenerate.

* io/write.c (calculate_G_format): Remove unused parameter.
(output_float): Remove unused parameter.
(write_float): Change callers.
(nml_write_obj): Avoid signed warning.
Make variable const to support -Wwrite-strings.

* io/unix.c (fd_alloc, mmap_open, mmap_sfree, mem_sfree,
mem_truncate): Mark argument as unused.

* io/unit.c (get_unit): Mark argument as unused.
(init_units): Avoid warning about signed comparision.

* io/transfer.c (next_record_r): Remove unused parameter.
(next_record_w): Remove unused parameter.
(next_record): Change callers.
(iolength_transfer): Mark arguments as unused.

* io/open.c: Add initializer.

* io/list_read.c (read_character): Mark argument as unused.
(nml_match_name): Add const to make compile with -Wwrite-strings.

* io/format.c: Add initializer.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99839 138bc75d-0d04-0410-961f-82ee72b054a4

libgfortran/ChangeLog
libgfortran/configure
libgfortran/configure.ac
libgfortran/io/format.c
libgfortran/io/list_read.c
libgfortran/io/open.c
libgfortran/io/transfer.c
libgfortran/io/unix.c
libgfortran/io/write.c

index 609c4f4..11fe6d5 100644 (file)
@@ -1,3 +1,32 @@
+2005-05-16  Andreas Jaeger  <aj@suse.de>
+
+       * configure.ac: Add additional warning flags.
+       * configure: Regenerate.
+
+       * io/write.c (calculate_G_format): Remove unused parameter.
+       (output_float): Remove unused parameter.
+       (write_float): Change callers.
+       (nml_write_obj): Avoid signed warning.
+       Make variable const to support -Wwrite-strings.
+
+       * io/unix.c (fd_alloc, mmap_open, mmap_sfree, mem_sfree,
+       mem_truncate): Mark argument as unused.
+
+       * io/unit.c (get_unit): Mark argument as unused.
+       (init_units): Avoid warning about signed comparision.
+
+       * io/transfer.c (next_record_r): Remove unused parameter.
+       (next_record_w): Remove unused parameter.
+       (next_record): Change callers.
+       (iolength_transfer): Mark arguments as unused.
+
+       * io/open.c: Add initializer.
+
+       * io/list_read.c (read_character): Mark argument as unused.
+       (nml_match_name): Add const to make compile with -Wwrite-strings.
+
+       * io/format.c: Add initializer.
+
 2005-05-15  Andreas Jaeger  <aj@suse.de>
 
        * m4/eoshift1.m4: Initialize variables to avoid warnings.
index 43b87a8..da18e68 100755 (executable)
@@ -2937,7 +2937,7 @@ if test "x$GCC" = "xyes"; then
   AM_FCFLAGS="-Wall"
   ## We like to use C99 routines when available.  This makes sure that
   ## __STDC_VERSION__ is set such that libc includes make them available.
-  AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes"
+  AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
 fi
 
 
index b372a7b..e4b5d91 100644 (file)
@@ -114,7 +114,7 @@ if test "x$GCC" = "xyes"; then
   AM_FCFLAGS="-Wall"
   ## We like to use C99 routines when available.  This makes sure that
   ## __STDC_VERSION__ is set such that libc includes make them available.
-  AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes"
+  AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
 fi
 AC_SUBST(AM_FCFLAGS)
 AC_SUBST(AM_CFLAGS)
index 5c2d999..413a664 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005
+   Free Software Foundation, Inc.
    Contributed by Andy Vaught
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -54,7 +55,9 @@ static const char *error;
 static format_token saved_token;
 static int value, format_string_len, reversion_ok;
 
-static fnode *saved_format, colon_node = { FMT_COLON };
+static fnode *saved_format;
+static fnode colon_node = { FMT_COLON, 0, NULL, NULL, {{ 0, 0, 0 }}, 0,
+                           NULL };
 
 /* Error messages */
 
index fb61890..7b0d25f 100644 (file)
@@ -704,7 +704,7 @@ read_integer (int length)
 /* Read a character variable.  */
 
 static void
-read_character (int length)
+read_character (int length __attribute__ ((unused)))
 {
   char c, quote, message[100];
 
@@ -1693,7 +1693,7 @@ nml_untouch_nodes (void)
    on no match.  */
 
 static void
-nml_match_name (char *name, index_type len)
+nml_match_name (const char *name, index_type len)
 {
   index_type i;
   char c;
index f579f1f..a48476b 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005
+   Free Software Foundation, Inc.
    Contributed by Andy Vaught
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -38,7 +39,7 @@ Boston, MA 02111-1307, USA.  */
 static st_option access_opt[] = {
   {"sequential", ACCESS_SEQUENTIAL},
   {"direct", ACCESS_DIRECT},
-  {NULL}
+  {NULL, 0}
 };
 
 static st_option action_opt[] =
@@ -46,14 +47,14 @@ static st_option action_opt[] =
   { "read", ACTION_READ},
   { "write", ACTION_WRITE},
   { "readwrite", ACTION_READWRITE},
-  { NULL}
+  { NULL, 0}
 };
 
 static st_option blank_opt[] =
 {
   { "null", BLANK_NULL},
   { "zero", BLANK_ZERO},
-  { NULL}
+  { NULL, 0}
 };
 
 static st_option delim_opt[] =
@@ -61,14 +62,14 @@ static st_option delim_opt[] =
   { "none", DELIM_NONE},
   { "apostrophe", DELIM_APOSTROPHE},
   { "quote", DELIM_QUOTE},
-  { NULL}
+  { NULL, 0}
 };
 
 static st_option form_opt[] =
 {
   { "formatted", FORM_FORMATTED},
   { "unformatted", FORM_UNFORMATTED},
-  { NULL}
+  { NULL, 0}
 };
 
 static st_option position_opt[] =
@@ -76,7 +77,7 @@ static st_option position_opt[] =
   { "asis", POSITION_ASIS},
   { "rewind", POSITION_REWIND},
   { "append", POSITION_APPEND},
-  { NULL}
+  { NULL, 0}
 };
 
 static st_option status_opt[] =
@@ -86,14 +87,14 @@ static st_option status_opt[] =
   { "new", STATUS_NEW},
   { "replace", STATUS_REPLACE},
   { "scratch", STATUS_SCRATCH},
-  { NULL}
+  { NULL, 0}
 };
 
 static st_option pad_opt[] =
 {
   { "yes", PAD_YES},
   { "no", PAD_NO},
-  { NULL}
+  { NULL, 0}
 };
 
 
index ce556ff..b51da52 100644 (file)
@@ -1205,7 +1205,7 @@ data_transfer_init (int read_flag)
 #define MAX_READ 4096
 
 static void
-next_record_r (int done)
+next_record_r (void)
 {
   int rlength, length;
   gfc_offset new;
@@ -1296,7 +1296,7 @@ next_record_r (int done)
 /* Position to the next record in write mode.  */
 
 static void
-next_record_w (int done)
+next_record_w (void)
 {
   gfc_offset c, m;
   int length;
@@ -1395,9 +1395,9 @@ next_record (int done)
   current_unit->read_bad = 0;
 
   if (g.mode == READING)
-    next_record_r (done);
+    next_record_r ();
   else
-    next_record_w (done);
+    next_record_w ();
 
   /* keep position up to date for INQUIRE */
   current_unit->flags.position = POSITION_ASIS;
@@ -1482,7 +1482,9 @@ finalize_transfer (void)
    data transfer, it just updates the length counter.  */
 
 static void
-iolength_transfer (bt type, void *dest, int len)
+iolength_transfer (bt type   __attribute__ ((unused)),
+                  void *dest __attribute__ ((unused)),
+                  int len)
 {
   if (ioparm.iolength != NULL)
     *ioparm.iolength += len;
index 2d8286c..462d48d 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005
+   Free Software Foundation, Inc.
    Contributed by Andy Vaught
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -329,7 +330,8 @@ fd_flush (unix_stream * s)
  * to come next. */
 
 static void
-fd_alloc (unix_stream * s, gfc_offset where, int *len)
+fd_alloc (unix_stream * s, gfc_offset where,
+         int *len __attribute__ ((unused)))
 {
   char *new_buffer;
   int n, read_len;
@@ -606,7 +608,8 @@ mmap_flush (unix_stream * s)
  * guaranteed to be mappable. */
 
 static try
-mmap_alloc (unix_stream * s, gfc_offset where, int *len)
+mmap_alloc (unix_stream * s, gfc_offset where,
+           int *len __attribute__ ((unused)))
 {
   gfc_offset offset;
   int length;
@@ -711,7 +714,7 @@ mmap_close (unix_stream * s)
 
 
 static try
-mmap_sfree (unix_stream * s)
+mmap_sfree (unix_stream * s __attribute__ ((unused)))
 {
   return SUCCESS;
 }
@@ -721,7 +724,7 @@ mmap_sfree (unix_stream * s)
  * mmap()-ed, we fall back to the file descriptor functions. */
 
 static try
-mmap_open (unix_stream * s)
+mmap_open (unix_stream * s __attribute__ ((unused)))
 {
   char *p;
   int i;
@@ -827,7 +830,7 @@ mem_seek (unix_stream * s, gfc_offset offset)
 
 
 static int
-mem_truncate (unix_stream * s)
+mem_truncate (unix_stream * s __attribute__ ((unused)))
 {
   return SUCCESS;
 }
@@ -843,7 +846,7 @@ mem_close (unix_stream * s)
 
 
 static try
-mem_sfree (unix_stream * s)
+mem_sfree (unix_stream * s __attribute__ ((unused)))
 {
   return SUCCESS;
 }
index 494a7a9..36fee92 100644 (file)
@@ -181,7 +181,7 @@ calculate_exp (int d)
           for Gw.dEe, n' ' means e+2 blanks  */
 
 static fnode *
-calculate_G_format (fnode *f, double value, int len, int *num_blank)
+calculate_G_format (fnode *f, double value, int *num_blank)
 {
   int e = f->u.real.e;
   int d = f->u.real.d;
@@ -271,7 +271,7 @@ calculate_G_format (fnode *f, double value, int len, int *num_blank)
 /* Output a real number according to its format which is FMT_G free.  */
 
 static void
-output_float (fnode *f, double value, int len)
+output_float (fnode *f, double value)
 {
   /* This must be large enough to accurately hold any value.  */
   char buffer[32];
@@ -732,13 +732,13 @@ write_float (fnode *f, const char *source, int len)
 
   if (f->format != FMT_G)
     {
-      output_float (f, n, len);
+      output_float (f, n);
     }
   else
     {
       save_scale_factor = g.scale_factor;
-      f2 = calculate_G_format(f, n, len, &nb);
-      output_float (f2, n, len);
+      f2 = calculate_G_format(f, n, &nb);
+      output_float (f2, n);
       g.scale_factor = save_scale_factor;
       if (f2 != NULL)
         free_mem(f2);
@@ -1325,7 +1325,7 @@ list_formatted_write (bt type, void *p, int len)
 
 /* Stores the delimiter to be used for character objects.  */
 
-static char * nml_delim;
+static const char * nml_delim;
 
 static namelist_info *
 nml_write_obj (namelist_info * obj, index_type offset,
@@ -1359,13 +1359,13 @@ nml_write_obj (namelist_info * obj, index_type offset,
       if (base)
        {
          len =strlen (base->var_name);
-         for (dim_i = 0; dim_i < strlen (base_name); dim_i++)
+         for (dim_i = 0; dim_i < (index_type) strlen (base_name); dim_i++)
             {
              cup = toupper (base_name[dim_i]);
              write_character (&cup, 1);
             }
        }
-      for (dim_i =len; dim_i < strlen (obj->var_name); dim_i++)
+      for (dim_i =len; dim_i < (index_type) strlen (obj->var_name); dim_i++)
        {
          cup = toupper (obj->var_name[dim_i]);
          write_character (&cup, 1);