This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Some more warning fixes


The appended patch fixes these warnings:
/cvs/gcc/libgfortran/io/write.c:1493: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘ssize_t’
/cvs/gcc/libgfortran/io/list_read.c:2191: warning: missing braces around initializer
/cvs/gcc/libgfortran/io/list_read.c:2191: warning: (near initialization for ‘chd[0]’)
/cvs/gcc/libgfortran/io/list_read.c:2192: warning: missing braces around initializer
/cvs/gcc/libgfortran/io/list_read.c:2192: warning: (near initialization for ‘ind[0]’)
/cvs/gcc/libgfortran/intrinsics/etime.c:49: warning: unused variable ‘dim’

And also these in a couple of places:
/cvs/gcc/libgfortran/generated/matmul_i4.c:102: warning: passing argument 1 of ‘size0’ from incompatibl
e pointer type
/cvs/gcc/libgfortran/generated/matmul_i4.c:181: warning: passing argument 1 of ‘size0’ from incompatibl
e pointer type

Bootstrapped/regtested on Linux/x86-64.  Ok to commit?

Andreas

2005-05-15  Andreas Jaeger  <aj@suse.de>

	* m4/transpose.m4, m4/matmul.m4: Fix pointer cast to avoid
	warning.
	* generated/transpose_c4.c, generated/transpose_c8.c,
	generated/transpose_i4.c, generated/transpose_i8.c,
	generated/matmul_c4.c, generated/matmul_c8.c,
	generated/matmul_i4.c, generated/matmul_i8.c,
	generated/matmul_r4.c, generated/matmul_r8.c: Regenerated.

	* io/write.c (nml_write_obj): Fix 64-bit problem.

	* io/list_read.c (nml_get_obj_data): Add missing braces around
	initializer to avoid warnings.

	* intrinsics/etime.c (etime_sub): Remove unused variable.

============================================================
Index: libgfortran/generated/transpose_c4.c
--- generated/transpose_c4.c	23 Jan 2005 17:01:00 -0000	1.1
+++ generated/transpose_c4.c	15 May 2005 11:14:29 -0000
@@ -63,7 +63,7 @@ transpose_c4 (gfc_array_c4 * ret, gfc_ar
       ret->dim[1].ubound = source->dim[0].ubound - source->dim[0].lbound;
       ret->dim[1].stride = ret->dim[0].ubound+1;
 
-      ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_4) * size0 (ret));
+      ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) ret));
       ret->base = 0;
     }
 
============================================================
Index: libgfortran/generated/transpose_c8.c
--- generated/transpose_c8.c	23 Jan 2005 17:01:00 -0000	1.1
+++ generated/transpose_c8.c	15 May 2005 11:14:29 -0000
@@ -63,7 +63,7 @@ transpose_c8 (gfc_array_c8 * ret, gfc_ar
       ret->dim[1].ubound = source->dim[0].ubound - source->dim[0].lbound;
       ret->dim[1].stride = ret->dim[0].ubound+1;
 
-      ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_8) * size0 (ret));
+      ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) ret));
       ret->base = 0;
     }
 
============================================================
Index: libgfortran/generated/transpose_i4.c
--- generated/transpose_i4.c	23 Jan 2005 17:01:00 -0000	1.9
+++ generated/transpose_i4.c	15 May 2005 11:14:29 -0000
@@ -63,7 +63,7 @@ transpose_i4 (gfc_array_i4 * ret, gfc_ar
       ret->dim[1].ubound = source->dim[0].ubound - source->dim[0].lbound;
       ret->dim[1].stride = ret->dim[0].ubound+1;
 
-      ret->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * size0 (ret));
+      ret->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * size0 ((array_t *) ret));
       ret->base = 0;
     }
 
============================================================
Index: libgfortran/generated/transpose_i8.c
--- generated/transpose_i8.c	23 Jan 2005 17:01:00 -0000	1.9
+++ generated/transpose_i8.c	15 May 2005 11:14:29 -0000
@@ -63,7 +63,7 @@ transpose_i8 (gfc_array_i8 * ret, gfc_ar
       ret->dim[1].ubound = source->dim[0].ubound - source->dim[0].lbound;
       ret->dim[1].stride = ret->dim[0].ubound+1;
 
-      ret->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * size0 (ret));
+      ret->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * size0 ((array_t *) ret));
       ret->base = 0;
     }
 
