The following warnings apears from time to time. MEM_TST.C(41): warning C280: 'mem_DPP': unreferenced local variable Sometimes I want to suspend them, but I can't find how. suspend linker warnings, Lxxx, are possible via the project configuration screens but I didn't see any place to direct the compiler to suspend compilation warnings Cxxx. Is it possible at all ? I am using the following environment: IDE-Version: µVision2 V2.40 Tool Version Numbers: Toolchain Path: C:\Keil\C51\BIN\ C Compiler: C51.Exe V7.10 Assembler: A51.Exe V7.09 Linker/Locator: BL51.Exe V5.03 Librarian: LIB51.Exe V4.24 Hex Converter: OH51.Exe V2.6 CPU DLL: S8051.DLL V2.43 Dialog DLL: DCORE51.DLL V2.43 Target DLL: BIN\DCD_DoCD.DLL V1.06 Dialog DLL: TP51.DLL V2.43 Thanks. Amit A.
But sometimes, when you write code, you create an infrastructure, that still in this early stage doesn't use all variables that where declared (in function's prototype or in the functions as well). in such a case when you compiles, you want to disable all the known warnings, in order to see the real warnings only. For this reason, you need to be able to set a flag in the compiler page at the project definitions (not in the code!), that will tell the compiler to ignore these specific warnings. The problem with all the mentioed above workarounds is that they can be left in the code and forgotten there forever - this is bad programming ! By setting an external flag, and clearing it before makeing a SW realese, you can clean your code, and still work in a way that will allow you faster handle of the real warnings at the relevant time. I founf the disable warning L16 preaty usefull, and to my opinion all warnings (both of comiler and linker) should have the option to be disabled from the project definitions.
still in this early stage see the real warnings only You work with conflicting objectives. A piece of code can either be in early prototype state, or it can be important to have it compile warning-free. Asking for both of these at the same time is, mildly put, a waste of effort.
"The problem with all the mentioed above workarounds is that they can be left in the code and forgotten there forever" Equally, they could be left in the Project options (or makefile, or whatever) and forgotten there forever...! That's life! At least if they're in the source code you can easily document them with some standard comment; eg,
unused = unused; // HACK! Temporarily suspend warning