Code health improvement: Use SAL annotations #3372

Open
opened 2026-01-30 23:19:48 +00:00 by claunia · 0 comments
Owner

Originally created by @WSLUser on GitHub (Aug 12, 2019).

Originally assigned to: @DHowett-MSFT on GitHub.

Description of the new feature/enhancement

To help reduce defects and provide better testing, SAL annotations should be applied to all applicable code in this project that utilizes C/C++. Guidance for this can be found at https://docs.microsoft.com/en-us/visualstudio/code-quality/using-sal-annotations-to-reduce-c-cpp-code-defects?view=vs-2019

SAL is the Microsoft source code annotation language. By using source code annotations, you can make the intent behind your code explicit. These annotations also enable automated static analysis tools to analyze your code more accurately, with significantly fewer false positives and false negatives.

A clear and concise description of what you want to happen.

For now, I'd just ensure it's applied to new PRs. Going back to the other code can be done as time permits. A quick action that can be taken in reference to this issue is to update the Contributor's Guide

This issue can be a placeholder to remain open until SAL annotations are applied across the entire code base (similar to the issues for adopting C++ iso standards).

Originally created by @WSLUser on GitHub (Aug 12, 2019). Originally assigned to: @DHowett-MSFT on GitHub. <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement To help reduce defects and provide better testing, SAL annotations should be applied to all applicable code in this project that utilizes C/C++. Guidance for this can be found at https://docs.microsoft.com/en-us/visualstudio/code-quality/using-sal-annotations-to-reduce-c-cpp-code-defects?view=vs-2019 <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> > SAL is the Microsoft source code annotation language. By using source code annotations, you can make the intent behind your code explicit. These annotations also enable automated static analysis tools to analyze your code more accurately, with significantly fewer false positives and false negatives. # A clear and concise description of what you want to happen. For now, I'd just ensure it's applied to new PRs. Going back to the other code can be done as time permits. A quick action that can be taken in reference to this issue is to update the [Contributor's Guide](https://github.com/microsoft/terminal/blob/master/doc/contributing.md) This issue can be a placeholder to remain open until SAL annotations are applied across the entire code base (similar to the issues for adopting C++ iso standards).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3372