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
63ea33ce
Commit
63ea33ce
authored
Jul 25, 1992
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(yylex): Diagnose `1.0fl'. Issue just one diagnostic for `1e1000000f'.
From-SVN: r1685
parent
9282f2f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
39 deletions
+25
-39
gcc/c-lex.c
+25
-39
No files found.
gcc/c-lex.c
View file @
63ea33ce
...
@@ -1313,8 +1313,7 @@ yylex ()
...
@@ -1313,8 +1313,7 @@ yylex ()
if
(
floatflag
!=
NOT_FLOAT
)
if
(
floatflag
!=
NOT_FLOAT
)
{
{
tree
type
=
double_type_node
;
tree
type
=
double_type_node
;
char
f_seen
=
0
;
int
garbage_chars
=
0
,
exceeds_double
=
0
;
char
l_seen
=
0
;
REAL_VALUE_TYPE
value
;
REAL_VALUE_TYPE
value
;
jmp_buf
handler
;
jmp_buf
handler
;
...
@@ -1378,53 +1377,40 @@ yylex ()
...
@@ -1378,53 +1377,40 @@ yylex ()
/* ERANGE is also reported for underflow,
/* ERANGE is also reported for underflow,
so test the value to distinguish overflow from that. */
so test the value to distinguish overflow from that. */
if
(
*
p1
!=
0
&&
(
value
>
1
.
0
||
value
<
-
1
.
0
))
if
(
*
p1
!=
0
&&
(
value
>
1
.
0
||
value
<
-
1
.
0
))
pedwarn
(
"floating point number exceeds range of `double'"
);
{
pedwarn
(
"floating point number exceeds range of `double'"
);
exceeds_double
=
1
;
}
}
}
#endif
#endif
/* Read the suffixes to choose a data type. */
/* Read the suffixes to choose a data type. */
while
(
1
)
switch
(
c
)
{
case
'f'
:
case
'F'
:
type
=
float_type_node
;
value
=
REAL_VALUE_TRUNCATE
(
TYPE_MODE
(
type
),
value
);
if
(
REAL_VALUE_ISINF
(
value
)
&&
!
exceeds_double
&&
pedantic
)
pedwarn
(
"floating point number exceeds range of `float'"
);
garbage_chars
=
-
1
;
break
;
case
'l'
:
case
'L'
:
type
=
long_double_type_node
;
garbage_chars
=
-
1
;
break
;
}
/* Note: garbage_chars is -1 if first char is *not* garbage. */
while
(
isalnum
(
c
))
{
{
if
(
c
==
'f'
||
c
==
'F'
)
{
if
(
f_seen
)
error
(
"two `f's in floating constant"
);
else
{
f_seen
=
1
;
type
=
float_type_node
;
value
=
real_value_truncate
(
TYPE_MODE
(
type
),
value
);
if
(
REAL_VALUE_ISINF
(
value
)
&&
pedantic
)
pedwarn
(
"floating point number exceeds range of `float'"
);
}
}
else
if
(
c
==
'l'
||
c
==
'L'
)
{
if
(
l_seen
)
error
(
"two `l's in floating constant"
);
l_seen
=
1
;
type
=
long_double_type_node
;
}
else
{
if
(
isalnum
(
c
))
{
error
(
"garbage at end of number"
);
while
(
isalnum
(
c
))
{
if
(
p
>=
token_buffer
+
maxtoken
-
3
)
p
=
extend_token_buffer
(
p
);
*
p
++
=
c
;
c
=
getc
(
finput
);
}
}
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
);
garbage_chars
++
;
}
}
if
(
garbage_chars
>
0
)
error
(
"garbage at end of number"
);
/* Create a node with determined type and value. */
/* Create a node with determined type and value. */
yylval
.
ttype
=
build_real
(
type
,
value
);
yylval
.
ttype
=
build_real
(
type
,
value
);
...
...
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