============================================================
Index: libgfortran/generated/matmul_c4.c
--- generated/matmul_c4.c	30 Apr 2005 18:17:54 -0000	1.9
+++ generated/matmul_c4.c	15 May 2005 11:14:29 -0000
@@ -1,5 +1,5 @@
 /* Implementation of the MATMUL intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -99,7 +99,7 @@ matmul_c4 (gfc_array_c4 * retarray, gfc_
         }
           
       retarray->data
-	= internal_malloc_size (sizeof (GFC_COMPLEX_4) * size0 (retarray));
+	= internal_malloc_size (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) retarray));
       retarray->base = 0;
     }
 
@@ -178,7 +178,7 @@ matmul_c4 (gfc_array_c4 * retarray, gfc_
       GFC_COMPLEX_4 *abase_n;
       GFC_COMPLEX_4 bbase_yn;
 
-      memset (dest, 0, (sizeof (GFC_COMPLEX_4) * size0(retarray)));
+      memset (dest, 0, (sizeof (GFC_COMPLEX_4) * size0((array_t *) retarray)));
 
       for (y = 0; y < ycount; y++)
 	{
============================================================
Index: libgfortran/generated/matmul_c8.c
--- generated/matmul_c8.c	30 Apr 2005 18:17:54 -0000	1.9
+++ generated/matmul_c8.c	15 May 2005 11:14:29 -0000
@@ -1,5 +1,5 @@
 /* Implementation of the MATMUL intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -99,7 +99,7 @@ matmul_c8 (gfc_array_c8 * retarray, gfc_
         }
           
       retarray->data
-	= internal_malloc_size (sizeof (GFC_COMPLEX_8) * size0 (retarray));
+	= internal_malloc_size (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) retarray));
       retarray->base = 0;
     }
 
@@ -178,7 +178,7 @@ matmul_c8 (gfc_array_c8 * retarray, gfc_
       GFC_COMPLEX_8 *abase_n;
       GFC_COMPLEX_8 bbase_yn;
 
-      memset (dest, 0, (sizeof (GFC_COMPLEX_8) * size0(retarray)));
+      memset (dest, 0, (sizeof (GFC_COMPLEX_8) * size0((array_t *) retarray)));
 
       for (y = 0; y < ycount; y++)
 	{
============================================================
Index: libgfortran/generated/matmul_i4.c
--- generated/matmul_i4.c	30 Apr 2005 18:17:54 -0000	1.9
+++ generated/matmul_i4.c	15 May 2005 11:14:29 -0000
@@ -1,5 +1,5 @@
 /* Implementation of the MATMUL intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -99,7 +99,7 @@ matmul_i4 (gfc_array_i4 * retarray, gfc_
         }
           
       retarray->data
-	= internal_malloc_size (sizeof (GFC_INTEGER_4) * size0 (retarray));
+	= internal_malloc_size (sizeof (GFC_INTEGER_4) * size0 ((array_t *) retarray));
       retarray->base = 0;
     }
 
@@ -178,7 +178,7 @@ matmul_i4 (gfc_array_i4 * retarray, gfc_
       GFC_INTEGER_4 *abase_n;
       GFC_INTEGER_4 bbase_yn;
 
-      memset (dest, 0, (sizeof (GFC_INTEGER_4) * size0(retarray)));
+      memset (dest, 0, (sizeof (GFC_INTEGER_4) * size0((array_t *) retarray)));
 
       for (y = 0; y < ycount; y++)
 	{
============================================================
Index: libgfortran/generated/matmul_i8.c
--- generated/matmul_i8.c	30 Apr 2005 18:17:54 -0000	1.9
+++ generated/matmul_i8.c	15 May 2005 11:14:29 -0000
@@ -1,5 +1,5 @@
 /* Implementation of the MATMUL intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -99,7 +99,7 @@ matmul_i8 (gfc_array_i8 * retarray, gfc_
         }
           
       retarray->data
-	= internal_malloc_size (sizeof (GFC_INTEGER_8) * size0 (retarray));
+	= internal_malloc_size (sizeof (GFC_INTEGER_8) * size0 ((array_t *) retarray));
       retarray->base = 0;
     }
 
@@ -178,7 +178,7 @@ matmul_i8 (gfc_array_i8 * retarray, gfc_
       GFC_INTEGER_8 *abase_n;
       GFC_INTEGER_8 bbase_yn;
 
-      memset (dest, 0, (sizeof (GFC_INTEGER_8) * size0(retarray)));
+      memset (dest, 0, (sizeof (GFC_INTEGER_8) * size0((array_t *) retarray)));
 
       for (y = 0; y < ycount; y++)
 	{
============================================================
Index: libgfortran/generated/matmul_r4.c
--- generated/matmul_r4.c	30 Apr 2005 18:17:54 -0000	1.9
+++ generated/matmul_r4.c	15 May 2005 11:14:29 -0000
@@ -1,5 +1,5 @@
 /* Implementation of the MATMUL intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -99,7 +99,7 @@ matmul_r4 (gfc_array_r4 * retarray, gfc_
         }
           
       retarray->data
-	= internal_malloc_size (sizeof (GFC_REAL_4) * size0 (retarray));
+	= internal_malloc_size (sizeof (GFC_REAL_4) * size0 ((array_t *) retarray));
       retarray->base = 0;
     }
 
@@ -178,7 +178,7 @@ matmul_r4 (gfc_array_r4 * retarray, gfc_
       GFC_REAL_4 *abase_n;
       GFC_REAL_4 bbase_yn;
 
-      memset (dest, 0, (sizeof (GFC_REAL_4) * size0(retarray)));
+      memset (dest, 0, (sizeof (GFC_REAL_4) * size0((array_t *) retarray)));
 
       for (y = 0; y < ycount; y++)
 	{
============================================================
Index: libgfortran/generated/matmul_r8.c
--- generated/matmul_r8.c	30 Apr 2005 18:17:54 -0000	1.9
+++ generated/matmul_r8.c	15 May 2005 11:14:29 -0000
@@ -1,5 +1,5 @@
 /* Implementation of the MATMUL intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -99,7 +99,7 @@ matmul_r8 (gfc_array_r8 * retarray, gfc_
         }
           
       retarray->data
-	= internal_malloc_size (sizeof (GFC_REAL_8) * size0 (retarray));
+	= internal_malloc_size (sizeof (GFC_REAL_8) * size0 ((array_t *) retarray));
       retarray->base = 0;
     }
 
@@ -178,7 +178,7 @@ matmul_r8 (gfc_array_r8 * retarray, gfc_
       GFC_REAL_8 *abase_n;
       GFC_REAL_8 bbase_yn;
 
-      memset (dest, 0, (sizeof (GFC_REAL_8) * size0(retarray)));
+      memset (dest, 0, (sizeof (GFC_REAL_8) * size0((array_t *) retarray)));
 
       for (y = 0; y < ycount; y++)
 	{
============================================================
Index: libgfortran/m4/transpose.m4
--- m4/transpose.m4	23 Jan 2005 17:01:00 -0000	1.9
+++ m4/transpose.m4	15 May 2005 11:14:29 -0000
@@ -64,7 +64,7 @@ transpose_`'rtype_code (rtype * ret, rty
       ret->dim[1].ubound = source->dim[0].ubound - source->dim[0].lbound;
       ret->dim[1].stride = ret->dim[0].ubound+1;
 
-      ret->data = internal_malloc_size (sizeof (rtype_name) * size0 (ret));
+      ret->data = internal_malloc_size (sizeof (rtype_name) * size0 ((array_t *) ret));
       ret->base = 0;
     }
 
============================================================
Index: libgfortran/m4/matmul.m4
--- m4/matmul.m4	30 Apr 2005 18:17:54 -0000	1.10
+++ m4/matmul.m4	15 May 2005 11:14:29 -0000
@@ -1,5 +1,5 @@
 `/* Implementation of the MATMUL intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -100,7 +100,7 @@ matmul_`'rtype_code (rtype * retarray, r
         }
           
       retarray->data
-	= internal_malloc_size (sizeof (rtype_name) * size0 (retarray));
+	= internal_malloc_size (sizeof (rtype_name) * size0 ((array_t *) retarray));
       retarray->base = 0;
     }
 
@@ -180,7 +180,7 @@ sinclude(`matmul_asm_'rtype_code`.m4')dn
       rtype_name *abase_n;
       rtype_name bbase_yn;
 
-      memset (dest, 0, (sizeof (rtype_name) * size0(retarray)));
+      memset (dest, 0, (sizeof (rtype_name) * size0((array_t *) retarray)));
 
       for (y = 0; y < ycount; y++)
 	{
============================================================
Index: libgfortran/io/write.c
--- io/write.c	23 Apr 2005 12:38:08 -0000	1.33
+++ io/write.c	15 May 2005 11:14:30 -0000
@@ -1490,7 +1490,7 @@ nml_write_obj (namelist_info * obj, inde
 		{
 		  strcat (ext_name, dim_i ? "" : "(");
 		  clen = strlen (ext_name);
-		  st_sprintf (ext_name + clen, "%d", obj->ls[dim_i].idx);
+		  st_sprintf (ext_name + clen, "%ld", (long) obj->ls[dim_i].idx);
 		  strcat (ext_name, (dim_i == obj->var_rank - 1) ? ")" : ",");
 		}
 
============================================================
Index: libgfortran/io/list_read.c
--- io/list_read.c	23 Apr 2005 12:38:08 -0000	1.18
+++ io/list_read.c	15 May 2005 11:14:30 -0000
@@ -2188,8 +2188,8 @@ get_name:
 
   if (c == '(' && nl->type == GFC_DTYPE_CHARACTER)
     {
-      descriptor_dimension chd[1] = {1, clow, nl->string_length};
-      nml_loop_spec ind[1] = {1, clow, nl->string_length, 1};
+      descriptor_dimension chd[1] = { {1, clow, nl->string_length} };
+      nml_loop_spec ind[1] = { {1, clow, nl->string_length, 1} };
 
       if (nml_parse_qualifier (chd, ind, 1) == FAILURE)
 	{
============================================================
Index: libgfortran/intrinsics/etime.c
--- intrinsics/etime.c	12 Jan 2005 21:27:30 -0000	1.5
+++ intrinsics/etime.c	15 May 2005 11:14:30 -0000
@@ -1,5 +1,5 @@
 /* Implementation of the ETIME intrinsic.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
    Contributed by Steven G. Kargl <kargls@comcast.net>.
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -46,7 +46,6 @@ void
 etime_sub (gfc_array_r4 *t, GFC_REAL_4 *result)
 {
   GFC_REAL_4 tu, ts, tt, *tp;
-  index_type dim;
 
 #if defined(HAVE_SYS_TIME_H) && defined(HAVE_SYS_RESOURCE_H)
   struct rusage rt;

Attachment: pgp00000.pgp
Description: PGP signature

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00001.pgp
Description: PGP signature


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