More on restrict keyword.


Francis Moreau


I read the latest post on 'restrict' keyword the subject and it makes
me think about the following declaration used by the BSD socket

typedef union {
struct sockaddr * restrict __sockaddr__;
struct sockaddr_at * restrict __sockaddr_at__;
struct sockaddr_un * restrict __sockaddr_un__;
struct sockaddr_in * restrict __sockaddr_in__;
struct sockaddr_in6 * restrict __sockaddr_in6__;
} __SOCKADDR_ARG __attribute__ ((__transparent_union__));

__SOCKADDR_ARG being used as parameter type passed to a couple of
functions such as bind().

Does anybody understand the use of 'restrict' keyword in that case ?

BTW could anybody point out a link that correctly sum up the
definition of 'restrict' ? The formal definition given by the C spec
is almost unreadable for my poor english.



Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question