This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran,patch] Ignore byte order mark at start of file
- From: FX Coudert <fxcoudert at gmail dot com>
- To: "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 25 Apr 2007 22:15:18 +0200
- Subject: [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