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]

[gfortran,patch] Ignore byte order mark at start of file


Hi all,

Attached is a simple patch to fix PR31645: we need to ignore byte order marks (BOM, see http://en.wikipedia.org/wiki/Byte_Order_Mark) at the start of a file. I simply added a check for the most common encodings of BOM: UTF-8, big endian and little endian UTF-16.

Testcases for the three encodings are included in the patch (gzip'ed to avoid mailer corruption of the various encodings), as well as a testcase to check that included files get the same treatment, another one to check that BOMs not at start of file are not ignored and a last one to check that BOM is ignored for preprocessed files.

Regtested on i686-linux, OK for mainline?

FX



:ADDPATCH fortran:

Attachment: bom.diff.gz
Description: GNU Zip compressed data


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