From 61feb947e258644e7257863ce6c5e4c4632de5f4 Mon Sep 17 00:00:00 2001 From: flywind Date: Tue, 18 Jan 2022 14:50:01 +0800 Subject: [PATCH 1/2] suppress deprecated warnings once bump version to 1.7.3 enable deprecated messages --- lib/system.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/system.nim b/lib/system.nim index 3b3e28344cbb..99528b8822d1 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -213,6 +213,7 @@ proc `addr`*[T](x: T): ptr T {.magic: "Addr", noSideEffect.} = ## echo p[] # b discard +{.push warning[Deprecated]: off.} proc unsafeAddr*[T](x: T): ptr T {.magic: "Addr", noSideEffect, deprecated: "'unsafeAddr' is a deprecated alias for 'addr'".} = ## Builtin `addr` operator for taking the address of a memory @@ -227,6 +228,7 @@ proc unsafeAddr*[T](x: T): ptr T {.magic: "Addr", noSideEffect, ## ## Cannot be overloaded. discard +{.pop.} type `static`*[T] {.magic: "Static".} From a0b6904cfa5654287bc4426d5e8124ec1b2c190b Mon Sep 17 00:00:00 2001 From: flywind Date: Tue, 18 Jan 2022 16:45:55 +0800 Subject: [PATCH 2/2] deprecate later --- lib/system.nim | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/system.nim b/lib/system.nim index 99528b8822d1..02da048e49ef 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -213,9 +213,7 @@ proc `addr`*[T](x: T): ptr T {.magic: "Addr", noSideEffect.} = ## echo p[] # b discard -{.push warning[Deprecated]: off.} -proc unsafeAddr*[T](x: T): ptr T {.magic: "Addr", noSideEffect, - deprecated: "'unsafeAddr' is a deprecated alias for 'addr'".} = +proc unsafeAddr*[T](x: T): ptr T {.magic: "Addr", noSideEffect.} = ## Builtin `addr` operator for taking the address of a memory ## location. ## @@ -228,7 +226,6 @@ proc unsafeAddr*[T](x: T): ptr T {.magic: "Addr", noSideEffect, ## ## Cannot be overloaded. discard -{.pop.} type `static`*[T] {.magic: "Static".}