HomeFreeBSD

Introduce some allocation function attributes.

Description

Introduce some allocation function attributes.

Bring support for two gcc function attributes that are likely to be used
in our system headers:

__alloc_size
The alloc_size attribute is used to tell the compiler that the function
return value points to memory, where the size is given by one or two of
the functions parameters.

__result_use_check
Causes a warning to be emitted if a caller of the function with this
attribute does not use its return value. This is known in gcc as
"warn_unused_result" but we considered the original naming unsuitable
for an attribute.

The __alloc_size attribute required some workarounds for lint(1).
Both attributes are supported by clang.

Also see: D2107

MFC after: 3 days

Details

Provenance
pfgAuthored on
Parents
rS280699: Rough first mdoc, spelling and grammar cleanup pass.
Branches
Unknown
Tags
Unknown

Event Timeline