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
91b0989e
Commit
91b0989e
authored
Dec 28, 1995
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(yylex): Improve error message for bogus numbers.
Consolidate duplicated code. From-SVN: r10892
parent
70ce27ba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
37 deletions
+8
-37
gcc/c-lex.c
+8
-37
No files found.
gcc/c-lex.c
View file @
91b0989e
...
@@ -1282,7 +1282,7 @@ yylex ()
...
@@ -1282,7 +1282,7 @@ yylex ()
if
(
floatflag
!=
NOT_FLOAT
)
if
(
floatflag
!=
NOT_FLOAT
)
{
{
tree
type
=
double_type_node
;
tree
type
=
double_type_node
;
int
garbage_chars
=
0
,
exceeds_double
=
0
;
int
exceeds_double
=
0
;
int
imag
=
0
;
int
imag
=
0
;
REAL_VALUE_TYPE
value
;
REAL_VALUE_TYPE
value
;
jmp_buf
handler
;
jmp_buf
handler
;
...
@@ -1418,19 +1418,6 @@ yylex ()
...
@@ -1418,19 +1418,6 @@ yylex ()
}
}
}
}
#endif
#endif
garbage_chars
=
0
;
while
(
isalnum
(
c
)
||
c
==
'.'
||
c
==
'_'
||
(
!
flag_traditional
&&
(
c
==
'+'
||
c
==
'-'
)
&&
(
p
[
-
1
]
==
'e'
||
p
[
-
1
]
==
'E'
)))
{
if
(
p
>=
token_buffer
+
maxtoken
-
3
)
p
=
extend_token_buffer
(
p
);
*
p
++
=
c
;
c
=
getc
(
finput
);
garbage_chars
++
;
}
if
(
garbage_chars
>
0
)
error
(
"garbage at end of number"
);
/* If the result is not a number, assume it must have been
/* If the result is not a number, assume it must have been
due to some error message above, so silently convert
due to some error message above, so silently convert
...
@@ -1444,9 +1431,6 @@ yylex ()
...
@@ -1444,9 +1431,6 @@ yylex ()
build_real
(
type
,
value
));
build_real
(
type
,
value
));
else
else
yylval
.
ttype
=
build_real
(
type
,
value
);
yylval
.
ttype
=
build_real
(
type
,
value
);
ungetc
(
c
,
finput
);
*
p
=
0
;
}
}
else
else
{
{
...
@@ -1487,32 +1471,13 @@ yylex ()
...
@@ -1487,32 +1471,13 @@ yylex ()
spec_imag
=
1
;
spec_imag
=
1
;
}
}
else
else
{
if
(
isalnum
(
c
)
||
c
==
'.'
||
c
==
'_'
||
(
!
flag_traditional
&&
(
c
==
'+'
||
c
==
'-'
)
&&
(
p
[
-
1
]
==
'e'
||
p
[
-
1
]
==
'E'
)))
{
error
(
"garbage at end of number"
);
while
(
isalnum
(
c
)
||
c
==
'.'
||
c
==
'_'
||
(
!
flag_traditional
&&
(
c
==
'+'
||
c
==
'-'
)
&&
(
p
[
-
1
]
==
'e'
||
p
[
-
1
]
==
'E'
)))
{
if
(
p
>=
token_buffer
+
maxtoken
-
3
)
p
=
extend_token_buffer
(
p
);
*
p
++
=
c
;
c
=
getc
(
finput
);
}
}
break
;
break
;
}
if
(
p
>=
token_buffer
+
maxtoken
-
3
)
if
(
p
>=
token_buffer
+
maxtoken
-
3
)
p
=
extend_token_buffer
(
p
);
p
=
extend_token_buffer
(
p
);
*
p
++
=
c
;
*
p
++
=
c
;
c
=
getc
(
finput
);
c
=
getc
(
finput
);
}
}
ungetc
(
c
,
finput
);
/* If the constant is not long long and it won't fit in an
/* If the constant is not long long and it won't fit in an
unsigned long, or if the constant is long long and won't fit
unsigned long, or if the constant is long long and won't fit
in an unsigned long long, then warn that the constant is out
in an unsigned long long, then warn that the constant is out
...
@@ -1648,9 +1613,15 @@ yylex ()
...
@@ -1648,9 +1613,15 @@ yylex ()
}
}
else
else
TREE_TYPE
(
yylval
.
ttype
)
=
type
;
TREE_TYPE
(
yylval
.
ttype
)
=
type
;
}
ungetc
(
c
,
finput
);
*
p
=
0
;
*
p
=
0
;
}
if
(
isalnum
(
c
)
||
c
==
'.'
||
c
==
'_'
||
(
!
flag_traditional
&&
(
c
==
'-'
||
c
==
'+'
)
&&
(
p
[
-
1
]
==
'e'
||
p
[
-
1
]
==
'E'
)))
error
(
"missing white space after number `%s'"
,
token_buffer
);
value
=
CONSTANT
;
break
;
value
=
CONSTANT
;
break
;
}
}
...
...
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