% Language Annotation
Validators (lint only)
- ACSL; see Frama-C.
- Linux Kernel's sparse; enables annotation of C to enforce certain rules at
compile time (e.g. tagging of address spaces on pointers, tagging of functions to enforce rules for calling)- Casting, Pointers & Integers
bitwiseGCC-attribute. Warn about explicit or implicit casting to different types. Detailsaddress_space(x)GCC-attribute,xis an integer designating an address space. Pointers are considered different types.forceGCC-attribute for forcing bad casts.noderefGCC-attribute.
- Functions & Function Calls
context(expr,in_c,out_c)GCC-attribute.exprmust have valuein_cwhen called and have valueout_cwhen returning.
- Fields of structs can be marked as requiring designated initializers
using a GCC attribute
designated_init. - More information
- Casting, Pointers & Integers
...
See also Language Research; some tools there are sufficiently powerful as to enable language annotation as a side effect.