PRINTF_WHERE_LIKE (as_warn_where);
PRINTF_INDENT_LIKE (as_info_where);
+void set_identify_name (const char *);
void as_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
void signal_init (void);
int had_errors (void);
extern const char *strsignal (int);
#endif
-static void identify (const char *);
static void as_show_where (void);
static void as_warn_internal (const char *, unsigned int, char *);
static void as_bad_internal (const char *, unsigned int, char *);
as_abort () is used for logic failure (assert or abort, signal).
*/
+static const char *ident_name;
+
+void
+set_identify_name (const char *name)
+{
+ ident_name = name;
+}
+
static void
-identify (const char *file)
+identify (void)
{
static int identified;
return;
identified++;
- if (!file)
- {
- unsigned int x;
- file = as_where (&x);
- }
-
- if (file)
- fprintf (stderr, "%s: ", file);
+ if (ident_name && *ident_name)
+ fprintf (stderr, "%s: ", ident_name);
fprintf (stderr, _("Assembler messages:\n"));
}
unsigned int line;
file = as_where_top (&line);
- identify (file);
+ identify ();
if (file)
{
if (line != 0)
context = true;
}
- identify (file);
+ identify ();
if (file)
{
if (line != 0)
context = true;
}
- identify (file);
+ identify ();
if (file)
{
if (line != 0)
--- /dev/null
+.*line2\.s: Assembler messages:
+.*line2\.inc:2: Warning: inside macro
+.*line2\.inc:6: Info: macro invoked from here
+.*:2: Warning: inside macro
+.*line2\.s:3: Info: macro invoked from here