Programming languages — C (INTERNATIONAL STANDARD ISO/IEC 9899:TC3) - page 12

 

  Главная      Manuals     Programming languages — C (INTERNATIONAL STANDARD ISO/IEC 9899:TC3) - 2007 year

 

Search            copyright infringement  

 

 

 

 

 

 

 

 

 

 

 

Content      ..     10      11      12      13     ..

 

 

 

Programming languages — C (INTERNATIONAL STANDARD ISO/IEC 9899:TC3) - page 12

 

 

Annex A

(informative)

Language syntax summary

1

NOTE The notation is described in 6.1.

A.1 Lexical grammar

A.1.1 Lexical elements

(6.4) token:

keyword
identifier
constant
string-literal
punctuator

(6.4) preprocessing-token:

header-name
identifier
pp-number
character-constant
string-literal
punctuator
each non-white-space character that cannot be one of the above

A.1.2 Keywords

(6.4.1) keyword: one of

auto

break

case

char

const

continue

default

do

double

else

enum

extern

float

for

goto

if

inline

int

long

register

restrict

return

short

signed

sizeof

static

struct

switch

typedef

union

unsigned

void

volatile

while

_Bool

_Complex

_Imaginary

§A.1.2 Language syntax summary

403

A.1.3 Identifiers

(6.4.2.1) identifier:

identifier-nondigit
identifier identifier-nondigit
identifier digit

(6.4.2.1) identifier-nondigit:

nondigit
universal-character-name
other implementation-defined characters

(6.4.2.1) nondigit: one of

_

a

b

c

d

e

f

g

h

i

j

k

l

m

n

o

p

q

r

s

t

u

v

w

x

y

z

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

(6.4.2.1) digit: one of

0

1

2

3

4

5

6

7

8

9

A.1.4 Universal character names

(6.4.3) universal-character-name:

\u

hex-quad

\U

hex-quad hex-quad

(6.4.3) hex-quad:

hexadecimal-digit hexadecimal-digit

hexadecimal-digit hexadecimal-digit

A.1.5 Constants

(6.4.4) constant:

integer-constant
floating-constant
enumeration-constant
character-constant

(6.4.4.1) integer-constant:

decimal-constant integer-suffix

opt

octal-constant integer-suffix

opt

hexadecimal-constant integer-suffix

opt

(6.4.4.1) decimal-constant:

nonzero-digit
decimal-constant digit

404 Language syntax summary

§A.1.5

(6.4.4.1) octal-constant:

0

octal-constant octal-digit

(6.4.4.1) hexadecimal-constant:

hexadecimal-prefix hexadecimal-digit
hexadecimal-constant hexadecimal-digit

(6.4.4.1) hexadecimal-prefix: one of

0x 0X

(6.4.4.1) nonzero-digit: one of

1

2

3

4

5

6

7

8

9

(6.4.4.1) octal-digit: one of

0

1

2

3

4

5

6

7

(6.4.4.1) hexadecimal-digit: one of

0

1

2

3

4

5

6

7

8

9

a

b

c

d

e

f

A

B

C

D

E

F

(6.4.4.1) integer-suffix:

unsigned-suffix long-suffix

opt

unsigned-suffix long-long-suffix
long-suffix unsigned-suffix

opt

long-long-suffix unsigned-suffix

opt

(6.4.4.1) unsigned-suffix: one of

u

U

(6.4.4.1) long-suffix: one of

l

L

(6.4.4.1) long-long-suffix: one of

ll LL

(6.4.4.2) floating-constant:

decimal-floating-constant
hexadecimal-floating-constant

(6.4.4.2) decimal-floating-constant:

fractional-constant exponent-part

opt

floating-suffix

opt

digit-sequence exponent-part floating-suffix

opt

§A.1.5 Language syntax summary

405

(6.4.4.2) hexadecimal-floating-constant:

hexadecimal-prefix hexadecimal-fractional-constant

binary-exponent-part floating-suffix

opt

hexadecimal-prefix hexadecimal-digit-sequence

binary-exponent-part floating-suffix

opt

(6.4.4.2) fractional-constant:

digit-sequence

opt

.

digit-sequence

digit-sequence

.

(6.4.4.2) exponent-part:

e

sign

opt

digit-sequence

E

sign

opt

digit-sequence

(6.4.4.2) sign: one of

+

-

(6.4.4.2) digit-sequence:

digit
digit-sequence digit

(6.4.4.2) hexadecimal-fractional-constant:

hexadecimal-digit-sequence

opt

.

hexadecimal-digit-sequence

hexadecimal-digit-sequence

.

(6.4.4.2) binary-exponent-part:

p

sign

opt

digit-sequence

P

sign

opt

digit-sequence

(6.4.4.2) hexadecimal-digit-sequence:

hexadecimal-digit
hexadecimal-digit-sequence hexadecimal-digit

(6.4.4.2) floating-suffix: one of

f

l

F

L

(6.4.4.3) enumeration-constant:

identifier

(6.4.4.4) character-constant:

'

c-char-sequence

'

L'

c-char-sequence

'

406 Language syntax summary

§A.1.5

(6.4.4.4) c-char-sequence:

