aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-02-08 15:40:17 +0200
committerSergey Poznyakoff <gray@gnu.org>2019-02-08 15:40:17 +0200
commit3fea1f0f49fef3fb860597fe3e6297053a3ad6a1 (patch)
tree893d41e20c8b55597ab823d1b8dd8be097a40fd0
parent413a7852958d2c7549616016d3a3cd6de48ff048 (diff)
downloadcflow-3fea1f0f49fef3fb860597fe3e6297053a3ad6a1.tar.gz
cflow-3fea1f0f49fef3fb860597fe3e6297053a3ad6a1.tar.bz2
Include in output functions that don't call other functions
* src/output.c (tree_output): When outputting all graphs, skip only functions that have no source file information. * src/parser.c (declare): Don't install symbols with empty declarations.
-rw-r--r--src/output.c8
-rw-r--r--src/parser.c9
2 files changed, 12 insertions, 5 deletions
diff --git a/src/output.c b/src/output.c
index 7eaf7ac..41634a4 100644
--- a/src/output.c
+++ b/src/output.c
@@ -403,6 +403,6 @@ tree_output()
for (i = 0; i < num; i++) {
- if (symbols[i]->callee == NULL)
- continue;
- direct_tree(0, 0, symbols[i]);
- separator();
+ if (symbols[i]->source) {
+ direct_tree(0, 0, symbols[i]);
+ separator();
+ }
}
diff --git a/src/parser.c b/src/parser.c
index e2c5f62..2b173c2 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -408,2 +408,8 @@ undo_save_stack()
+int
+save_stack_is_empty()
+{
+ return save_end <= 0;
+}
+
char *
@@ -1148,3 +1154,4 @@ declare(Ident *ident, int maybe_knr)
|| tok.type == PARM_WRAPPER))
- || (ident->parmcnt < 0 && ident->storage == ExplicitExternStorage)) {
+ || (ident->parmcnt < 0 && ident->storage == ExplicitExternStorage)
+ || save_stack_is_empty()) {
undo_save_stack();

Return to:

Send suggestions and report system problems to the System administrator.