{"id":17723872,"url":"https://github.com/nemequ/salieri","last_synced_at":"2025-06-16T22:32:14.706Z","repository":{"id":146613480,"uuid":"82736116","full_name":"nemequ/salieri","owner":"nemequ","description":"Source-code annotation language (SAL) compatibility header","archived":false,"fork":false,"pushed_at":"2018-01-03T04:23:06.000Z","size":15,"stargazers_count":46,"open_issues_count":0,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T13:52:08.105Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nemequ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-21T23:02:42.000Z","updated_at":"2025-03-13T01:02:35.000Z","dependencies_parsed_at":"2023-04-19T03:04:25.152Z","dependency_job_id":null,"html_url":"https://github.com/nemequ/salieri","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nemequ/salieri","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemequ%2Fsalieri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemequ%2Fsalieri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemequ%2Fsalieri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemequ%2Fsalieri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nemequ","download_url":"https://codeload.github.com/nemequ/salieri/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemequ%2Fsalieri/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260251389,"owners_count":22981026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-25T15:44:15.584Z","updated_at":"2025-06-16T22:32:14.678Z","avatar_url":"https://github.com/nemequ.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Salieri\n\nSalieri is a header which provides definitions for Microsoft's\n[source-code annotation language\n(SAL)](https://msdn.microsoft.com/en-us/library/hh916383.aspx).\nSimply drop the header into your code and use it instead of including\n`\u003csal.h\u003e` directly, and you can use SAL annotations even if you want\nyour program to be portable to compilers which don't support it.\n\n## SAL?\n\nSAL provides lots of annotations you can use to describe the behavior\nof your program.  There is a [Best Practices and Examples\n(SAL)](https://msdn.microsoft.com/en-us/library/jj159525.aspx) page on\nMSDN if you want to get a very quick idea of how it works, but the\nbasic idea is that you end up with something like this:\n\n```c\n#include \u003csal.h\u003e\n\nvoid zero_buffer(_Out_writes_(size) char* buf, size_t size);\n```\n\n## Why?\n\nMicrosoft ships a `\u003csal.h\u003e` with MSVC, but AFAIK no other compilers\nprovide that file.  Unfortunately, conditionally including it is a bit\ntricky since you also have to ifdef around every time you actually use\nan annotation, which is obviously not feasible.  The result is that,\nif you're writing portable software, you don't get to use SAL (even\nwith MSVC).\n\nSalieri gets around this by providing `#define`s for all the\nannotations.  If the platform supports SAL then Salieri will include\nsal.h, but on other platforms Salieri usually just defines them to\nnothing.  You don't get warnings from the analyzer like you can with\nVS, but at least the code compiles.\n\n## Public APIs\n\nNot only is it possible to use Salieri in your public API, it's\nrecommended.  Doing so allows code using your API to take advantage of\nSAL annotations.\n\nAll you need to do is ship the header with your other headers.  If\ncode using your API also includes Salieri there is no problem, even if\nthe version numbers are different.  There is a guard around\n`salieri.h` to prevent inclusion of *older* versions of Salieri, and\neverything is implemented with macros so if someone includes a newer\nversion we simply redefine everything.  If you need more details, just\ntake a look at the header; it's pretty straightforward.\n\nReally, the only caveat is to make sure the filename doesn't conflict.\nFor example, don't install to `/usr/include/salieri.h`; instead, use\nsomething like `/usr/include/mylib/salieri.h`, or maybe\n`/usr/include/mylib-salieri.h`.\n\n## \"Salieri\"?\n\nAfter [Antonio\nSalieri](https://en.wikipedia.org/wiki/Antonio_Salieri).  If that\ndoesn't ring any bells, well,\n[enjoy](https://www.youtube.com/results?search_query=Salieri).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemequ%2Fsalieri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnemequ%2Fsalieri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemequ%2Fsalieri/lists"}