2 ms·
I'm curious if a linter + the new C23 annotation syntax could be used for a similar purpose in C? EDIT: I'm rate limited. If we assume an `[[unsafe]]` attribut
by throwaway894345 3y ago
I'm curious if a linter + the new C23 annotation syntax could be used for a similar purpose in C?
EDIT: I'm rate limited. If we assume an `[[unsafe]]` attribute would only apply to things like pointer arithmetic and unchecked array access (not lifetimes), could such a linter exist?
- Conscat 3y agoUnfortunately the attributes are not nearly rich enough. There are many proposals for massively increasing the information that you can give C compilers, such as the lifetime safety profile and n3005, but it's a very difficult problem to do this in a language that makes pointer aliasing and pointer arithmetic very easy. n3005: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3005.pdf https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3005.pdf