Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added messed up biblio entry; carol pls fix

...

The standard library functions shown below copy memory from a source object referenced by a restrict-qualified pointer to a destination object that is also referenced by a restrict-qualified pointer. 

 

Code Block
void *memcpy(
  void * restrict s1,
  const void * restrict 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
);

 
/* Annex K Functions */
 
errno_t memcpy_s(
  void * restrict s1, 
  rsize_t s1max,
  const void * restrict s2, 
  rsize_t n
);
 
errno_t strcpy_s(
  char * restrict s1,
  rsize_t s1max,
  const char * restrict s2);
errno_t strncpy_s(
  char * restrict s1,
  rsize_t s1max,
  const char * restrict s2,
  rsize_t n
);

errno_t strcat_s(
  char * restrict s1,
  rsize_t s1max,
  const char * restrict s2
);
errno_t strncat_s(
  char * restrict s1,
  rsize_t s1max,
  const char * restrict s2,
  rsize_t n
);
char *strtok_s(
  char * restrict s1,
  rsize_t * restrict s1max,
  const char * restrict s2,
  char ** restrict ptr
);

...

ISO/IEC TR 24772:2013Passing Parameters and Return Values [CSJ]
ISO/IEC TS 17961Passing pointers into the same object as arguments to different restrict-qualified parameters [restrict]

Bibliography

Douglas Walls.  How to Use the Qualifier in C.  Sun ONE Tools Group, Sun Microsystems, July 2003 (revised March 2006)               

 

...