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

[patch, libgfortran] FIX PR19543 formatted output for logical(8) variables


The attached patch is a possible fix for this PR. It is obvious and simple and is probably a work around for the underlying problem in PR 20066.

I noticed that the values being passed to write_logical are correct so I suspected the problem was types.

The problem is that in write_logical the result of extract_int returns GFC_INTEGER_LARGEST which when cast to (int) for the conditional test, it works correctly.

Regression tested and NIST tested. OK for trunk and 4.1?

2006-02-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>

	PR libgfortran/19543
	* io/write.c (write_logical): Cast GFC_INTEGER_LARGEST to (int)
	before using in test.


Index: io/write.c =================================================================== *** io/write.c (revision 110582) --- io/write.c (working copy) *************** write_char (st_parameter_dt *dtp, char c *** 1234,1240 **** static void write_logical (st_parameter_dt *dtp, const char *source, int length) { ! write_char (dtp, extract_int (source, length) ? 'T' : 'F'); }


--- 1234,1240 ---- static void write_logical (st_parameter_dt *dtp, const char *source, int length) { ! write_char (dtp, (int) extract_int (source, length) ? 'T' : 'F'); }





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