The results should be consistent. g77 gets this right. $ cat char-comparison.f program main character*2 c2 character*1 c1, c3, c4 C C Comparison between char(255) and space padding C c2 = 'a' // char(255) c1 = 'a' print *, c2 .gt. c1 C C Comparison between char(255) and space C c3 = ' ' c4 = char(255) print *,c4 .gt. c3 end $ gfortran char-comparison.f && ./a.out F T $ g77 char-comparison.f && ./a.out T T
-- Summary: character comparisons with padding Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: libfortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tkoenig at gcc dot gnu dot org OtherBugsDependingO 19292 nThis: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30525