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

Warning in date_and_time.c


I just noticed this today:

../../../trunk/libgfortran/intrinsics/date_and_time.c:173:33: warning: ‘%+03d’
directive output may be truncated writing between 3 and 9 bytes into a region of
size 6 [-Wformat-length=]
  snprintf (zone, ZONE_LEN + 1, "%+03d%02d",
                                 ^~~~~
../../../trunk/libgfortran/intrinsics/date_and_time.c:173:32: note: directive
argument in the range [-35791394, 35791394]
  snprintf (zone, ZONE_LEN + 1, "%+03d%02d",
                                ^~~~~~~~~~~
../../../trunk/libgfortran/intrinsics/date_and_time.c:173:2: note: format output
between 6 and 12 bytes into a destination of size 6
  snprintf (zone, ZONE_LEN + 1, "%+03d%02d",
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     values[3] / 60, abs (values[3] % 60));
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Does anyone know off hand what to do to fix this?

Jerry


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