c-char
c-char-sequence c-char

(6.4.4.4) c-char:

any member of the source character set except

the single-quote

'

, backslash

\

, or new-line character

escape-sequence

(6.4.4.4) escape-sequence:

simple-escape-sequence
octal-escape-sequence
hexadecimal-escape-sequence
universal-character-name

(6.4.4.4) simple-escape-sequence: one of

\' \" \? \\

\a \b \f \n \r \t \v

(6.4.4.4) octal-escape-sequence:

\

octal-digit

\

octal-digit octal-digit

\

octal-digit octal-digit octal-digit

(6.4.4.4) hexadecimal-escape-sequence:

\x

hexadecimal-digit

hexadecimal-escape-sequence hexadecimal-digit

A.1.6 String literals

(6.4.5) string-literal:

"

s-char-sequence

opt

"

L"

s-char-sequence

opt

"

(6.4.5) s-char-sequence:

s-char
s-char-sequence s-char

(6.4.5) s-char:

any member of the source character set except

the double-quote

"

, backslash

\

, or new-line character

escape-sequence

§A.1.6 Language syntax summary

407

A.1.7 Punctuators

(6.4.6) punctuator: one of

[

]

(

)

{

}

.

->

++ -- & * + - ~ !

/

%

<<

>>

<

>

<=

>=

==

!=

^

|

&&

||

?

:

;

...

=

*=

/=

%=

+=

-=

<<= >>= &= ^= |=

,

#

##

<: :> <% %> %: %:%:

A.1.8 Header names

(6.4.7) header-name:

<

h-char-sequence

>

"

q-char-sequence

"

(6.4.7) h-char-sequence:

h-char
h-char-sequence h-char

(6.4.7) h-char:

any member of the source character set except

the new-line character and

>

(6.4.7) q-char-sequence:

q-char
q-char-sequence q-char

(6.4.7) q-char:

any member of the source character set except

the new-line character and

"

A.1.9 Preprocessing numbers

(6.4.8) pp-number:

digit

.

digit

pp-number digit
pp-number identifier-nondigit
pp-number

e

sign

pp-number

E

sign

pp-number

p

sign

pp-number

P

sign

pp-number

.

408 Language syntax summary

§A.1.9

A.2 Phrase structure grammar

A.2.1 Expressions

(6.5.1) primary-expression:

identifier
constant
string-literal

(

expression

)

(6.5.2) postfix-expression:

primary-expression
postfix-expression

[

expression

]

postfix-expression

(

argument-expression-list

opt

)

postfix-expression

.

identifier

postfix-expression

->

identifier

postfix-expression

++

postfix-expression

--

(

type-name

) {

initializer-list

}

(

type-name

) {

initializer-list

, }

(6.5.2) argument-expression-list:

assignment-expression
argument-expression-list

,

assignment-expression

(6.5.3) unary-expression:

postfix-expression

++

unary-expression

--

unary-expression

unary-operator cast-expression

sizeof

unary-expression

sizeof (

type-name

)

(6.5.3) unary-operator: one of

&

*

+

-

~

!

(6.5.4) cast-expression:

unary-expression

(

type-name

)

cast-expression

(6.5.5) multiplicative-expression:

cast-expression
multiplicative-expression

*

cast-expression

multiplicative-expression

/

cast-expression

multiplicative-expression

%

cast-expression

§A.2.1 Language syntax summary

409

(6.5.6) additive-expression:

multiplicative-expression
additive-expression

+

multiplicative-expression

additive-expression

-

multiplicative-expression

(6.5.7) shift-expression:

additive-expression
shift-expression

<<

additive-expression

shift-expression

>>

additive-expression

(6.5.8) relational-expression:

shift-expression
relational-expression

<

shift-expression

relational-expression

>

shift-expression

relational-expression

<=

shift-expression

relational-expression

>=

shift-expression

(6.5.9) equality-expression:

relational-expression
equality-expression

==

relational-expression

equality-expression

!=

relational-expression

(6.5.10) AND-expression:

equality-expression
AND-expression

&

equality-expression

(6.5.11) exclusive-OR-expression:

AND-expression
exclusive-OR-expression

^

AND-expression

(6.5.12) inclusive-OR-expression:

exclusive-OR-expression
inclusive-OR-expression

|

exclusive-OR-expression

(6.5.13) logical-AND-expression:

inclusive-OR-expression
logical-AND-expression

&&

inclusive-OR-expression

(6.5.14) logical-OR-expression:

logical-AND-expression
logical-OR-expression

||

logical-AND-expression

(6.5.15) conditional-expression:

logical-OR-expression
logical-OR-expression

?

expression

:

conditional-expression

410 Language syntax summary

§A.2.1

(6.5.16) assignment-expression:

conditional-expression
unary-expression assignment-operator assignment-expression

(6.5.16) assignment-operator: one of

=

*=

/=

%=

+=

-=

<<= >>= &= ^= |=

(6.5.17) expression:

assignment-expression
expression

,

assignment-expression

(6.6) constant-expression:

conditional-expression

A.2.2 Declarations

(6.7) declaration:

declaration-specifiers init-declarator-list

