* support/Util/SDCCerr.[ch]: added sdcc warning 190 -
"ISO C forbids an empty source file"
* device/lib/_startup.c, device/lib/printf_tiny.c: disable warning 190
if all the code is ifdefed out.
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4483
4a8a32a2-be11-0410-ad9d-
d568d2c75423
/*-------------------------------------------------------------------------
- _startup.c - startup routine for sdcc
+ _startup.c - startup routine for sdcc
Written By - Sandeep Dutta . sandeep.dutta@usa.net (1999)
under the terms of the GNU Library General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
-
+
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
-
+
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
+
In other words, you are welcome to use, share and improve this program.
You are forbidden to forbid anyone else to use, share and improve
- what you give them. Help stamp out software-hoarding!
+ what you give them. Help stamp out software-hoarding!
-------------------------------------------------------------------------*/
/* External startup code can be written in C
return 0;
}
-#endif
+#else
+
+/* Disable "ISO C forbids an empty source file" wraning message */
+#pragma disable_warning 190
+#endif
* interrupt routine). Code size is under 270 bytes. Only one library
* function is called (_gptrget, 41 bytes), in addition to calls to
* putchar().
- *
+ *
* Five simple formats are supported
*
* %d signed 16 bit integer decimal (-32768 to 32767)
*
* For a more complete printf that supports longs, floating point and
* field width, try using printf_fast() or printf_large().
- */
+ */
// This removes the negative number code, causing "%d" to be the same
#warning "printf_tiny not built, does not support --xstack"
#elif defined(_SDCC_NO_ASM_LIB_FUNCS)
#warning "printf_tiny not built, _SDCC_NO_ASM_LIB_FUNCS defined"
+#else
+/* Disable "ISO C forbids an empty source file" wraning message */
+#pragma disable_warning 190
#endif
#else // defines are compatible with printf_tiny
%%
file
+ : /* empty */
+ { if (!options.lessPedantic)
+ werror(W_EMPTY_SOURCE_FILE);
+ }
+ | program
+ ;
+
+program
: external_definition
- | file external_definition
+ | program external_definition
;
external_definition
"flexible array member not at end of struct" },
{ E_FLEXARRAY_INEMPTYSTRCT, ERROR_LEVEL_ERROR,
"flexible array in otherwise empty struct" },
+{ W_EMPTY_SOURCE_FILE, ERROR_LEVEL_WARNING,
+ "ISO C forbids an empty source file" },
};
/*
#define W_C89_NO_FLEXARRAY 187 /* ISO C90 does not support flexible array members */
#define E_FLEXARRAY_NOTATEND 188 /* flexible array member not at end of struct */
#define E_FLEXARRAY_INEMPTYSTRCT 189 /* flexible array in otherwise empty struct */
+#define W_EMPTY_SOURCE_FILE 190 /* ISO C forbids an empty source file */
#define MAX_ERROR_WARNING 256 /* size of disable warnings array */