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]

Undue warning introduced by libcpp patch


Hi Daniel,

I understand you have your lot of bootstraps to fix, but when you get
time, here are three small issues introduced (I suppose) by your
patch.

1. When I compile a .F90 file with -save-temps, I get:
f951: warning: command line option "-fpch-preprocess" is valid for
C/C++/ObjC/ObjC++ but not for Fortran

2. When I compile a .F90 file with -E, no newline is appended at the
end of the last line of output

3. If I compile the following a.F90 file:

# 1 "a.F90"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "a.F90"
  print *, "foo"  "bar""gee"
  end

with "gfortran -E", I get garbage in the output:

# 1 "a.F90"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "a.F90"
# 1 "a.F90*"
# 1 "<built-in>ßâ*"
# 1 "<command-line>"
# 1 "a.F90*"
  print *, "foo"  "bar""gee"
  end

and valgrind says:

==28934== Invalid read of size 1
==28934==    at 0x4A1C713: strlen (mc_replace_strmem.c:246)
==28934==    by 0x410D99: print_line (cpp.c:753)
==28934==    by 0xB53574: do_linemarker (directives.c:993)
==28934==    by 0xB51F98: _cpp_handle_directive (directives.c:483)
==28934==    by 0xB624DE: _cpp_scan_out_logical_line (traditional.c:634)
==28934==    by 0xB62BF6: _cpp_read_logical_line_trad (traditional.c:305)
==28934==    by 0x41105F: gfc_cpp_preprocess (cpp.c:699)
==28934==    by 0x46FB35: gfc_new_file (scanner.c:1916)
==28934==    by 0x48720C: gfc_init (f95-lang.c:295)
==28934==    by 0x704A88: toplev_main (toplev.c:2045)
==28934==    by 0x4B3B4C9: (below main) (in /usr/lib/debug/libc-2.3.6.so)
==28934==  Address 0x4E2C13D is 0 bytes after a block of size 5 alloc'd
==28934==    at 0x4A1B95B: realloc (vg_replace_malloc.c:306)
==28934==    by 0xB7713C: xrealloc (xmalloc.c:179)
==28934==    by 0xB648DC: cpp_interpret_string (charset.c:1392)
==28934==    by 0xB64E90: cpp_interpret_string_notranslate (charset.c:1416)
==28934==    by 0xB5360A: do_linemarker (directives.c:956)
==28934==    by 0xB51F98: _cpp_handle_directive (directives.c:483)
==28934==    by 0xB624DE: _cpp_scan_out_logical_line (traditional.c:634)
==28934==    by 0xB62BF6: _cpp_read_logical_line_trad (traditional.c:305)
==28934==    by 0x41105F: gfc_cpp_preprocess (cpp.c:699)
==28934==    by 0x46FB35: gfc_new_file (scanner.c:1916)
==28934==    by 0x48720C: gfc_init (f95-lang.c:295)
==28934==    by 0x704A88: toplev_main (toplev.c:2045)


FX

-- 
FX Coudert
http://www.homepages.ucl.ac.uk/~uccafco/

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