Fix warnings as errors
authorJan Kotas <jkotas@microsoft.com>
Mon, 10 Dec 2018 14:47:48 +0000 (06:47 -0800)
committerJan Kotas <jkotas@microsoft.com>
Mon, 10 Dec 2018 21:34:54 +0000 (13:34 -0800)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/9084476de3173deaf3c2c39549411fa55f500f72

src/libraries/System.Private.CoreLib/src/System/DateTime.cs

index 1a33479..c0210b0 100644 (file)
@@ -809,10 +809,12 @@ namespace System
                 throw new ArgumentOutOfRangeException(nameof(fileTime), SR.ArgumentOutOfRange_FileTimeInvalid);
             }
 
+#pragma warning disable 162 // Unrechable code on Unix
             if (s_systemSupportsLeapSeconds)
             {
                 return FromFileTimeLeapSecondsAware(fileTime);
             }
+#pragma warning restore 162
 
             // This is the ticks in Universal time for this fileTime.
             long universalTicks = fileTime + FileTimeOffset;
@@ -1316,10 +1318,12 @@ namespace System
             // Treats the input as universal if it is not specified
             long ticks = ((InternalKind & LocalMask) != 0) ? ToUniversalTime().InternalTicks : this.InternalTicks;
 
+#pragma warning disable 162 // Unrechable code on Unix
             if (s_systemSupportsLeapSeconds)
             {
                 return ToFileTimeLeapSecondsAware(ticks);
             }
+#pragma warning restore 162
 
             ticks -= FileTimeOffset;
             if (ticks < 0)