+2003-10-05 Borut Razem <borut.razem@siol.net>
+
+ * src/SDCC.lex, support/Util/SDCCerr.c, sdcc/support/Util/SDCCerr.h:
+ Fixed bug #816692: introduced new ERROR_LEVEL_PEDANTIC warning
+ message "unmatched #pragma SAVE and #pragma RESTORE"
+
2003-10-04 Frieder Ferlemann <Frieder.Ferlemann@web.de>
* doc/sdccman.lyx: various additions and updates (interrupts, inline
what you give them. Help stamp out software-hoarding!
-------------------------------------------------------------------------*/
-%option noyywrap
-
D [0-9]
L [a-zA-Z_]
H [a-fA-F0-9]
int mylineno = 1;
static void count(void);
static int process_pragma(char *);
-#undef yywrap
-
-#ifndef YYPROTO
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
-#endif
-
-int yywrap YY_PROTO((void))
-{
- return(1);
-}
-
-static void yyunput (int, char *);
-
-static void my_unput(char c)
-{
- yyunput(c, (yytext_ptr));
-}
+static void my_unput(char c);
#define TKEYWORD(token) return (isTargetKeyword(yytext) ? token :\
- check_type())
+ check_type())
char *asmbuff=NULL;
int asmbuffSize=0;
char *asmp ;
return 0;
}
+static void my_unput(char c)
+{
+ yyunput(c, (yytext_ptr));
+}
+
+int yywrap(void)
+{
+ if (!STACK_EMPTY(options_stack) || !STACK_EMPTY(optimize_stack))
+ werror(W_SAVE_RESTORE);
+
+ return 1;
+}
+
int yyerror(char *s)
{
fflush(stdout);
"ignoring declarator of 0 length bitfield" },
{ E_FUNC_ATTR, ERROR_LEVEL_ERROR,
"function attribute following non-function declaration"},
+{ W_SAVE_RESTORE, ERROR_LEVEL_PEDANTIC,
+ "unmatched #pragma SAVE and #pragma RESTORE" },
};
/*
#define E_INT_BAD_INTNO 167 /* invalid interrupt number */
#define W_BITFLD_NAMED 168 /* declarator used with 0 length bitfield */
#define E_FUNC_ATTR 169 /* function attribute without function */
+#define W_SAVE_RESTORE 170 /* unmatched #pragma SAVE and #pragma RESTORE */
/** Describes the maximum error level that will be logged. Any level
* includes all of the levels listed after it.