[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Suggestion to use more of GCC function attributes
From: |
Marin Ramesa |
Subject: |
Suggestion to use more of GCC function attributes |
Date: |
Thu, 19 Dec 2013 18:51:04 +0100 |
We already have noreturn attribute. I have identified two more
attributes that might be useful. These are pure and unused.
[PATCH 1/2] kern/strings.c (strlen): mark with attribute pure
Attribute pure means that a function doesn't have any effects except
the return value, and the return value doesn't depend on return values
from other functions. GCC optimizes functions marked with this attribute.
[PATCH 2/2] ddb/db_command.c (db_help_cmd): mark with attribute unused
Attribute unused means just that, that a function is unused. It might be
useful to identify and mark these functions. They might be scheduled for
removal in future versions.
- Suggestion to use more of GCC function attributes,
Marin Ramesa <=