opt

;

(6.7) declaration-specifiers:

storage-class-specifier declaration-specifiers

opt

type-specifier declaration-specifiers

opt

type-qualifier declaration-specifiers

opt

function-specifier declaration-specifiers

opt

(6.7) init-declarator-list:

init-declarator
init-declarator-list

,

init-declarator

(6.7) init-declarator:

declarator
declarator

=

initializer

(6.7.1) storage-class-specifier:

typedef

extern

static

auto

register

§A.2.2 Language syntax summary

411

(6.7.2) type-specifier:

void

char

short

int

long

float

double

signed

unsigned

_Bool

_Complex

struct-or-union-specifier

enum-specifier
typedef-name

(6.7.2.1) struct-or-union-specifier:

struct-or-union identifier

opt

{

struct-declaration-list

}

struct-or-union identifier

(6.7.2.1) struct-or-union:

struct

union

(6.7.2.1) struct-declaration-list:

struct-declaration
struct-declaration-list struct-declaration

(6.7.2.1) struct-declaration:

specifier-qualifier-list struct-declarator-list

;

(6.7.2.1) specifier-qualifier-list:

type-specifier specifier-qualifier-list

opt

type-qualifier specifier-qualifier-list

opt

(6.7.2.1) struct-declarator-list:

struct-declarator
struct-declarator-list

,

struct-declarator

(6.7.2.1) struct-declarator:

declarator
declarator

opt

:

constant-expression

412 Language syntax summary

§A.2.2

(6.7.2.2) enum-specifier:

enum

identifier

opt

{

enumerator-list

}

enum

identifier

opt

{

enumerator-list

, }

enum

identifier

(6.7.2.2) enumerator-list:

enumerator
enumerator-list

,

enumerator

(6.7.2.2) enumerator:

enumeration-constant
enumeration-constant

=

constant-expression

(6.7.3) type-qualifier:

const

restrict

volatile

(6.7.4) function-specifier:

inline

(6.7.5) declarator:

pointer

opt

direct-declarator

(6.7.5) direct-declarator:

identifier

(

declarator

)

direct-declarator

[

type-qualifier-list

opt

assignment-expression

opt

]

direct-declarator

[ static

type-qualifier-list

opt

assignment-expression

]

direct-declarator

[

type-qualifier-list

static

assignment-expression

]

direct-declarator

[

type-qualifier-list

opt

* ]

direct-declarator

(

parameter-type-list

)

direct-declarator

(

identifier-list

opt

)

(6.7.5) pointer:

*

type-qualifier-list

opt

*

type-qualifier-list

opt

pointer

(6.7.5) type-qualifier-list:

type-qualifier
type-qualifier-list type-qualifier

(6.7.5) parameter-type-list:

parameter-list
parameter-list

, ...

§A.2.2 Language syntax summary

413

(6.7.5) parameter-list:

parameter-declaration
parameter-list

,

parameter-declaration

(6.7.5) parameter-declaration:

declaration-specifiers declarator
declaration-specifiers abstract-declarator

opt

(6.7.5) identifier-list:

identifier
identifier-list

,

identifier

(6.7.6) type-name:

specifier-qualifier-list abstract-declarator

opt

(6.7.6) abstract-declarator:

pointer
pointer

opt

direct-abstract-declarator

(6.7.6) direct-abstract-declarator:

(

abstract-declarator

)

direct-abstract-declarator

opt

[

type-qualifier-list

opt

assignment-expression

opt

]

direct-abstract-declarator

opt

[ static

type-qualifier-list

opt

assignment-expression

]

direct-abstract-declarator

opt

[

type-qualifier-list

static

assignment-expression

]

direct-abstract-declarator

opt

[ * ]

direct-abstract-declarator

opt

(

parameter-type-list

opt

)

(6.7.7) typedef-name:

identifier

(6.7.8) initializer:

assignment-expression

{

initializer-list

}

{

initializer-list

, }

(6.7.8) initializer-list:

designation

opt

initializer

initializer-list

,

designation

opt

initializer

(6.7.8) designation:

designator-list

=

414 Language syntax summary

§A.2.2

(6.7.8) designator-list:

designator
designator-list designator

(6.7.8) designator:

[

constant-expression

]

.

identifier

A.2.3 Statements

(6.8) statement:

labeled-statement
compound-statement
expression-statement
selection-statement
iteration-statement
jump-statement

(6.8.1) labeled-statement:

identifier

:

statement

case

constant-expression

:

statement

default :

statement

(6.8.2) compound-statement:

{

block-item-list

opt

}

(6.8.2) block-item-list:

block-item
block-item-list block-item

(6.8.2) block-item:

declaration
statement

(6.8.3) expression-statement:

expression

opt

;

(6.8.4) selection-statement:

if (

expression

)

statement

if (

expression

)

statement

else

statement

switch (

expression

)

statement

§A.2.3 Language syntax summary

415

(6.8.5) iteration-statement:

while (

expression

)

statement

do

statement

while (

expression

) ;

for (

expression

opt

;

expression

opt

;

expression

opt

)

statement

for (

declaration expression

opt

;

expression

opt

)

statement

