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
789d0ee5
Commit
789d0ee5
authored
Aug 25, 1992
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(do_pragma): Warn if `#pragma implementation "foo.h"' is
invoked after "foo.h" has been included. From-SVN: r1953
parent
bee757e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletions
+24
-1
gcc/cccp.c
+24
-1
No files found.
gcc/cccp.c
View file @
789d0ee5
...
@@ -5867,7 +5867,7 @@ do_ident (buf, limit)
...
@@ -5867,7 +5867,7 @@ do_ident (buf, limit)
}
}
/* #pragma and its argument line have already been copied to the output file.
/* #pragma and its argument line have already been copied to the output file.
Here just check for recognized pragmas
. */
Just check for some recognized pragmas that need validation here
. */
static
int
static
int
do_pragma
(
buf
,
limit
)
do_pragma
(
buf
,
limit
)
...
@@ -5882,6 +5882,29 @@ do_pragma (buf, limit)
...
@@ -5882,6 +5882,29 @@ do_pragma (buf, limit)
warning
(
"`#pragma once' is obsolete"
);
warning
(
"`#pragma once' is obsolete"
);
do_once
();
do_once
();
}
}
if
(
!
strncmp
(
buf
,
"implementation"
,
14
))
{
/* Be quiet about `#pragma implementation' for a file only if it hasn't
been included yet. */
struct
file_name_list
*
ptr
;
char
*
p
=
buf
+
14
,
*
fname
,
*
inc_fname
;
SKIP_WHITE_SPACE
(
p
);
if
(
*
p
==
'\n'
||
*
p
!=
'\"'
)
return
0
;
fname
=
p
+
1
;
if
(
p
=
(
char
*
)
strchr
(
fname
,
'\"'
))
*
p
=
'\0'
;
for
(
ptr
=
all_include_files
;
ptr
;
ptr
=
ptr
->
next
)
{
inc_fname
=
(
char
*
)
strrchr
(
ptr
->
fname
,
'/'
);
inc_fname
=
inc_fname
?
inc_fname
+
1
:
ptr
->
fname
;
if
(
inc_fname
&&
!
strcmp
(
inc_fname
,
fname
))
warning
(
"`#pragma implementation' for
\"
%s
\"
appears after its #include"
,
fname
);
}
}
return
0
;
return
0
;
}
}
...
...
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