File tree Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -704,6 +704,7 @@ SC_FUNC stkitem popstk(void);
704
704
SC_FUNC void clearstk (void );
705
705
SC_FUNC int plungequalifiedfile (char * name ); /* explicit path included */
706
706
SC_FUNC int plungefile (char * name ,int try_currentpath ,int try_includepaths ); /* search through "include" paths */
707
+ SC_FUNC int number (cell * val ,const unsigned char * curptr );
707
708
SC_FUNC void preprocess (void );
708
709
SC_FUNC void lexinit (void );
709
710
SC_FUNC int lex (cell * lexvalue ,char * * lexsym );
Original file line number Diff line number Diff line change @@ -8252,6 +8252,33 @@ static void dopragma(void)
8252
8252
} else if (!strcmp (str ,"naked" )) {
8253
8253
pc_attributes |= (1U << attrNAKED );
8254
8254
if (str [i ]!= '\0' ) goto unknown_pragma ;
8255
+ } else if (!strcmp (str ,"warning" )) {
8256
+ str += i ;
8257
+ while (* str == ' ' ) str ++ ;
8258
+ for (i = 0 ; str [i ]!= '\0' && str [i ]!= ' ' ; i ++ )
8259
+ /* nothing */ ;
8260
+ if (str [i ]!= '\0' ) {
8261
+ str [i ]= '\0' ;
8262
+ while (str [++ i ]== ' ' )
8263
+ /* nothing */ ;
8264
+ } /* if */
8265
+ if (strcmp (str ,"enable" )== 0 || strcmp (str ,"disable" )== 0 ) {
8266
+ int len = number (& val ,& str [i ]);
8267
+ if (len == 0 )
8268
+ goto unknown_pragma ;
8269
+ pc_enablewarning ((int )val ,(str [0 ]== 'e' ) ? warnENABLE : warnDISABLE );
8270
+ /* warn if there are extra characters after the warning number */
8271
+ for (i += len ; str [i ]== ' ' ; i ++ )
8272
+ /* nothing */ ;
8273
+ if (str [i ]!= '\0' )
8274
+ goto unknown_pragma ;
8275
+ } else if (strcmp (str ,"push" )== 0 && str [i ]== '\0' ) {
8276
+ pc_pushwarnings ();
8277
+ } else if (strcmp (str ,"pop" )== 0 && str [i ]== '\0' ) {
8278
+ pc_popwarnings ();
8279
+ } else {
8280
+ goto unknown_pragma ;
8281
+ } /* if */
8255
8282
} else {
8256
8283
unknown_pragma :
8257
8284
error (207 ); /* unknown #pragma */
Original file line number Diff line number Diff line change @@ -843,7 +843,7 @@ static int ftoi(cell *val,const unsigned char *curptr)
843
843
* for at "hier2()" (in fact, it is viewed as an operator, not as a
844
844
* sign) and the + is invalid (as in K&R C, and unlike ANSI C).
845
845
*/
846
- static int number (cell * val ,const unsigned char * curptr )
846
+ SC_FUNC int number (cell * val ,const unsigned char * curptr )
847
847
{
848
848
int i ;
849
849
cell value ;
You can’t perform that action at this time.
0 commit comments