Improve code by using function attributes when possible

Bug #801563 reported by Didier Barvaux
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rohc
Status tracked in Rohc-main
Rohc-main
Fix Released
Wishlist
Didier Barvaux

Bug Description

Fonction attributes may be used to declare a function "const" or declare that some arguments cannot be null. This could improve code clarity and help finding some problems. This could also be useful for the deprecated part of the public API of the library .

See http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html for the possible attributes. The "const", "nonnull(indexes)", "deprecated(msg)", "format(...)", "noreturn", "pure", "visibility" and "warn_unused_result" attributes seem interesting.

Be careful however not to become incompatible with other compilers (see bug #799205 and bug #799206).

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

Fix pushed on master.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.