From: Ivan Baravy Date: Thu, 10 Nov 2016 08:39:33 +0000 (+0300) Subject: Fix build with GCC6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Fsandbox%2Fibaravy%2Fgcc6;p=platform%2Fupstream%2Fmurphy.git Fix build with GCC6 Add -P option to GCC preprocessor Distinguish linemarkers and pragmas (both start with #) --- diff --git a/utils/collect-symbols.c b/utils/collect-symbols.c index 9b7b782..d4abaff 100644 --- a/utils/collect-symbols.c +++ b/utils/collect-symbols.c @@ -292,9 +292,9 @@ static int preprocess_file(const char *preproc, const char *file, argv[argc++] = "-c"; if (cflags != NULL) - snprintf(cmd, sizeof(cmd), "%s %s -E %s", preproc, cflags, file); + snprintf(cmd, sizeof(cmd), "%s %s -E -P %s", preproc, cflags, file); else - snprintf(cmd, sizeof(cmd), "%s -E %s", preproc, file); + snprintf(cmd, sizeof(cmd), "%s -E -P %s", preproc, file); argv[argc++] = cmd; argv[argc] = NULL; @@ -627,6 +627,11 @@ static int collect_tokens(input_t *in, ringbuf_t *rb, token_t *tokens, /* extract path name from preprocessor line-markers */ case '#': + if (input_read(in) == 'p') { /* p for pragma */ + while((ch = input_read(in)) != '\n' && ch) {} + break; + } + /* not pragma, assume linemarker */ v = input_parse_linemarker(in, path, sizeof(path)); if (v != NULL) { tokens[n].type = TOKEN_LINEMARKER;