(6.8.6) jump-statement:

goto

identifier

;

continue ;

break ;

return

expression

opt

;

A.2.4 External definitions

(6.9) translation-unit:

external-declaration
translation-unit external-declaration

(6.9) external-declaration:

function-definition
declaration

(6.9.1) function-definition:

declaration-specifiers declarator declaration-list

opt

compound-statement

(6.9.1) declaration-list:

declaration
declaration-list declaration

A.3 Preprocessing directives

(6.10) preprocessing-file:

group

opt

(6.10) group:

group-part
group group-part

(6.10) group-part:

if-section
control-line
text-line

#

non-directive

(6.10) if-section:

if-group elif-groups

opt

else-group

opt

endif-line

416 Language syntax summary

§A.3

(6.10) if-group:

# if

constant-expression new-line group

opt

# ifdef

identifier new-line group

opt

# ifndef

identifier new-line group

opt

(6.10) elif-groups:

elif-group
elif-groups elif-group

(6.10) elif-group:

# elif

constant-expression new-line group

opt

(6.10) else-group:

# else

new-line group

opt

(6.10) endif-line:

# endif

new-line

(6.10) control-line:

# include

pp-tokens new-line

# define

identifier replacement-list new-line

# define

identifier lparen identifier-list

opt

)

replacement-list new-line

# define

identifier lparen

... )

replacement-list new-line

# define

identifier lparen identifier-list

, ... )

replacement-list new-line

# undef

identifier new-line

# line

pp-tokens new-line

# error

pp-tokens

opt

new-line

# pragma

pp-tokens

opt

new-line

#

new-line

(6.10) text-line:

pp-tokens

opt

new-line

(6.10) non-directive:

pp-tokens new-line

(6.10) lparen:

a

(

character not immediately preceded by white-space

(6.10) replacement-list:

pp-tokens

opt

§A.3 Language syntax summary

417

(6.10) pp-tokens:

preprocessing-token
pp-tokens preprocessing-token

(6.10) new-line:

the new-line character

418 Language syntax summary

§A.3

Annex B

(informative)

Library summary

B.1 Diagnostics

<assert.h>

NDEBUG

void assert(

scalar

expression);

B.2 Complex

<complex.h>

complex

_Complex_I

imaginary

_Imaginary_I

I

#pragma STDC CX_LIMITED_RANGE

on-off-switch

double complex cacos(double complex z);

float complex cacosf(float complex z);

long double complex cacosl(long double complex z);

double complex casin(double complex z);

float complex casinf(float complex z);

long double complex casinl(long double complex z);

double complex catan(double complex z);

float complex catanf(float complex z);

long double complex catanl(long double complex z);

double complex ccos(double complex z);

float complex ccosf(float complex z);

long double complex ccosl(long double complex z);

double complex csin(double complex z);

float complex csinf(float complex z);

long double complex csinl(long double complex z);

double complex ctan(double complex z);

float complex ctanf(float complex z);

long double complex ctanl(long double complex z);

double complex cacosh(double complex z);

float complex cacoshf(float complex z);

long double complex cacoshl(long double complex z);

double complex casinh(double complex z);

float complex casinhf(float complex z);

long double complex casinhl(long double complex z);

double complex catanh(double complex z);

float complex catanhf(float complex z);

long double complex catanhl(long double complex z);

§B.2 Library summary 419

double complex ccosh(double complex z);

float complex ccoshf(float complex z);

long double complex ccoshl(long double complex z);

double complex csinh(double complex z);

float complex csinhf(float complex z);

long double complex csinhl(long double complex z);

double complex ctanh(double complex z);

float complex ctanhf(float complex z);

long double complex ctanhl(long double complex z);

double complex cexp(double complex z);

float complex cexpf(float complex z);

long double complex cexpl(long double complex z);

double complex clog(double complex z);

float complex clogf(float complex z);

long double complex clogl(long double complex z);

double cabs(double complex z);

float cabsf(float complex z);

long double cabsl(long double complex z);

double complex cpow(double complex x, double complex y);

float complex cpowf(float complex x, float complex y);

long double complex cpowl(long double complex x,

long double complex y);

double complex csqrt(double complex z);

float complex csqrtf(float complex z);

long double complex csqrtl(long double complex z);

double carg(double complex z);

float cargf(float complex z);

long double cargl(long double complex z);

double cimag(double complex z);

float cimagf(float complex z);

long double cimagl(long double complex z);

double complex conj(double complex z);

float complex conjf(float complex z);

long double complex conjl(long double complex z);

double complex cproj(double complex z);

float complex cprojf(float complex z);

long double complex cprojl(long double complex z);

double creal(double complex z);

float crealf(float complex z);

long double creall(long double complex z);

420 Library summary §B.2

B.3 Character handling

<ctype.h>

int isalnum(int c);

int isalpha(int c);

int isblank(int c);

int iscntrl(int c);

int isdigit(int c);

int isgraph(int c);

int islower(int c);

int isprint(int c);

int ispunct(int c);

int isspace(int c);

int isupper(int c);

int isxdigit(int c);

int tolower(int c);

int toupper(int c);

B.4 Errors

<errno.h>

EDOM

EILSEQ

ERANGE

errno

B.5 Floating-point environment

<fenv.h>

fenv_t

fexcept_t

FE_DIVBYZERO

FE_INEXACT

FE_INVALID

FE_OVERFLOW

FE_UNDERFLOW

FE_ALL_EXCEPT

FE_DOWNWARD

FE_TONEAREST

FE_TOWARDZERO

FE_UPWARD

FE_DFL_ENV

#pragma STDC FENV_ACCESS

on-off-switch

int feclearexcept(int excepts);

int fegetexceptflag(fexcept_t *flagp, int excepts);

int feraiseexcept(int excepts);

int fesetexceptflag(const fexcept_t *flagp,

int excepts);

int fetestexcept(int excepts);

int fegetround(void);

int fesetround(int round);

int fegetenv(fenv_t *envp);

int feholdexcept(fenv_t *envp);

int fesetenv(const fenv_t *envp);

int feupdateenv(const fenv_t *envp);

§B.5 Library summary 421

B.6 Characteristics of floating types

<float.h>

FLT_ROUNDS

FLT_EVAL_METHOD

FLT_RADIX

FLT_MANT_DIG

DBL_MANT_DIG

LDBL_MANT_DIG

DECIMAL_DIG

FLT_DIG

DBL_DIG

LDBL_DIG

FLT_MIN_EXP

DBL_MIN_EXP

LDBL_MIN_EXP

FLT_MIN_10_EXP

DBL_MIN_10_EXP

LDBL_MIN_10_EXP

FLT_MAX_EXP

DBL_MAX_EXP

LDBL_MAX_EXP

FLT_MAX_10_EXP

DBL_MAX_10_EXP

LDBL_MAX_10_EXP

FLT_MAX

DBL_MAX

LDBL_MAX

FLT_EPSILON

DBL_EPSILON

LDBL_EPSILON

FLT_MIN

DBL_MIN

LDBL_MIN

B.7 Format conversion of integer types

<inttypes.h>

imaxdiv_t

PRId

N

PRIdLEAST

N

PRIdFAST

N

PRIdMAX PRIdPTR

PRIi

N

PRIiLEAST

N

PRIiFAST

N

PRIiMAX PRIiPTR

PRIo

N

PRIoLEAST

N

PRIoFAST

N

PRIoMAX PRIoPTR

PRIu

N

PRIuLEAST

N

PRIuFAST

N

PRIuMAX PRIuPTR

PRIx

N

PRIxLEAST

N

PRIxFAST

N

PRIxMAX PRIxPTR

PRIX

N

PRIXLEAST

N

PRIXFAST

N

PRIXMAX PRIXPTR

SCNd

N

SCNdLEAST

N

SCNdFAST

N

SCNdMAX SCNdPTR

SCNi

N

SCNiLEAST

N

SCNiFAST

N

SCNiMAX SCNiPTR

SCNo

N

SCNoLEAST

N

SCNoFAST

N

SCNoMAX SCNoPTR

SCNu

N

SCNuLEAST

N

SCNuFAST

N

SCNuMAX SCNuPTR

SCNx

N

SCNxLEAST

N

SCNxFAST

N

SCNxMAX SCNxPTR

intmax_t imaxabs(intmax_t j);

imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);

