diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2010-05-04 23:34:02 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2010-05-04 23:34:02 +0000 |
commit | 6db8a4de4d98176bfbe5d27fb78a5aa19eba0a49 (patch) | |
tree | f476be6da63c784938ffa870e70973908ce697be /gnu | |
parent | 45818c0e8a316cf11a8010b653ee441f7046b180 (diff) |
We don't include gettext, dgettext or dcgettext as gcc's builtins, so don't
check the arguments. Fixes autocrap tests in c++, which otherwise fail with
"error: nonnull argument with out-of-range operand number".
miod@ ok
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/gcc/gcc/builtin-attrs.def | 12 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/gcc/builtin-types.def | 6 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/gcc/builtins.def | 16 |
3 files changed, 22 insertions, 12 deletions
diff --git a/gnu/usr.bin/gcc/gcc/builtin-attrs.def b/gnu/usr.bin/gcc/gcc/builtin-attrs.def index 0fe47a4fd04..d60dddeff97 100644 --- a/gnu/usr.bin/gcc/gcc/builtin-attrs.def +++ b/gnu/usr.bin/gcc/gcc/builtin-attrs.def @@ -210,16 +210,4 @@ DEF_C89_ATTR (strftime, ATTR_FORMAT_STRFTIME_3_0) && (flag_isoc99 || flag_noniso_default_format_attributes))) DEF_C99_ATTR (vfscanf, ATTR_FORMAT_SCANF_2_0) #undef DEF_C99_ATTR - -/* Functions not in any version of ISO C. */ -#define DEF_EXT_ATTR(NAME, ATTRS) \ - DEF_FN_ATTR_IDENT (NAME, ATTRS, \ - flag_hosted && flag_noniso_default_format_attributes) -/* Uniforum/GNU gettext functions. */ -DEF_EXT_ATTR (gettext, ATTR_FORMAT_ARG_1) -DEF_EXT_ATTR (dgettext, ATTR_FORMAT_ARG_2) -DEF_EXT_ATTR (dcgettext, ATTR_FORMAT_ARG_2) -/* X/Open strfmon function. */ -DEF_EXT_ATTR (strfmon, ATTR_FORMAT_STRFMON_3_4) -#undef DEF_EXT_ATTR #undef DEF_FN_ATTR_IDENT diff --git a/gnu/usr.bin/gcc/gcc/builtin-types.def b/gnu/usr.bin/gcc/gcc/builtin-types.def index d5c39b4b825..6bd2894cd08 100644 --- a/gnu/usr.bin/gcc/gcc/builtin-types.def +++ b/gnu/usr.bin/gcc/gcc/builtin-types.def @@ -76,6 +76,7 @@ DEF_PRIMITIVE_TYPE (BT_PTR, ptr_type_node) DEF_PRIMITIVE_TYPE (BT_CONST_PTR, const_ptr_type_node) DEF_PRIMITIVE_TYPE (BT_PTRMODE, (*lang_hooks.types.type_for_mode)(ptr_mode, 0)) DEF_PRIMITIVE_TYPE (BT_SIZE, size_type_node) +DEF_PRIMITIVE_TYPE (BT_SSIZE, signed_size_type_node) DEF_PRIMITIVE_TYPE (BT_STRING, string_type_node) DEF_PRIMITIVE_TYPE (BT_CONST_STRING, const_string_type_node) @@ -122,6 +123,7 @@ DEF_FUNCTION_TYPE_1 (BT_FN_FLOAT_CONST_STRING, BT_FLOAT, BT_CONST_STRING) DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_CONST_STRING, BT_DOUBLE, BT_CONST_STRING) DEF_FUNCTION_TYPE_1 (BT_FN_LONG_DOUBLE_CONST_STRING, BT_LONG_DOUBLE, BT_CONST_STRING) +DEF_FUNCTION_TYPE_1 (BT_FN_STRING_CONST_STRING, BT_STRING, BT_CONST_STRING) DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_INT, BT_VOID, BT_PTR, BT_INT) DEF_FUNCTION_TYPE_2 (BT_FN_STRING_STRING_CONST_STRING, @@ -167,6 +169,8 @@ DEF_FUNCTION_TYPE_3 (BT_FN_INT_STRING_CONST_STRING_VALIST_ARG, BT_INT, BT_STRING, BT_CONST_STRING, BT_VALIST_ARG) DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG, BT_INT, BT_CONST_STRING, BT_CONST_STRING, BT_VALIST_ARG) +DEF_FUNCTION_TYPE_3 (BT_FN_STRING_CONST_STRING_CONST_STRING_INT, + BT_STRING, BT_CONST_STRING, BT_CONST_STRING, BT_INT) DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR, BT_SIZE, BT_CONST_PTR, BT_SIZE, BT_SIZE, BT_PTR) @@ -193,6 +197,8 @@ DEF_FUNCTION_TYPE_VAR_2 (BT_FN_INT_CONST_STRING_CONST_STRING_VAR, DEF_FUNCTION_TYPE_VAR_3 (BT_FN_INT_STRING_SIZE_CONST_STRING_VAR, BT_INT, BT_STRING, BT_SIZE, BT_CONST_STRING) +DEF_FUNCTION_TYPE_VAR_3 (BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR, + BT_SSIZE, BT_STRING, BT_SIZE, BT_CONST_STRING) DEF_POINTER_TYPE (BT_PTR_FN_VOID_VAR, BT_FN_VOID_VAR) DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE, diff --git a/gnu/usr.bin/gcc/gcc/builtins.def b/gnu/usr.bin/gcc/gcc/builtins.def index 3b76ce401ac..39279a1e514 100644 --- a/gnu/usr.bin/gcc/gcc/builtins.def +++ b/gnu/usr.bin/gcc/gcc/builtins.def @@ -484,6 +484,14 @@ DEF_GCC_BUILTIN(BUILT_IN_CONSTANT_P, "__builtin_constant_p", BT_FN_INT_VAR, ATTR_NULL) +DEF_EXT_LIB_BUILTIN(BUILT_IN_DCGETTEXT, + "__builtin_dcgettext", + BT_FN_STRING_CONST_STRING_CONST_STRING_INT, + ATTR_FORMAT_ARG_2) +DEF_EXT_LIB_BUILTIN(BUILT_IN_DGETTEXT, + "__builtin_dgettext", + BT_FN_STRING_CONST_STRING_CONST_STRING, + ATTR_FORMAT_ARG_2) DEF_GCC_BUILTIN(BUILT_IN_FRAME_ADDRESS, "__builtin_frame_address", BT_FN_PTR_UNSIGNED, @@ -687,6 +695,10 @@ DEF_GCC_BUILTIN(BUILT_IN_FROB_RETURN_ADDR, "__builtin_frob_return_addr", BT_FN_PTR_PTR, ATTR_NULL) +DEF_EXT_LIB_BUILTIN(BUILT_IN_GETTEXT, + "__builtin_gettext", + BT_FN_STRING_CONST_STRING, + ATTR_FORMAT_ARG_1) DEF_GCC_BUILTIN(BUILT_IN_EXTRACT_RETURN_ADDR, "__builtin_extract_return_addr", BT_FN_PTR_PTR, @@ -709,6 +721,10 @@ DEF_GCC_BUILTIN(BUILT_IN_STDARG_START, /* backward compat */ "__builtin_stdarg_start", BT_FN_VOID_VALIST_REF_VAR, ATTR_NULL) +DEF_EXT_LIB_BUILTIN(BUILT_IN_STRFMON, + "__builtin_strfmon", + BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR, + ATTR_FORMAT_STRFMON_3_4) DEF_GCC_BUILTIN(BUILT_IN_VA_END, "__builtin_va_end", BT_FN_VOID_VALIST_REF, |