Function pointers should never be called func

Make the maintenance engineer hell. See the following definition.

typedef void *(*)(void *) work_func_t;

struct s {
    struct list_head work;
    work_func_t *func;
    void *data;
}

Where work_func_t is a function pointer. What is the problem in this definition?

Say that every pointer to function in a struct is called func. Any form of search through the code (cscope, grep, sed…) will return more results than one can ¬†reasonably parse.

Do not do it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s