Skip to content

Add SYSLIB0054 and SYSLIB0055 #40834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Breaking change: .NET 9 obsoletions with custom IDs"
titleSuffix: ""
description: Learn about the .NET 9 breaking change in core .NET libraries where some APIs have been marked as obsolete with a custom diagnostic ID.
ms.date: 04/05/2024
ms.date: 05/09/2024
---
# API obsoletions with non-default diagnostic IDs (.NET 9)

Expand All @@ -17,6 +17,8 @@ The following table lists the custom diagnostic IDs and their corresponding warn
| Diagnostic ID | Description | Severity |
| - | - |
| [SYSLIB0009](../../../../fundamentals/syslib-diagnostics/syslib0009.md) | <xref:System.Net.AuthenticationManager> is not supported. Methods will no-op or throw <xref:System.PlatformNotSupportedException>. | Warning |
| [SYSLIB0054](../../../../fundamentals/syslib-diagnostics/syslib0054.md) | <xref:System.Threading.Thread.VolatileRead%2A?displayProperty=nameWithType> and <xref:System.Threading.Thread.VolatileWrite%2A?displayProperty=nameWithType> are obsolete. Use <xref:System.Threading.Volatile.Read%2A?displayProperty=nameWithType> or <xref:System.Threading.Volatile.Write%2A?displayProperty=nameWithType> instead. | Warning |
| [SYSLIB0055](../../../../fundamentals/syslib-diagnostics/syslib0055.md) | `AdvSimd.ShiftRightLogicalRoundedNarrowingSaturate*` methods with signed parameters are obsolete. Use the unsigned overloads instead. | Warning |

## Version introduced