intmax_t strtoimax(const char * restrict nptr,

char ** restrict endptr, int base);

uintmax_t strtoumax(const char * restrict nptr,

char ** restrict endptr, int base);

intmax_t wcstoimax(const wchar_t * restrict nptr,

wchar_t ** restrict endptr, int base);

uintmax_t wcstoumax(const wchar_t * restrict nptr,

wchar_t ** restrict endptr, int base);

422 Library summary §B.7

B.8 Alternative spellings

<iso646.h>

and

and_eq

bitand

bitor

compl

not

not_eq

or

or_eq

xor

xor_eq

B.9 Sizes of integer types

<limits.h>

CHAR_BIT

SCHAR_MIN

SCHAR_MAX

UCHAR_MAX

CHAR_MIN

CHAR_MAX

MB_LEN_MAX

SHRT_MIN

SHRT_MAX

USHRT_MAX

INT_MIN

INT_MAX

UINT_MAX

LONG_MIN

LONG_MAX

ULONG_MAX

LLONG_MIN

LLONG_MAX

ULLONG_MAX

B.10 Localization

<locale.h>

struct lconv

NULL

LC_ALL

LC_COLLATE

LC_CTYPE

LC_MONETARY

LC_NUMERIC

LC_TIME

char *setlocale(int category, const char *locale);

struct lconv *localeconv(void);

B.11 Mathematics

<math.h>

float_t

double_t

HUGE_VAL

HUGE_VALF

HUGE_VALL

INFINITY

NAN

FP_INFINITE

FP_NAN

FP_NORMAL

FP_SUBNORMAL

FP_ZERO

FP_FAST_FMA

FP_FAST_FMAF

FP_FAST_FMAL

FP_ILOGB0

FP_ILOGBNAN

MATH_ERRNO

MATH_ERREXCEPT

math_errhandling

#pragma STDC FP_CONTRACT

