This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r166398 - in /trunk/gcc: ChangeLog c-family/Cha...
- From: iains at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Sat, 06 Nov 2010 10:48:19 -0000
- Subject: r166398 - in /trunk/gcc: ChangeLog c-family/Cha...
Author: iains
Date: Sat Nov 6 10:48:18 2010
New Revision: 166398
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166398
Log:
NS/CF String format syntax parsing.
gcc:
PR target/44981
* doc/extend.tex (format): Document NSString extension.
(format_arg): Likewise.
(Darwin Format Checks): New section.
* doc/tm.texi: Document string object hooks (generated).
* doc/tm.texi.in (TARGET_OBJC_CONSTRUCT_STRING_OBJECT) Rename.
(TARGET_STRING_OBJECT_REF_TYPE_P): New.
(TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): New.
* target.def (objc_construct_string_object): Rename, amend
documentation.
(string_object_ref_type_p): New hook.
(check_string_object_format_arg): New hook.
* c-parser.c (c_parser_attributes): Allow objective-c class names as
attribute identifiers.
* config/darwin-c.c (darwin_cfstring_ref_p): New.
(darwin_check_cfstring_format_arg): New.
(darwin_additional_format_types): New.
* config/darwin-protos.h (darwin_cfstring_ref_p) New.
(darwin_check_cfstring_format_arg): New.
* config/darwin.h (TARGET_OBJC_CONSTRUCT_STRING_OBJECT) Renamed.
(TARGET_STRING_OBJECT_REF_TYPE_P): New.
(TARGET_N_FORMAT_TYPES): New.
(TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): New.
gcc/c-family:
PR target/44981
* c-format.c (format_type): New type gcc_objc_string_format_type.
(valid_stringptr_type_p): New.
(handle_format_arg_attribute): Use valid_stringptr_type_p ().
(check_format_string): Pass expected type, use
valid_stringptr_type_p (), check that the format string types are
consistent with the format specification.
(decode_format_attr): Warn if NSString is used outside objective-c.
(format_types_orig): Add NSString.
(format_name): New.
(format_flags): New.
(check_format_arg): Handle format strings requiring an external parser.
first_target_format_type: New variable.
(handle_format_attribute): Set up first_target_format_type, pass the
expected format arg string type to check_format_string().
* c-common.h (FMT_FLAG_PARSE_ARG_CONVERT_EXTERNAL): New flag.
* stub-objc.c (objc_string_ref_type_p): New.
(objc_check_format_arg): New.
gcc/objc:
PR target/44981
* objc-act.c (objc_build_string_object): Amend for renamed hook.
(objc_string_ref_type_p): New.
(objc_check_format_arg): New.
gcc/testsuite:
PR target/44981
* gcc.dg/darwin-cfstring-format-1.c: New.
* gcc.dg/warn-nsstring.c: New.
* objc.dg/fsf-nsstring-format-1.m: New.
* obj-c++.dg/fsf-nsstring-format-1.mm: New.
* obj-c++.dg/torture/strings/const-cfstring-1.mm: Update for darwin10
linker warning.
Added:
trunk/gcc/testsuite/gcc.dg/darwin-cfstring-format-1.c
trunk/gcc/testsuite/gcc.dg/warn-nsstring.c
trunk/gcc/testsuite/obj-c++.dg/fsf-nsstring-format-1.mm
trunk/gcc/testsuite/objc.dg/fsf-nsstring-format-1.m
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-common.h
trunk/gcc/c-family/c-format.c
trunk/gcc/c-family/c-format.h
trunk/gcc/c-family/stub-objc.c
trunk/gcc/c-parser.c
trunk/gcc/config/darwin-c.c
trunk/gcc/config/darwin-protos.h
trunk/gcc/config/darwin.h
trunk/gcc/doc/extend.texi
trunk/gcc/doc/tm.texi
trunk/gcc/doc/tm.texi.in
trunk/gcc/objc/ChangeLog
trunk/gcc/objc/objc-act.c
trunk/gcc/target.def
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/lib/gcc-defs.exp
trunk/gcc/testsuite/obj-c++.dg/torture/strings/const-cfstring-1.mm