diff options
| author | mcheshkov <[email protected]> | 2022-02-10 16:46:16 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:46:16 +0300 | 
| commit | 1312621288956f199a5bd5342b0133d4395fa725 (patch) | |
| tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/system | |
| parent | e9d19cec64684c9c1e6b0c98297e5b895cf904fe (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util/system')
| -rw-r--r-- | util/system/compiler.h | 66 | ||||
| -rw-r--r-- | util/system/compiler_ut.cpp | 26 | 
2 files changed, 46 insertions, 46 deletions
| diff --git a/util/system/compiler.h b/util/system/compiler.h index 3766182d829..b373edcc466 100644 --- a/util/system/compiler.h +++ b/util/system/compiler.h @@ -476,44 +476,44 @@ _YandexAbort();      #define Y_PRAGMA_NO_UNUSED_FUNCTION  #endif -/**  - * @ def Y_PRAGMA_NO_UNUSED_PARAMETER  - *  - * Cross-compiler pragma to disable warnings about unused function parameters  - *  - * @see  - *     GCC: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html  - *     Clang: https://clang.llvm.org/docs/DiagnosticsReference.html#wunused-parameter  - *     MSVC: https://msdn.microsoft.com/en-us/library/26kb9fy0.aspx  - *  - * @code  - * Y_PRAGMA_DIAGNOSTIC_PUSH  - * Y_PRAGMA_NO_UNUSED_PARAMETER  - *  - * // some code which introduces a function with unused parameter, e.g.:  - *  - * void foo(int a) {  - *     // a is not referenced  - * }  - *  - * int main() {  - *     foo(1);  - *     return 0;  - * }  - *  - * Y_PRAGMA_DIAGNOSTIC_POP  - * @endcode  - */  +/** + * @ def Y_PRAGMA_NO_UNUSED_PARAMETER + * + * Cross-compiler pragma to disable warnings about unused function parameters + * + * @see + *     GCC: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html + *     Clang: https://clang.llvm.org/docs/DiagnosticsReference.html#wunused-parameter + *     MSVC: https://msdn.microsoft.com/en-us/library/26kb9fy0.aspx + * + * @code + * Y_PRAGMA_DIAGNOSTIC_PUSH + * Y_PRAGMA_NO_UNUSED_PARAMETER + * + * // some code which introduces a function with unused parameter, e.g.: + * + * void foo(int a) { + *     // a is not referenced + * } + * + * int main() { + *     foo(1); + *     return 0; + * } + * + * Y_PRAGMA_DIAGNOSTIC_POP + * @endcode + */  #if defined(__clang__) || defined(__GNUC__)      #define Y_PRAGMA_NO_UNUSED_PARAMETER \          Y_PRAGMA("GCC diagnostic ignored \"-Wunused-parameter\"") -#elif defined(_MSC_VER)  +#elif defined(_MSC_VER)      #define Y_PRAGMA_NO_UNUSED_PARAMETER \          Y_PRAGMA(warning(disable : 4100)) -#else  +#else      #define Y_PRAGMA_NO_UNUSED_PARAMETER -#endif  -  +#endif +  /**   * @def Y_PRAGMA_NO_DEPRECATED   * @@ -540,7 +540,7 @@ _YandexAbort();   * Y_PRAGMA_DIAGNOSTIC_POP   * @endcode   */ -#if defined(__clang__) || defined(__GNUC__)  +#if defined(__clang__) || defined(__GNUC__)      #define Y_PRAGMA_NO_DEPRECATED \          Y_PRAGMA("GCC diagnostic ignored \"-Wdeprecated\"")  #elif defined(_MSC_VER) diff --git a/util/system/compiler_ut.cpp b/util/system/compiler_ut.cpp index 5ab8d6b76f9..f93b1c08507 100644 --- a/util/system/compiler_ut.cpp +++ b/util/system/compiler_ut.cpp @@ -19,21 +19,21 @@ Y_UNIT_TEST_SUITE(TCompilerTest) {          Y_PRAGMA_DIAGNOSTIC_POP      } -    Y_PRAGMA_DIAGNOSTIC_PUSH  -    Y_PRAGMA_NO_UNUSED_PARAMETER  -  -    // define function with unused named parameter  -    // and there will be no warning for this  +    Y_PRAGMA_DIAGNOSTIC_PUSH +    Y_PRAGMA_NO_UNUSED_PARAMETER + +    // define function with unused named parameter +    // and there will be no warning for this      int Foo(int a) { -        return 0;  -    }  -  -    Y_PRAGMA_DIAGNOSTIC_POP  -  -    Y_UNIT_TEST(TestPragmaNoUnusedParameter) {  +        return 0; +    } + +    Y_PRAGMA_DIAGNOSTIC_POP + +    Y_UNIT_TEST(TestPragmaNoUnusedParameter) {          UNIT_ASSERT_EQUAL(Foo(1), 0); -    }  -  +    } +      Y_UNIT_TEST(TestHaveInt128) {  #ifdef Y_HAVE_INT128          // will be compiled without errors | 