on-off-switch

int fpclassify(

real-floating

x);

int isfinite(

real-floating

x);

int isinf(

real-floating

x);

int isnan(

real-floating

x);

int isnormal(

real-floating

x);

int signbit(

real-floating

x);

double acos(double x);

float acosf(float x);

long double acosl(long double x);

double asin(double x);

float asinf(float x);

long double asinl(long double x);

double atan(double x);

§B.11 Library summary 423

float atanf(float x);

long double atanl(long double x);

double atan2(double y, double x);

float atan2f(float y, float x);

long double atan2l(long double y, long double x);

double cos(double x);

float cosf(float x);

long double cosl(long double x);

double sin(double x);

float sinf(float x);

long double sinl(long double x);

double tan(double x);

float tanf(float x);

long double tanl(long double x);

double acosh(double x);

float acoshf(float x);

long double acoshl(long double x);

double asinh(double x);

float asinhf(float x);

long double asinhl(long double x);

double atanh(double x);

float atanhf(float x);

long double atanhl(long double x);

double cosh(double x);

float coshf(float x);

long double coshl(long double x);

double sinh(double x);

float sinhf(float x);

long double sinhl(long double x);

double tanh(double x);

float tanhf(float x);

long double tanhl(long double x);

double exp(double x);

float expf(float x);

long double expl(long double x);

double exp2(double x);

float exp2f(float x);

long double exp2l(long double x);

double expm1(double x);

float expm1f(float x);

long double expm1l(long double x);

424 Library summary §B.11

double frexp(double value, int *exp);

float frexpf(float value, int *exp);

long double frexpl(long double value, int *exp);

int ilogb(double x);

int ilogbf(float x);

int ilogbl(long double x);

double ldexp(double x, int exp);

float ldexpf(float x, int exp);

long double ldexpl(long double x, int exp);

double log(double x);

float logf(float x);

long double logl(long double x);

double log10(double x);

float log10f(float x);

long double log10l(long double x);

double log1p(double x);

float log1pf(float x);

long double log1pl(long double x);

double log2(double x);

float log2f(float x);

long double log2l(long double x);

double logb(double x);

float logbf(float x);

long double logbl(long double x);

double modf(double value, double *iptr);

float modff(float value, float *iptr);

long double modfl(long double value, long double *iptr);

double scalbn(double x, int n);

float scalbnf(float x, int n);

long double scalbnl(long double x, int n);

double scalbln(double x, long int n);

float scalblnf(float x, long int n);

long double scalblnl(long double x, long int n);

double cbrt(double x);

float cbrtf(float x);

long double cbrtl(long double x);

double fabs(double x);

float fabsf(float x);

long double fabsl(long double x);

double hypot(double x, double y);

float hypotf(float x, float y);

§B.11 Library summary 425

long double hypotl(long double x, long double y);

double pow(double x, double y);

float powf(float x, float y);

long double powl(long double x, long double y);

double sqrt(double x);

float sqrtf(float x);

long double sqrtl(long double x);

double erf(double x);

float erff(float x);

long double erfl(long double x);

double erfc(double x);

float erfcf(float x);

long double erfcl(long double x);

double lgamma(double x);

float lgammaf(float x);

long double lgammal(long double x);

double tgamma(double x);

float tgammaf(float x);

long double tgammal(long double x);

double ceil(double x);

float ceilf(float x);

long double ceill(long double x);

double floor(double x);

float floorf(float x);

long double floorl(long double x);

double nearbyint(double x);

float nearbyintf(float x);

long double nearbyintl(long double x);

double rint(double x);

float rintf(float x);

long double rintl(long double x);

long int lrint(double x);

long int lrintf(float x);

long int lrintl(long double x);

long long int llrint(double x);

long long int llrintf(float x);

long long int llrintl(long double x);

double round(double x);

float roundf(float x);

long double roundl(long double x);

long int lround(double x);

426 Library summary §B.11

long int lroundf(float x);

long int lroundl(long double x);

long long int llround(double x);

long long int llroundf(float x);

long long int llroundl(long double x);

double trunc(double x);

float truncf(float x);

long double truncl(long double x);

double fmod(double x, double y);

float fmodf(float x, float y);

long double fmodl(long double x, long double y);

double remainder(double x, double y);

float remainderf(float x, float y);

long double remainderl(long double x, long double y);

double remquo(double x, double y, int *quo);

float remquof(float x, float y, int *quo);

long double remquol(long double x, long double y,

int *quo);

double copysign(double x, double y);

float copysignf(float x, float y);

long double copysignl(long double x, long double y);

double nan(const char *tagp);

float nanf(const char *tagp);

long double nanl(const char *tagp);

double nextafter(double x, double y);

float nextafterf(float x, float y);

long double nextafterl(long double x, long double y);

double nexttoward(double x, long double y);

float nexttowardf(float x, long double y);

long double nexttowardl(long double x, long double y);

double fdim(double x, double y);

float fdimf(float x, float y);

long double fdiml(long double x, long double y);

double fmax(double x, double y);

float fmaxf(float x, float y);

long double fmaxl(long double x, long double y);

double fmin(double x, double y);

