[hackers] [scc] Merge remote-tracking branch 'origin/master' || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 21 Aug 2015 13:10:37 +0200 (CEST)

X-DEBUG-UPD: 8182a159c71c03a6cd28b9c8651c26db5e1743c4
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:30 CEST