NOTE may be invoked only at certain well-defined places in source code:
At the top level; that is, outside of all function definitions, type and struct definitions, variable declarations, and other constructs. For example:
struct foo { int a, b; mutex_t lock; }; NOTE(MUTEX_PROTECTS_DATA(foo::lock, foo)) bar() {...}
At the top level within a block, among declarations or statements. Here too, the annotation must be outside of all type and struct definitions, variable declarations, and other constructs. For example:
foo() { ...; NOTE(...) ...; ...; }