Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
e29941ce
Commit
e29941ce
authored
Sep 20, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Give error for byte-order-mark in middle of file.
From-SVN: r191507
parent
f8f72892
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
+9
-1
gcc/go/gofrontend/lex.cc
+9
-1
No files found.
gcc/go/gofrontend/lex.cc
View file @
e29941ce
...
...
@@ -726,7 +726,7 @@ Lex::next_token()
&
issued_error
);
// Ignore byte order mark at start of file.
if
(
ci
==
0xfeff
&&
this
->
lineno_
==
1
&&
this
->
lineoff_
==
0
)
if
(
ci
==
0xfeff
)
{
p
=
pnext
;
break
;
...
...
@@ -840,6 +840,14 @@ Lex::advance_one_utf8_char(const char* p, unsigned int* value,
*
issued_error
=
true
;
return
p
+
1
;
}
// Warn about byte order mark, except at start of file.
if
(
*
value
==
0xfeff
&&
(
this
->
lineno_
!=
1
||
this
->
lineoff_
!=
0
))
{
error_at
(
this
->
location
(),
"Unicode (UTF-8) BOM in middle of file"
);
*
issued_error
=
true
;
}
return
p
+
adv
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment