MPS issue job003715

TitleWarning pragmas may be unnecessary
Statusclosed
Prioritynice
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionThere are quite a lot of #pragma warning(disable: NNNN) in the MPS. They might not all be necessary any more, and so might be preventing us from spotting errors.
AnalysisSuppressing this warning is still necessary:

4127 "conditional expression is constant" (config.h fmtdy.c testlib.h) -- Generated by the MPS_END macro, so there are hundreds of these.

Suppressing these warnings is still necessary in some circumstances:

4996 "This function or variable may be unsafe" (eventcnv.c, eventsql.c, eventtxt.c, mpsioan.c, mpsliban.c, testlib.c, zcoll.c) -- For the event tools and the test cases, we can define _CRT_SECURE_NO_WARNINGS instead of using the pragma. For the plinth modules, we can't (because these might be compiled from anywhere via mps.c). See job001934.

These warnings are no longer generated, so it is no longer necessary to suppress them:

4100 "unreferenced formal parameter" (config.h)
4115 "named type definition in parentheses" (mpswin.h)
4189 "local variable is initialized but not referenced" (config.h)
4201 "nameless struct/union" (mpswin.h)
4209 "benign typedef redefinition" (mpswin.h)
4214 "bit field types other than int" (mpswin.h)
4244 "conversion from int to char" (bttest.c)
4505 "unreferenced local function has been removed" (config.h)
4514 "unreferenced inline function has been removed" (config.h fmtdy.c, fmtdytst.c, fmtno.c) -- This warning is off by default in modern versions of Visual C/C++ [1] so it no longer needs to be disabled.
4550 "expression evaluates to a function which is missing an argument list" (config.h)
4701 "uninitialized local variables" (testlib.h) -- This warning was only turned off for MPS_BUILD_MV + MPS_ARCH_PP, which is no longer a supported platform.
4702 "unreachable code" (config.h testlib.c)
4705 "statement has no effect" (config.h fmtno.c testlib.h) -- This warning was only turned off for _MSC_VER < 1000 (that is, before Visual C/C++ 3.0) which is no longer a supported platform.
4715 "not all control paths return a value" (config.h)
How foundinspection
Evidence[1] <http://msdn.microsoft.com/en-us/library/cw9x3tcf.aspx>
Created byGareth Rees
Created on2014-03-24 16:58:29
Last modified byGareth Rees
Last modified on2014-03-28 13:09:14
History2014-03-24 GDR Created.

Fixes

Change Effect Date User Description
185072 closed 2014-03-28 13:09:14 Gareth Rees Remove #pragma warning(disable: ...) for Microsoft Visual C/C++ warnings that are no longer generated by the code, so that we get the maximum checking from this compiler.