commit e1ed7494db4299f2e7adf1c02e3e9b5e61d7199f
parent c9cccba538e9870b1177ae4c57dad716e9f02185
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Fri, 13 May 2016 11:51:19 +0200
[cc1] Give a warning about non supported pragmas
Our easter egg was too obvious, and in this new form
it is a bit more difficult to find it and it makes
more sense.
Diffstat:
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/cc1/cpp.c b/cc1/cpp.c
@@ -547,13 +547,18 @@ static void
pragma(void)
{
static char magic[] = {
- #include "pragma.msg"
+ #include "stallman.msg"
}, *p = magic;
+ extern int warnings;
if (cppoff)
return;
- for (; *p; p++)
- putc(*p, stderr);
+ next();
+ if (!strcmp(yytext, "GCC") && warnings) {
+ for (; *p; p++)
+ putc(*p, stderr);
+ }
+ warn("ignoring pragma '%s'", input->begin);
*input->p = '\0';
next();
}
diff --git a/cc1/pragma.msg b/cc1/stallman.msg