Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • For func (p,n), where 'p' is the pointer, 'n' is the integer and 'func' is the library function, the value of â€˜n’ should not be greater than the effective size of the pointer. Also, the effective type of the pointer should be compatible with either the derived type of 'n' or unsigned char.
  • For func (p,q, n), where 'p' and 'q' are both pointers, 'n' is the integer and 'func' is the library function, the value of â€˜n’ should not be greater than the effective size of any of the two pointers ('p' and 'q'). The effective type of the 'p' should be compatible with the derived type of 'n' or unsigned char. Similarly, the effective type of the 'p' should be compatible with the effective type of 'q' or unsigned char.
  • For expression E of the form: T* q = func (n), where 'func' is a memory allocation function, the value of 'n' should not be less than sizeof (T). Also, the effective type of 'T' should be compatible with either the derived type of 'n' or unsigned char.

Wiki Markup
According to the WG14 document \[1\]:

          Given an integer expression E, the derived type T of E is determined as follows:

...

WG14 Document: N1579 - Rule 5.34 Forming Invalid pointers by library functions.

Bibliography

Wiki Markup
\[1\] WG14 Document: N1579 -
Rule 5.34 Forming Invalid pointers by library functions.
 Section 4.5