aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/builtins.def3
-rw-r--r--gcc/doc/extend.texi11
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/nonnull-3.c6
5 files changed, 29 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 96e632e..330c4b2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/builtins.def b/gcc/builtins.def
index 394723e..c7cfb08 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -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)
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 48784af..06d700e 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7191f88..57946bd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/gcc.dg/nonnull-3.c b/gcc/testsuite/gcc.dg/nonnull-3.c
index e8725cf..040248c 100644
--- a/gcc/testsuite/gcc.dg/nonnull-3.c
+++ b/gcc/testsuite/gcc.dg/nonnull-3.c
@@ -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" } */