+Fri Jan 28 09:12:56 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * ldlex.l: Add rule to catch invalid input characters instead of
+ printing them. Include "ldmain.h" for program_name decl.
+ (lex_warn_invalid): New function.
+ * Makefile.in: Add dependency.
+
Fri Jan 28 12:58:45 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
* Makefile.in (check): Don't bother running any tests of
$(INCDIR)/bfdlink.h ld.h ldexp.h ldver.h ldlang.h ldemul.h \
ldfile.h ldmisc.h ldmain.h mri.h ldlex.h
ldlex.o : ldlex.c ../bfd/bfd.h $(INCDIR)/obstack.h \
- ld.h ldgram.h ldmisc.h ldexp.h ldlang.h ldfile.h ldlex.h
+ ld.h ldgram.h ldmisc.h ldexp.h ldlang.h ldfile.h ldlex.h ldmain.h
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
%{
-/* Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
#include "ldlang.h"
#include "ldfile.h"
#include "ldlex.h"
+#include "ldmain.h"
int ldgram_in_defsym;
int size));
static void yy_input PARAMS ((char *, int *result, int max_size));
static void comment PARAMS ((void));
+static void lex_warn_invalid PARAMS ((char *where, char *what));
/* STATES
COMMAND on command line
- COMMENT in a C comment
- EXPRESSION definiatelyt in an expression
- SCRIPT definately in a script
- SOMEWHERE either EXPRESSION or SCRIPT
+ EXPRESSION definitely in an expression
+ SCRIPT definitely in a script
+ BOTH either EXPRESSION or SCRIPT
+ DEFSYMEXP in an argument to -defsym
MRI in an MRI script
*/
#define RTOKEN(x) { yylval.token = x; return x; }
%s COMMAND
%s SCRIPT
%s EXPRESSION
-%s COMMENT
%s BOTH
%s DEFSYMEXP
%s MRI
return END;
}
+
+<COMMAND>. lex_warn_invalid(" on command line", yytext);
+<SCRIPT,MRI>. lex_warn_invalid(" in script", yytext);
+<EXPRESSION,DEFSYMEXP,BOTH>. lex_warn_invalid(" in expression", yytext);
%%
}
}
}
+
+static void
+lex_warn_invalid (where, what)
+ char *where, *what;
+{
+ fprintf(stderr,
+ "%s: ignoring invalid character `%s'%s\n",
+ program_name, what, where);
+}