This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB 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]

[Bug fortran/23019] New: Fortran string comparisons incorrectly treat trailing blanks as significant


https://sourceware.org/bugzilla/show_bug.cgi?id=23019

            Bug ID: 23019
           Summary: Fortran string comparisons incorrectly treat trailing
                    blanks as significant
           Product: gdb
           Version: 7.12
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
          Assignee: unassigned at sourceware dot org
          Reporter: James.A.Paget at aero dot org
  Target Milestone: ---

Created attachment 10926
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10926&action=edit
A screen capture that demonstrates the bug.  It includes a listing of the
program used to demonstrate the bug.

This behavior has been observed both on HP-UX (an old version from ca. 2012)
and on the gfortran/gdb provided by equation.com for use on Windows. On Windows
7 Professional I am using gdb 7.12 and a nightly build of gfortran 8.00 from
20171029.

If you have a character*8 string x = 'a       ' and another character*8 string
y = 'a', then the debugger will incorrectly report that x(1:4) .eq. x evaluates
to .FALSE. and that x(1:4) .eq. y(1:1) evaluates to .FALSE..  In fact, they
both evaluate to .TRUE., as shown by the program output, since as per the ANSI
Fortran 90 standard trailing blanks are not treated as significant in string
comparisons.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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