Expand All @@ -38,6 +40,23 @@ These obsoletions can affect [source compatibility](../../categories.md#source-c

- <xref:System.Net.AuthenticationManager?displayProperty=fullName>

### SYSLIB0054

- <xref:System.Threading.Thread.VolatileRead%2A?displayProperty=fullName>
- <xref:System.Threading.Thread.VolatileWrite%2A?displayProperty=fullName>

### SYSLIB0055

- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.Arm64.ShiftRightLogicalRoundedNarrowingSaturateScalar(System.Runtime.Intrinsics.Vector64{System.Int64},System.Byte)?displayProperty=fullName>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.Arm64.ShiftRightLogicalRoundedNarrowingSaturateScalar(System.Runtime.Intrinsics.Vector64{System.Int16},System.Byte)?displayProperty=fullName>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.Arm64.ShiftRightLogicalRoundedNarrowingSaturateScalar(System.Runtime.Intrinsics.Vector64{System.Int32},System.Byte)?displayProperty=fullName>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateLower(System.Runtime.Intrinsics.Vector128{System.Int16},System.Byte)?displayProperty=fullName>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateLower(System.Runtime.Intrinsics.Vector128{System.Int64},System.Byte)?displayProperty=fullName>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateLower(System.Runtime.Intrinsics.Vector128{System.Int32},System.Byte)?displayProperty=fullName>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper(System.Runtime.Intrinsics.Vector64{System.SByte},System.Runtime.Intrinsics.Vector128{System.Int16},System.Byte)?displayProperty=fullName>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper(System.Runtime.Intrinsics.Vector64{System.Int16},System.Runtime.Intrinsics.Vector128{System.Int32},System.Byte)?displayProperty=fullName>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper(System.Runtime.Intrinsics.Vector64{System.Int32},System.Runtime.Intrinsics.Vector128{System.Int64},System.Byte)?displayProperty=fullName>

## See also

- [API obsoletions with non-default diagnostic IDs (.NET 8)](../8.0/obsolete-apis-with-custom-diagnostics.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Obsolete features in .NET 5+
titleSuffix: ""
description: Learn about APIs that are marked as obsolete in .NET 5 and later versions that produce SYSLIB compiler warnings.
ms.date: 06/08/2023
ms.date: 05/09/2024
---

# Obsolete features in .NET 5+
Expand Down Expand Up @@ -74,6 +74,8 @@ The following table provides an index to the `SYSLIB0XXX` obsoletions in .NET 5+
| [SYSLIB0051](syslib0051.md) | Warning | APIs that support obsolete formatter-based serialization are obsolete. They should not be called or extended by application code. |
| [SYSLIB0052](syslib0052.md) | Warning | APIs that support obsolete mechanisms for Regex extensibility are obsolete. |
| [SYSLIB0053](syslib0053.md) | Warning | <xref:System.Security.Cryptography.AesGcm> should indicate the required tag size for encryption and decryption. Use a constructor that accepts the tag size. |
| [SYSLIB0054](syslib0054.md) | Warning | <xref:System.Threading.Thread.VolatileRead%2A?displayProperty=nameWithType> and <xref:System.Threading.Thread.VolatileWrite%2A?displayProperty=nameWithType> are obsolete. Use <xref:System.Threading.Volatile.Read%2A?displayProperty=nameWithType> or <xref:System.Threading.Volatile.Write%2A?displayProperty=nameWithType> instead. |
| [SYSLIB0055](syslib0055.md) | Warning | `AdvSimd.ShiftRightLogicalRoundedNarrowingSaturate*` methods with signed parameters are obsolete. Use the unsigned overloads instead. |

## Suppress warnings

Expand Down
4 changes: 2 additions & 2 deletions docs/fundamentals/syslib-diagnostics/syslib0048.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: SYSLIB0048 warning - RSA.EncryptValue and DecryptValue are obsolete
title: SYSLIB0048 warning - RSA.EncryptValue and RSA.DecryptValue are obsolete
description: Learn about the obsoletion of the RSA.EncryptValue and RSA.DecryptValue methods that generates compile-time warning SYSLIB0048.
ms.date: 04/08/2022
f1_keywords:
- syslib0048
---
# SYSLIB0048: RSA.EncryptValue and DecryptValue are obsolete
# SYSLIB0048: RSA.EncryptValue and RSA.DecryptValue are obsolete

The following methods are obsolete, starting in .NET 8. Calling them in code generates warning `SYSLIB0048` at compile time.

Expand Down
48 changes: 48 additions & 0 deletions docs/fundamentals/syslib-diagnostics/syslib0054.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: SYSLIB0054 warning - Thread.VolatileRead and Thread.VolatileWrite are obsolete
description: Learn about the obsoletion of Thread.VolatileRead and Thread.VolatileWrite that generates compile-time warning SYSLIB0054.
ms.date: 05/09/2024
f1_keywords:
- syslib0054
---
# SYSLIB0054: Thread.VolatileRead and Thread.VolatileWrite are obsolete

All overloads of the <xref:System.Threading.Thread.VolatileRead%2A?displayProperty=nameWithType> and <xref:System.Threading.Thread.VolatileWrite%2A?displayProperty=nameWithType> methods are obsolete, starting in .NET 9. Calling them in code generates warning `SYSLIB0054` at compile time.

## Reason for obsoletion

The .NET Framework implementation of the 64-bit overloads of the <xref:System.Threading.Thread.VolatileRead%2A?displayProperty=nameWithType> and <xref:System.Threading.Thread.VolatileWrite%2A?displayProperty=nameWithType> methods had incorrect atomicity. In .NET (Core), the implementation was changed to delegate to the <xref:System.Threading.Volatile.Read%2A?displayProperty=nameWithType> and <xref:System.Threading.Volatile.Write%2A?displayProperty=nameWithType>, respectively, which provide proper acquire/release semantics. In addition, the methods in the <xref:System.Threading.Thread> class don't include an overload that accepts a Boolean argument, whereas the <xref:System.Threading.Volatile> methods do. The methods were obsoleted to encourage use of the <xref:System.Threading.Volatile> methods.

## Workaround

Call <xref:System.Threading.Volatile.Read%2A?displayProperty=nameWithType> or <xref:System.Threading.Volatile.Write%2A?displayProperty=nameWithType> instead.

## Suppress a warning

If you must use the obsolete APIs, you can suppress the warning in code or in your project file.

To suppress only a single violation, add preprocessor directives to your source file to disable and then re-enable the warning.

```csharp
// Disable the warning.
#pragma warning disable SYSLIB0054

// Code that uses obsolete API.
// ...

// Re-enable the warning.
#pragma warning restore SYSLIB0054
```

To suppress all the `SYSLIB0054` warnings in your project, add a `<NoWarn>` property to your project file.

```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
...
<NoWarn>$(NoWarn);SYSLIB0054</NoWarn>
</PropertyGroup>
</Project>
```

For more information, see [Suppress warnings](obsoletions-overview.md#suppress-warnings).
60 changes: 60 additions & 0 deletions docs/fundamentals/syslib-diagnostics/syslib0055.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: SYSLIB0055 warning - AdvSimd.ShiftRightLogicalRoundedNarrowingSaturate\* methods with signed parameters are obsolete
description: Learn about the obsoletion of AdvSimd.ShiftRightLogicalRoundedNarrowingSaturate\* methods with signed parameters that generates compile-time warning SYSLIB0055.
ms.date: 05/09/2024
f1_keywords:
- syslib0055
---
# SYSLIB0055: AdvSimd.ShiftRightLogicalRoundedNarrowingSaturate\* methods with signed parameters are obsolete

The following methods that accept signed integers are obsolete, starting in .NET 9:

- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.Arm64.ShiftRightLogicalRoundedNarrowingSaturateScalar(System.Runtime.Intrinsics.Vector64{System.Int64},System.Byte)?displayProperty=nameWithType>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.Arm64.ShiftRightLogicalRoundedNarrowingSaturateScalar(System.Runtime.Intrinsics.Vector64{System.Int16},System.Byte)?displayProperty=nameWithType>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.Arm64.ShiftRightLogicalRoundedNarrowingSaturateScalar(System.Runtime.Intrinsics.Vector64{System.Int32},System.Byte)?displayProperty=nameWithType>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateLower(System.Runtime.Intrinsics.Vector128{System.Int16},System.Byte)?displayProperty=nameWithType>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateLower(System.Runtime.Intrinsics.Vector128{System.Int64},System.Byte)?displayProperty=nameWithType>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateLower(System.Runtime.Intrinsics.Vector128{System.Int32},System.Byte)?displayProperty=nameWithType>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper(System.Runtime.Intrinsics.Vector64{System.SByte},System.Runtime.Intrinsics.Vector128{System.Int16},System.Byte)?displayProperty=nameWithType>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper(System.Runtime.Intrinsics.Vector64{System.Int16},System.Runtime.Intrinsics.Vector128{System.Int32},System.Byte)?displayProperty=nameWithType>
- <xref:System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper(System.Runtime.Intrinsics.Vector64{System.Int32},System.Runtime.Intrinsics.Vector128{System.Int64},System.Byte)?displayProperty=nameWithType>

Calling them in code generates warning `SYSLIB0055` at compile time.

## Reason for obsoletion

The Arm Advanced SIMD `UQRSHRN` instruction performs an unsigned saturated narrow operation. As such, its result is always unsigned. However, the affected APIs accepted and returned signed types, meaning they didn't work as expected if you followed the API description rather than the instruction description. In addition, the underlying implementation can't be corrected to perform signed saturated narrow operations and return signed results.

## Workaround

Intentionally convert the data to signed types and call the corresponding unsigned overload instead, for example, <xref:System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper(System.Runtime.Intrinsics.Vector64{System.UInt32},System.Runtime.Intrinsics.Vector128{System.UInt64},System.Byte)?displayProperty=nameWithType>. Then intentionally convert the result to a signed type.

## Suppress a warning

If you must use the obsolete APIs, you can suppress the warning in code or in your project file.

To suppress only a single violation, add preprocessor directives to your source file to disable and then re-enable the warning.

```csharp
// Disable the warning.
#pragma warning disable SYSLIB0055

// Code that uses obsolete API.
// ...

// Re-enable the warning.
#pragma warning restore SYSLIB0055
```

To suppress all the `SYSLIB0055` warnings in your project, add a `<NoWarn>` property to your project file.

```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
...
<NoWarn>$(NoWarn);SYSLIB0055</NoWarn>
</PropertyGroup>
</Project>
```

For more information, see [Suppress warnings](obsoletions-overview.md#suppress-warnings).
4 changes: 4 additions & 0 deletions docs/navigate/tools-diagnostics/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,10 @@ items:
href: ../../fundamentals/syslib-diagnostics/syslib0052.md
- name: SYSLIB0053
href: ../../fundamentals/syslib-diagnostics/syslib0053.md
- name: SYSLIB0054
href: ../../fundamentals/syslib-diagnostics/syslib0054.md
- name: SYSLIB0055
href: ../../fundamentals/syslib-diagnostics/syslib0055.md
- name: Source-generated code
items:
- name: Overview
Expand Down