builtins.def (BUILT_IN_STPNCPY, [...]): New.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Sun, 3 Apr 2005 22:08:12 +0000 (22:08 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Sun, 3 Apr 2005 22:08:12 +0000 (22:08 +0000)
* builtins.def (BUILT_IN_STPNCPY, BUILT_IN_STRCASECMP,
BUILT_IN_STRNCASECMP): New.
* doc/extend.texi: Document stpncpy, strcasecmp, strncasecmp
and strndup.

testsuite:
* gcc.dg/nonnull-3.c: Also test __builtin_stpncpy,
__builtin_strcasecmp and __builtin_strncasecmp.

From-SVN: r97498

gcc/ChangeLog
gcc/builtins.def
gcc/doc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/nonnull-3.c

index 96e632e911fff7fc52b2b0f89b546f2245fb067e..330c4b2fadafad65d55d593801976210d41e618b 100644 (file)
@@ -1,3 +1,10 @@
+2005-04-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * builtins.def (BUILT_IN_STPNCPY, BUILT_IN_STRCASECMP,
+       BUILT_IN_STRNCASECMP): New.
+       * doc/extend.texi: Document stpncpy, strcasecmp, strncasecmp
+       and strndup.
+
 2005-04-03  Richard Earnshaw  <richard.earnshaw@arm.com>
 
        PR target/14812
index 394723e3cd5f2e3511e7222ca63dc852256c625a..c7cfb083ec42bd5c1d2c2d4542ef5e8e4b3ac60d 100644 (file)
@@ -462,6 +462,8 @@ DEF_EXT_LIB_BUILTIN    (BUILT_IN_MEMPCPY, "mempcpy", BT_FN_PTR_PTR_CONST_PTR_SIZ
 DEF_LIB_BUILTIN        (BUILT_IN_MEMSET, "memset", BT_FN_PTR_PTR_INT_SIZE, ATTR_NOTHROW_NONNULL)
 DEF_EXT_LIB_BUILTIN    (BUILT_IN_RINDEX, "rindex", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL)
 DEF_EXT_LIB_BUILTIN    (BUILT_IN_STPCPY, "stpcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL)
+DEF_EXT_LIB_BUILTIN    (BUILT_IN_STPNCPY, "stpncpy", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL)
+DEF_EXT_LIB_BUILTIN    (BUILT_IN_STRCASECMP, "strcasecmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL)
 DEF_LIB_BUILTIN        (BUILT_IN_STRCAT, "strcat", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL)
 DEF_LIB_BUILTIN        (BUILT_IN_STRCHR, "strchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL)
 DEF_LIB_BUILTIN        (BUILT_IN_STRCMP, "strcmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL)
@@ -470,6 +472,7 @@ DEF_LIB_BUILTIN        (BUILT_IN_STRCSPN, "strcspn", BT_FN_SIZE_CONST_STRING_CON
 DEF_EXT_LIB_BUILTIN    (BUILT_IN_STRDUP, "strdup", BT_FN_STRING_CONST_STRING, ATTR_MALLOC_NOTHROW_NONNULL)
 DEF_EXT_LIB_BUILTIN    (BUILT_IN_STRNDUP, "strndup", BT_FN_STRING_CONST_STRING_SIZE, ATTR_MALLOC_NOTHROW_NONNULL)
 DEF_LIB_BUILTIN        (BUILT_IN_STRLEN, "strlen", BT_FN_SIZE_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL)
+DEF_EXT_LIB_BUILTIN    (BUILT_IN_STRNCASECMP, "strncasecmp", BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, ATTR_PURE_NOTHROW_NONNULL)
 DEF_LIB_BUILTIN        (BUILT_IN_STRNCAT, "strncat", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL)
 DEF_LIB_BUILTIN        (BUILT_IN_STRNCMP, "strncmp", BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, ATTR_PURE_NOTHROW_NONNULL)
 DEF_LIB_BUILTIN        (BUILT_IN_STRNCPY, "strncpy", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL)
index 48784af48b7071be84add2352869b5818b2990a4..06d700e896e12c673671fcef70f3d57f15e77be6 100644 (file)
@@ -4880,6 +4880,8 @@ identifier, or a sequence of member accesses and array references.
 @findex sqrtl
 @findex sscanf
 @findex stpcpy
+@findex stpncpy
+@findex strcasecmp
 @findex strcat
 @findex strchr
 @findex strcmp
@@ -4889,9 +4891,11 @@ identifier, or a sequence of member accesses and array references.
 @findex strfmon
 @findex strftime
 @findex strlen
+@findex strncasecmp
 @findex strncat
 @findex strncmp
 @findex strncpy
+@findex strndup
 @findex strpbrk
 @findex strrchr
 @findex strspn
@@ -4963,9 +4967,10 @@ Outside strict ISO C mode (@option{-ansi}, @option{-std=c89} or
 @code{scalb}, @code{signbit}, @code{signbitf}, @code{signbitl},
 @code{significandf}, @code{significandl}, @code{significand},
 @code{sincosf}, @code{sincosl}, @code{sincos}, @code{stpcpy},
-@code{strdup}, @code{strfmon}, @code{toascii}, @code{y0f}, @code{y0l},
-@code{y0}, @code{y1f}, @code{y1l}, @code{y1}, @code{ynf}, @code{ynl} and
-@code{yn}
+@code{stpncpy}, @code{strcasecmp}, @code{strdup}, @code{strfmon},
+@code{strncasecmp}, @code{strndup}, @code{toascii}, @code{y0f},
+@code{y0l}, @code{y0}, @code{y1f}, @code{y1l}, @code{y1}, @code{ynf},
+@code{ynl} and @code{yn}
 may be handled as built-in functions.
 All these functions have corresponding versions
 prefixed with @code{__builtin_}, which may be used even in strict C89
index 7191f88e7df79807a0aeb4183919c98c84493a99..57946bdbe1dce7da0cb18f11d5b88e1e06b7dfb1 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * gcc.dg/nonnull-3.c: Also test __builtin_stpncpy,
+       __builtin_strcasecmp and __builtin_strncasecmp.
+
 2005-04-03  Nathan Sidwell  <nathan@codesourcery.com>
 
        PR c++/20723
index e8725cf12d2f788660673f19c3c6e41fe97fbadb..040248c53aa7a19fe4b6209219d20d6aa0227cf9 100644 (file)
@@ -33,10 +33,16 @@ foo (void *p, char *s)
   __builtin_strncat (s, NULL, 16);  /* { dg-warning "null" "null pointer check" } */
   __builtin_stpcpy (NULL, s);  /* { dg-warning "null" "null pointer check" } */
   __builtin_stpcpy (s, NULL);  /* { dg-warning "null" "null pointer check" } */
+  __builtin_stpncpy (NULL, s, 16);  /* { dg-warning "null" "null pointer check" } */
+  __builtin_stpncpy (s, NULL, 16);  /* { dg-warning "null" "null pointer check" } */
   __builtin_strcpy (NULL, s);  /* { dg-warning "null" "null pointer check" } */
   __builtin_strcpy (s, NULL);  /* { dg-warning "null" "null pointer check" } */
   __builtin_strncpy (NULL, s, 16);  /* { dg-warning "null" "null pointer check" } */
   __builtin_strncpy (s, NULL, 16);  /* { dg-warning "null" "null pointer check" } */
+  __builtin_strcasecmp (NULL, s);  /* { dg-warning "null" "null pointer check" } */
+  __builtin_strcasecmp (s, NULL);  /* { dg-warning "null" "null pointer check" } */
+  __builtin_strncasecmp (NULL, s, 16);  /* { dg-warning "null" "null pointer check" } */
+  __builtin_strncasecmp (s, NULL, 16);  /* { dg-warning "null" "null pointer check" } */
   __builtin_strcmp (NULL, s);  /* { dg-warning "null" "null pointer check" } */
   __builtin_strcmp (s, NULL);  /* { dg-warning "null" "null pointer check" } */
   __builtin_strncmp (NULL, s, 16);  /* { dg-warning "null" "null pointer check" } */