[hackers] [scc] Basic support for -E flag || Roberto E. Vargas Caballero
X-DEBUG-UPD: 6650268eca2441b777636a3aad411b2d70e23281
commit 6650268eca2441b777636a3aad411b2d70e23281
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Aug 21 13:04:15 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri Aug 21 13:04:15 2015 +0200
Basic support for -E flag
This flag makes compilation stop after preprocessor. This version
is only a draft of how it must work.
diff --git a/cc1/main.c b/cc1/main.c
index 3f3218a..7973b79 100644
--- a/cc1/main.c
+++ b/cc1/main.c
_AT_@ -13,6 +13,7 @@ int warnings;
jmp_buf recover;
static char *output;
+static int onlycpp;
static void
clean(void)
_AT_@ -46,6 +47,9 @@ main(int argc, char *argv[])
case 'w':
warnings = 1;
break;
+ case 'E':
+ onlycpp = 1;
+ break;
case 'o':
if (!*++argv || argv[0][0] == '-')
usage();
_AT_@ -67,8 +71,13 @@ main(int argc, char *argv[])
ikeywords();
ilex(*argv);
- for (next(); yytoken != EOFTOK; decl())
- /* nothing */;
+ if (onlycpp) {
+ for (next(); yytoken != EOFTOK; next())
+ printf("%s ", yytext);
+ } else {
+ for (next(); yytoken != EOFTOK; decl())
+ /* nothing */;
+ }
return 0;
}
Received on Fri Aug 21 2015 - 13:10:37 CEST
This archive was generated by hypermail 2.3.0
: Fri Aug 21 2015 - 13:12:28 CEST