float fminf(float x, float y);

long double fminl(long double x, long double y);

double fma(double x, double y, double z);

float fmaf(float x, float y, float z);

§B.11 Library summary 427

long double fmal(long double x, long double y,

long double z);

int isgreater(

real-floating

x,

real-floating

y);

int isgreaterequal(

real-floating

x,

real-floating

y);

int isless(

real-floating

x,

real-floating

y);

int islessequal(

real-floating

x,

real-floating

y);

int islessgreater(

real-floating

x,

real-floating

y);

int isunordered(

real-floating

x,

real-floating

y);

B.12 Nonlocal jumps

<setjmp.h>

jmp_buf

int setjmp(jmp_buf env);

void longjmp(jmp_buf env, int val);

B.13 Signal handling

<signal.h>

sig_atomic_t

SIG_DFL

SIG_ERR

SIG_IGN

SIGABRT

SIGFPE

SIGILL

SIGINT

SIGSEGV

SIGTERM

void (*signal(int sig, void (*func)(int)))(int);

int raise(int sig);

B.14 Variable arguments

<stdarg.h>

va_list

type

va_arg(va_list ap,

type

);

void va_copy(va_list dest, va_list src);

void va_end(va_list ap);

void va_start(va_list ap,

parmN

);

B.15 Boolean type and values

<stdbool.h>

bool

true

false

_ _bool_true_false_are_defined

428 Library summary §B.15

B.16 Common definitions

<stddef.h>

ptrdiff_t

size_t

wchar_t

NULL

offsetof(

type

,

member-designator

)

B.17 Integer types

<stdint.h>

int

N

_t

uint

N

_t

int_least

N

_t

uint_least

N

_t

int_fast

N

_t

uint_fast

N

_t

intptr_t

uintptr_t

intmax_t

uintmax_t

INT

N

_MIN

INT

N

_MAX

UINT

N

_MAX

INT_LEAST

N

_MIN

INT_LEAST

N

_MAX

UINT_LEAST

N

_MAX

INT_FAST

N

_MIN

INT_FAST

N

_MAX

UINT_FAST

N

_MAX

INTPTR_MIN

INTPTR_MAX

UINTPTR_MAX

INTMAX_MIN

INTMAX_MAX

UINTMAX_MAX

PTRDIFF_MIN

PTRDIFF_MAX

SIG_ATOMIC_MIN

SIG_ATOMIC_MAX

SIZE_MAX

WCHAR_MIN

WCHAR_MAX

WINT_MIN

WINT_MAX

INT

N

_C(value)

UINT

N

_C(value)

INTMAX_C(value)

UINTMAX_C(value)

B.18 Input/output

<stdio.h>

size_t

FILE

fpos_t

NULL

_IOFBF

_IOLBF

_IONBF

BUFSIZ

EOF

FOPEN_MAX

FILENAME_MAX

L_tmpnam

SEEK_CUR

SEEK_END

SEEK_SET

TMP_MAX

stderr

stdin

stdout

int remove(const char *filename);

int rename(const char *old, const char *new);

FILE *tmpfile(void);

char *tmpnam(char *s);

int fclose(FILE *stream);

int fflush(FILE *stream);

FILE *fopen(const char * restrict filename,

const char * restrict mode);

FILE *freopen(const char * restrict filename,

const char * restrict mode,

FILE * restrict stream);

void setbuf(FILE * restrict stream,

char * restrict buf);

§B.18 Library summary 429

int setvbuf(FILE * restrict stream,

char * restrict buf,

int mode, size_t size);

int fprintf(FILE * restrict stream,

const char * restrict format, ...);

int fscanf(FILE * restrict stream,

const char * restrict format, ...);

int printf(const char * restrict format, ...);

int scanf(const char * restrict format, ...);

int snprintf(char * restrict s, size_t n,

const char * restrict format, ...);

int sprintf(char * restrict s,

const char * restrict format, ...);

int sscanf(const char * restrict s,

const char * restrict format, ...);

int vfprintf(FILE * restrict stream,

const char * restrict format, va_list arg);

int vfscanf(FILE * restrict stream,

const char * restrict format, va_list arg);

int vprintf(const char * restrict format, va_list arg);

int vscanf(const char * restrict format, va_list arg);

int vsnprintf(char * restrict s, size_t n,

const char * restrict format, va_list arg);

int vsprintf(char * restrict s,

const char * restrict format, va_list arg);

int vsscanf(const char * restrict s,

const char * restrict format, va_list arg);

int fgetc(FILE *stream);

char *fgets(char * restrict s, int n,

FILE * restrict stream);

int fputc(int c, FILE *stream);

int fputs(const char * restrict s,

FILE * restrict stream);

int getc(FILE *stream);

int getchar(void);

char *gets(char *s);

int putc(int c, FILE *stream);

int putchar(int c);

int puts(const char *s);

int ungetc(int c, FILE *stream);

430 Library summary §B.18

size_t fread(void * restrict ptr,

size_t size, size_t nmemb,

FILE * restrict stream);

size_t fwrite(const void * restrict ptr,

size_t size, size_t nmemb,

FILE * restrict stream);

