aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2005-03-26 02:25:30 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2005-03-26 02:25:30 +0000
commit1ad81c8e5789887beee44c95ee81e21b920408a8 (patch)
treea2a76b1c0137364ea9eeb9b2d2c99e5b63eacf77 /gcc
parente0b23a586ceafc3e4567eab04666b1e9d6864395 (diff)
downloadgcc-1ad81c8e5789887beee44c95ee81e21b920408a8.zip
gcc-1ad81c8e5789887beee44c95ee81e21b920408a8.tar.gz
gcc-1ad81c8e5789887beee44c95ee81e21b920408a8.tar.bz2
builtin-types.def (BT_FN_STRING_CONST_STRING_SIZE): New.
* builtin-types.def (BT_FN_STRING_CONST_STRING_SIZE): New. * builtins.def (BUILT_IN_STRNDUP): New. testsuite: * gcc.dg/nonnull-3.c: Also test __builtin_strndup. From-SVN: r97077
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/builtin-types.def2
-rw-r--r--gcc/builtins.def1
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/nonnull-3.c1
5 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 71e4822..fb5ac86 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2005-03-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtin-types.def (BT_FN_STRING_CONST_STRING_SIZE): New.
+ * builtins.def (BUILT_IN_STRNDUP): New.
+
2005-03-25 Pat Haugen <pthaugen@us.ibm.com>
PR tree-optimization/20470
diff --git a/gcc/builtin-types.def b/gcc/builtin-types.def
index 8458631..a3c804c 100644
--- a/gcc/builtin-types.def
+++ b/gcc/builtin-types.def
@@ -172,6 +172,8 @@ DEF_FUNCTION_TYPE_2 (BT_FN_SIZE_CONST_STRING_CONST_STRING,
BT_SIZE, BT_CONST_STRING, BT_CONST_STRING)
DEF_FUNCTION_TYPE_2 (BT_FN_STRING_CONST_STRING_INT,
BT_STRING, BT_CONST_STRING, BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_STRING_CONST_STRING_SIZE,
+ BT_STRING, BT_CONST_STRING, BT_SIZE)
DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_STRING_FILEPTR,
BT_INT, BT_CONST_STRING, BT_FILEPTR)
DEF_FUNCTION_TYPE_2 (BT_FN_INT_INT_FILEPTR,
diff --git a/gcc/builtins.def b/gcc/builtins.def
index d324e01..394723e 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -468,6 +468,7 @@ DEF_LIB_BUILTIN (BUILT_IN_STRCMP, "strcmp", BT_FN_INT_CONST_STRING_CONST_
DEF_LIB_BUILTIN (BUILT_IN_STRCPY, "strcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL)
DEF_LIB_BUILTIN (BUILT_IN_STRCSPN, "strcspn", BT_FN_SIZE_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL)
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_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)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9e5cdf9..03e5d9b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2005-03-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/nonnull-3.c: Also test __builtin_strndup.
+
2005-03-25 Mark Mitchell <mark@codesourcery.com>
* lib/g++.exp (g++_link_flags): Use gcc-set-multilib-library-path.
diff --git a/gcc/testsuite/gcc.dg/nonnull-3.c b/gcc/testsuite/gcc.dg/nonnull-3.c
index 3b53eaf..e8725cf 100644
--- a/gcc/testsuite/gcc.dg/nonnull-3.c
+++ b/gcc/testsuite/gcc.dg/nonnull-3.c
@@ -51,6 +51,7 @@ foo (void *p, char *s)
__builtin_strchr (NULL, 16); /* { dg-warning "null" "null pointer check" } */
__builtin_strrchr (NULL, 16); /* { dg-warning "null" "null pointer check" } */
__builtin_strdup (NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strndup (NULL, 16); /* { dg-warning "null" "null pointer check" } */
__builtin_nan (NULL); /* { dg-warning "null" "null pointer check" } */
__builtin_nanf (NULL); /* { dg-warning "null" "null pointer check" } */