Warnings when compiling gfortran

Jerry DeLisle jvdelisle@verizon.net
Sat Jan 12 13:40:00 GMT 2008


Jerry DeLisle wrote:
> Hi,
> 
> I noticed this today:
> 
> ../../gcc43/gcc/fortran/simplify.c: In function ‘gfc_simplify_transfer’:
> ../../gcc43/gcc/fortran/simplify.c:4165: warning: unknown conversion 
> type character ‘l’ in format
> ../../gcc43/gcc/fortran/simplify.c:4165: warning: unknown conversion 
> type character ‘l’ in format
> ../../gcc43/gcc/fortran/simplify.c:4165: warning: too many arguments for 
> format
> gcc   -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes 
> -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute 
> -fno-common   -DHAVE_CONFIG_H  -o f951 \
> 
> Anyone recognize this?
> 
> Jerry
> 
This fixes it:  I don't know if this was the intent.

Index: simplify.c
===================================================================
--- simplify.c  (revision 131473)
+++ simplify.c  (working copy)
@@ -4161,8 +4161,8 @@ gfc_simplify_transfer (gfc_expr *source,

    if (gfc_option.warn_surprising && source_size < result_size)
      gfc_warning("Intrinsic TRANSFER at %L has partly undefined result: "
-               "source size %ld < result size %ld", &source->where,
-               (long) source_size, (long) result_size);
+               "source size %d < result size %d", &source->where,
+               (int) source_size, (int) result_size);

    /* Allocate the buffer to store the binary version of the source.  */
    buffer_size = MAX (source_size, result_size);

This was from Tobias patch for PR33037.  Tobias, can you check that the above 
patch is OK.

Jerry



More information about the Fortran mailing list