KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Macros
cdefs.h File Reference

Potentially useful definitions for C Programs. More...

#include <sys/cdefs.h>

Go to the source code of this file.

Macros

#define __noreturn   __attribute__((__noreturn__))
 Identify a function that will never return. More...
 
#define __pure   __attribute__((__const__))
 Identify a function that has no side effects other than its return, and only uses its arguments for any work. More...
 
#define __unused   __attribute__((__unused__))
 Identify a function or variable that may be unused. More...
 
#define __dead2   __noreturn /* BSD compat */
 Alias for __noreturn. For BSD compatibility. More...
 
#define __pure2   __pure /* ditto */
 Alias for __pure. Fore BSD compatibility. More...
 
#define __printflike(fmtarg, firstvararg)   __attribute__((__format__ (__printf__, fmtarg, firstvararg)))
 Identify a function as accepting formatting like printf(). More...
 
#define __scanflike(fmtarg, firstvararg)   __attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
 Identify a function as accepting formatting like scanf(). More...
 

Detailed Description

Potentially useful definitions for C Programs.

This file contains definitions of various attribute directives in shorter forms for use in programs (to aid in optimization, mainly).

Author
Dan Potter

Macro Definition Documentation

#define __dead2   __noreturn /* BSD compat */

Alias for __noreturn. For BSD compatibility.

#define __noreturn   __attribute__((__noreturn__))

Identify a function that will never return.

#define __printflike (   fmtarg,
  firstvararg 
)    __attribute__((__format__ (__printf__, fmtarg, firstvararg)))

Identify a function as accepting formatting like printf().

Using this macro allows GCC to typecheck calls to printf-like functions, which can aid in finding mistakes.

Parameters
fmtargThe argument number (1-based) of the format string.
firstvarargThe argument number of the first vararg (the ...).
#define __pure   __attribute__((__const__))

Identify a function that has no side effects other than its return, and only uses its arguments for any work.

#define __pure2   __pure /* ditto */

Alias for __pure. Fore BSD compatibility.

#define __scanflike (   fmtarg,
  firstvararg 
)    __attribute__((__format__ (__scanf__, fmtarg, firstvararg)))

Identify a function as accepting formatting like scanf().

Using this macro allows GCC to typecheck calls to scanf-like functions, which can aid in finding mistakes.

Parameters
fmtargThe argument number (1-based) of the format string.
firstvarargThe argument number of the first vararg (the ...).
#define __unused   __attribute__((__unused__))

Identify a function or variable that may be unused.