|
| 1 | +// |
| 2 | +// Copyright 2021 OSR Open Systems Resources, Inc. |
| 3 | +// All rights reserved. |
| 4 | +// |
| 5 | +// Redistribution and use in source and binary forms, with or without |
| 6 | +// modification, are permitted provided that the following conditions are met: |
| 7 | +// |
| 8 | +// 1. Redistributions of source code must retain the above copyright notice, |
| 9 | +// this list of conditions and the following disclaimer. |
| 10 | +// |
| 11 | +// 2. Redistributions in binary form must reproduce the above copyright notice, |
| 12 | +// this list of conditions and the following disclaimer in the documentation |
| 13 | +// and/or other materials provided with the distribution. |
| 14 | +// |
| 15 | +// 3. Neither the name of the copyright holder nor the names of its |
| 16 | +// contributors may be used to endorse or promote products derived from this |
| 17 | +// software without specific prior written permission. |
| 18 | +// |
| 19 | +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 20 | +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 21 | +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 22 | +// ARE DISCLAIMED.IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 23 | +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 24 | +// CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 25 | +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 26 | +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 27 | +// CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) |
| 28 | +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 29 | +// POSSIBILITY OF SUCH DAMAGE |
| 30 | +// |
| 31 | +#pragma once |
| 32 | + |
| 33 | +/////////////////////////// |
| 34 | +// W4 Warnings // |
| 35 | +/////////////////////////// |
| 36 | + |
| 37 | +// |
| 38 | +// The following are C/C++ compiler warnings at W4 that we suppress globally |
| 39 | +// |
| 40 | + |
| 41 | +#pragma warning(disable: 4201) // don't use nameless struct/union |
| 42 | + |
| 43 | + |
| 44 | +////////////////////////////////////// |
| 45 | +// Code Analysis Warnings // |
| 46 | +////////////////////////////////////// |
| 47 | + |
| 48 | +// |
| 49 | +// The following are Code Analysis warnings that we suppress globally. This |
| 50 | +// allows us to use the "All Rules" ruleset and get everything possible while |
| 51 | +// ignoring things that don't make sense for this solution |
| 52 | +// |
| 53 | + |
| 54 | +// |
| 55 | +// GSL Warnings |
| 56 | +// |
| 57 | +#pragma warning(disable: 26429) // Symbol can be marked not_null |
| 58 | +#pragma warning(disable: 26438) // Avoid goto |
| 59 | +#pragma warning(disable: 26440) // Function can be declared noexcept |
| 60 | +#pragma warning(disable: 26446) // Prefer gsl::at() |
| 61 | +#pragma warning(disable: 26448) // Consider using gsl::finally |
| 62 | +#pragma warning(disable: 26476) // Use variant instead of naked union |
| 63 | +#pragma warning(disable: 26477) // Use nullptr rather than NULL |
| 64 | +#pragma warning(disable: 26481) // Don't use pointer arithmetic |
| 65 | +#pragma warning(disable: 26482) // Only index using constant expressions |
| 66 | +#pragma warning(disable: 26485) // No array to pointer decay |
| 67 | +#pragma warning(disable: 26486) // Don't pass a pointer that may be invalid |
| 68 | +#pragma warning(disable: 26487) // Don't return a pointer that may be invalid |
| 69 | +#pragma warning(disable: 26489) // Don't deref a pointer that may be invalid |
| 70 | +#pragma warning(disable: 26493) // Don't use C-style casts |
| 71 | +#pragma warning(disable: 26494) // Always initialize an object |
| 72 | + |
| 73 | +// |
| 74 | +// Native Code Warnings |
| 75 | +// |
| 76 | +// Note that we'll suppress any, "you're using executable memory" warnings that |
| 77 | +// pop up. This would be bad if we didn't also set POOL_NX_OPTIN_XXX |
| 78 | +// |
| 79 | +#if (!defined(POOL_NX_OPTIN) && !defined(POOL_NX_OPTIN_AUTO)) |
| 80 | +#error "Must opt in to NX pool!" |
| 81 | +#endif |
| 82 | + |
| 83 | +#pragma warning(disable: 6320) // Don't use EXCEPTION_EXECUTE_HANDLER |
| 84 | +#pragma warning(disable: 28159) // Use error logging instead of KeBugCheckEx |
| 85 | +#pragma warning(disable: 28160) // Must succeed pool allocations are forbidden |
| 86 | +#pragma warning(disable: 30030) // Must use MdlMappingNoExecute |
0 commit comments