What is __USE_MISC macro used for?

c, glibc

Solution

__USE_MISC is defined in `/usr/include/features.h` on the condition:

#if defined _BSD_SOURCE || defined _SVID_SOURCE
# define __USE_MISC     1
#endif

__USE_MISC --> Define things common to BSD and System V Unix.

So it looks like your code wants to ensure that it's defined in any case even if both `_BSD_SOURCE` and `_SVID_SOURCE` are not defined (Since glibc 2.20, defining `_DEFAULT_SOURCE` enables `__USE_MISC`).

See feature test macros for more information.

Problem

I am working on a project and the code contains a macro definition: ``` #define __USE_MISC ``` The code is not using it so I think it has some other purpose.

Original source