3 ms·
Good article. If you're compiling C with MSVC then you can use SAL annotations [1] which serve the same purpose. [1] https://learn.microsoft.com/en-us/cpp/code
by hgs3 4y ago
Good article. If you're compiling C with MSVC then you can use SAL annotations [1] which serve the same purpose.
[1] https://learn.microsoft.com/en-us/cpp/code-quality/annotating-structs-and-classes?view=msvc-170#example https://learn.microsoft.com/en-us/cpp/code-quality/annotatin...
- funny_falcon 4y agoWow, such a great annotation language. Wish it were in GCC as well.
- leeter 4y agoI keep hoping that the C and C++ committees will get together and standardize some of that in the form of C23/C++11 style attributes. But that is sadly likely a naïve hope.
- pjmlp 4y agoMicrosoft hopes to be able to map SAL into C++ contracts if they ever be part of the standard, as that was their initial goal when they started implementing lifetimes support in VC++. As for C folks, I don't have any hopes of them every going down that route.