-Wunknown-pragmas has been given. */
if (warn_unknown_pragmas > in_system_header)
{
+ const unsigned char *space, *name;
+ const cpp_token *s;
#ifndef USE_MAPPED_LOCATION
+ location_t fe_loc;
const struct line_map *map = linemap_lookup (&line_table, loc);
+ fe_loc.file = map->to_file;
+ fe_loc.line = SOURCE_LINE (map, loc);
+#else
+ location_t fe_loc = loc;
#endif
- const unsigned char *space, *name;
- const cpp_token *s;
space = name = (const unsigned char *) "";
s = cpp_get_token (pfile);
name = cpp_token_as_text (pfile, s);
}
-#ifdef USE_MAPPED_LOCATION
- input_location = loc;
-#else
- input_line = SOURCE_LINE (map, loc);
-#endif
- warning ("ignoring #pragma %s %s", space, name);
+ warning ("%Hignoring #pragma %s %s", &fe_loc, space, name);
}
}
non-NULL. */
enum cpp_ttype
-c_lex_with_flags (tree *value, unsigned char *cpp_flags)
+c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags)
{
static bool no_more_pch;
const cpp_token *tok;
type = tok->type;
retry_after_at:
+#ifdef USE_MAPPED_LOCATION
+ *loc = tok->src_loc;
+#else
+ *loc = input_location;
+#endif
switch (type)
{
case CPP_PADDING:
{
unsigned char name[4];
- *cpp_spell_token (parse_in, tok, name) = 0;
+ *cpp_spell_token (parse_in, tok, name, true) = 0;
error ("stray %qs in program", name);
}
enum cpp_ttype
c_lex (tree *value)
{
- return c_lex_with_flags (value, NULL);
+ location_t loc;
+ return c_lex_with_flags (value, &loc, NULL);
}
/* Returns the narrowest C-visible unsigned type, starting with the