int fgetpos(FILE * restrict stream,

fpos_t * restrict pos);

int fseek(FILE *stream, long int offset, int whence);

int fsetpos(FILE *stream, const fpos_t *pos);

long int ftell(FILE *stream);

void rewind(FILE *stream);

void clearerr(FILE *stream);

int feof(FILE *stream);

int ferror(FILE *stream);

void perror(const char *s);

B.19 General utilities

<stdlib.h>

size_t

wchar_t

div_t

ldiv_t

lldiv_t

NULL

EXIT_FAILURE

EXIT_SUCCESS

RAND_MAX

MB_CUR_MAX

double atof(const char *nptr);

int atoi(const char *nptr);

long int atol(const char *nptr);

long long int atoll(const char *nptr);

double strtod(const char * restrict nptr,

char ** restrict endptr);

float strtof(const char * restrict nptr,

char ** restrict endptr);

long double strtold(const char * restrict nptr,

char ** restrict endptr);

long int strtol(const char * restrict nptr,

char ** restrict endptr, int base);

long long int strtoll(const char * restrict nptr,

char ** restrict endptr, int base);

unsigned long int strtoul(

const char * restrict nptr,

char ** restrict endptr, int base);

§B.19 Library summary 431

unsigned long long int strtoull(

const char * restrict nptr,

char ** restrict endptr, int base);

int rand(void);

void srand(unsigned int seed);

void *calloc(size_t nmemb, size_t size);

void free(void *ptr);

void *malloc(size_t size);

void *realloc(void *ptr, size_t size);

void abort(void);

int atexit(void (*func)(void));

void exit(int status);

void _Exit(int status);

char *getenv(const char *name);

int system(const char *string);

void *bsearch(const void *key, const void *base,

size_t nmemb, size_t size,

int (*compar)(const void *, const void *));

void qsort(void *base, size_t nmemb, size_t size,

int (*compar)(const void *, const void *));

int abs(int j);

long int labs(long int j);

long long int llabs(long long int j);

div_t div(int numer, int denom);

ldiv_t ldiv(long int numer, long int denom);

lldiv_t lldiv(long long int numer,

long long int denom);

int mblen(const char *s, size_t n);

int mbtowc(wchar_t * restrict pwc,

const char * restrict s, size_t n);

int wctomb(char *s, wchar_t wchar);

size_t mbstowcs(wchar_t * restrict pwcs,

const char * restrict s, size_t n);

size_t wcstombs(char * restrict s,

const wchar_t * restrict pwcs, size_t n);

432 Library summary §B.19

B.20 String handling

<string.h>

size_t

NULL

void *memcpy(void * restrict s1,

const void * restrict s2, size_t n);

void *memmove(void *s1, const void *s2, size_t n);

char *strcpy(char * restrict s1,

const char * restrict s2);

char *strncpy(char * restrict s1,

const char * restrict s2, size_t n);

char *strcat(char * restrict s1,

const char * restrict s2);

char *strncat(char * restrict s1,

const char * restrict s2, size_t n);

int memcmp(const void *s1, const void *s2, size_t n);

int strcmp(const char *s1, const char *s2);

int strcoll(const char *s1, const char *s2);

int strncmp(const char *s1, const char *s2, size_t n);

size_t strxfrm(char * restrict s1,

const char * restrict s2, size_t n);

void *memchr(const void *s, int c, size_t n);

char *strchr(const char *s, int c);

size_t strcspn(const char *s1, const char *s2);

char *strpbrk(const char *s1, const char *s2);

char *strrchr(const char *s, int c);

size_t strspn(const char *s1, const char *s2);

char *strstr(const char *s1, const char *s2);

char *strtok(char * restrict s1,

const char * restrict s2);

void *memset(void *s, int c, size_t n);

char *strerror(int errnum);

size_t strlen(const char *s);

§B.20 Library summary 433

B.21 Type-generic math

<tgmath.h>

acos

asin

atan

acosh

asinh

atanh

cos

sin

tan

cosh

sinh

tanh

exp

log

pow

sqrt

fabs

atan2

cbrt

ceil

copysign

erf

erfc

exp2

expm1

fdim

floor

fma

fmax

fmin

fmod

frexp

hypot

ilogb

ldexp

lgamma

llrint

llround

log10

log1p

log2

logb

lrint

lround

nearbyint

nextafter

nexttoward

remainder

remquo

rint

round

scalbn

scalbln

tgamma

trunc

carg

cimag

conj

cproj

creal

B.22 Date and time

<time.h>

NULL

CLOCKS_PER_SEC

size_t

clock_t

time_t

struct tm

clock_t clock(void);

double difftime(time_t time1, time_t time0);

time_t mktime(struct tm *timeptr);

time_t time(time_t *timer);

char *asctime(const struct tm *timeptr);

char *ctime(const time_t *timer);

struct tm *gmtime(const time_t *timer);

struct tm *localtime(const time_t *timer);

size_t strftime(char * restrict s,

size_t maxsize,

const char * restrict format,

const struct tm * restrict timeptr);

434 Library summary §B.22

 

 

 

 

 

 

 

Content      ..     10      11      12      13     ..