]> git.gag.com Git - fw/sdcc/commitdiff
Fixed bug #816692: introduced new ERROR_LEVEL_PEDANTIC warning message "unmatched...
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 5 Oct 2003 17:34:58 +0000 (17:34 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 5 Oct 2003 17:34:58 +0000 (17:34 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2922 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCC.lex
support/Util/SDCCerr.c
support/Util/SDCCerr.h

index ca302623b13f57c4bdfc9e0a55de88df14875699..ed814cb34eac5c2c13cfb6de6836733f99d5b69e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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
index 0ac4356eee1c3398d650ab1fb47d9808ffd91975..367ff42a4362818729be5945aaf91f6ec3d1ab60 100644 (file)
@@ -22,8 +22,6 @@
    what you give them.   Help stamp out software-hoarding!  
 -------------------------------------------------------------------------*/
 
-%option noyywrap
-
 D        [0-9]
 L        [a-zA-Z_]
 H        [a-fA-F0-9]
@@ -47,32 +45,10 @@ extern char *filename;
 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 ;
@@ -665,6 +641,19 @@ static int isTargetKeyword(char *s)
     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);
index b28bd7db3ea73257d6dd250b3e96762b791e63cd..f7b4a282968f6e76fa2806ddf851d7a0d74b34fd 100644 (file)
@@ -395,6 +395,8 @@ struct
     "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" },
 };
 
 /*
index a2ed448dc680833af19face03bbeb97805aa1148..ffc7bb2794f214c57f2b827f882f71d2da231e94 100644 (file)
@@ -185,6 +185,7 @@ SDCCERR - SDCC Standard error handler
 #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.