public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/44981] cfstring_format_type support needed darwin10
[not found] <bug-44981-4@http.gcc.gnu.org/bugzilla/>
@ 2010-11-06 10:48 ` iains at gcc dot gnu.org
2010-11-06 10:57 ` iains at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: iains at gcc dot gnu.org @ 2010-11-06 10:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44981
--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> 2010-11-06 10:48:21 UTC ---
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/44981] cfstring_format_type support needed darwin10
[not found] <bug-44981-4@http.gcc.gnu.org/bugzilla/>
2010-11-06 10:48 ` [Bug target/44981] cfstring_format_type support needed darwin10 iains at gcc dot gnu.org
@ 2010-11-06 10:57 ` iains at gcc dot gnu.org
2010-11-08 22:00 ` mrs at gcc dot gnu.org
2011-01-09 17:35 ` howarth at nitro dot med.uc.edu
3 siblings, 0 replies; 6+ messages in thread
From: iains at gcc dot gnu.org @ 2010-11-06 10:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44981
Iain Sandoe <iains at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |iains at gcc dot gnu.org
--- Comment #3 from Iain Sandoe <iains at gcc dot gnu.org> 2010-11-06 10:57:02 UTC ---
NOTE:
To close this on the 4.5 branch will require back-porting
r165820
r165821
(to provide the CFString implementation and testsuite)
r166398/166399 (166399 corrects an unintended commit).
(to provide the format check).
But this should be fixed on trunk now - leaving it open pending a decision on
the back-port.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/44981] cfstring_format_type support needed darwin10
[not found] <bug-44981-4@http.gcc.gnu.org/bugzilla/>
2010-11-06 10:48 ` [Bug target/44981] cfstring_format_type support needed darwin10 iains at gcc dot gnu.org
2010-11-06 10:57 ` iains at gcc dot gnu.org
@ 2010-11-08 22:00 ` mrs at gcc dot gnu.org
2011-01-09 17:35 ` howarth at nitro dot med.uc.edu
3 siblings, 0 replies; 6+ messages in thread
From: mrs at gcc dot gnu.org @ 2010-11-08 22:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44981
mrs@gcc.gnu.org <mrs at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mrs at gcc dot gnu.org
--- Comment #4 from mrs at gcc dot gnu.org <mrs at gcc dot gnu.org> 2010-11-08 22:00:20 UTC ---
I'm fine with a backport, just ask Joseph to weigh in.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/44981] cfstring_format_type support needed darwin10
[not found] <bug-44981-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2010-11-08 22:00 ` mrs at gcc dot gnu.org
@ 2011-01-09 17:35 ` howarth at nitro dot med.uc.edu
3 siblings, 0 replies; 6+ messages in thread
From: howarth at nitro dot med.uc.edu @ 2011-01-09 17:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44981
Jack Howarth <howarth at nitro dot med.uc.edu> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
--- Comment #5 from Jack Howarth <howarth at nitro dot med.uc.edu> 2011-01-09 17:28:25 UTC ---
Closing because scale of backport makes approval unlikely.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/44981] cfstring_format_type support needed darwin10
2010-07-18 18:40 [Bug target/44981] New: cfstring_format_type supported " howarth at nitro dot med dot uc dot edu
2010-07-18 18:48 ` [Bug target/44981] cfstring_format_type support " howarth at nitro dot med dot uc dot edu
@ 2010-07-24 20:18 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-07-24 20:18 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44981
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/44981] cfstring_format_type support needed darwin10
2010-07-18 18:40 [Bug target/44981] New: cfstring_format_type supported " howarth at nitro dot med dot uc dot edu
@ 2010-07-18 18:48 ` howarth at nitro dot med dot uc dot edu
2010-07-24 20:18 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 6+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-07-18 18:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from howarth at nitro dot med dot uc dot edu 2010-07-18 18:48 -------
Note that this issue only occurs in darwin10 because of the introduction of ...
#if defined(__GNUC__) && (__GNUC__*10+__GNUC_MINOR__ >= 42) &&
!defined(__INTEL_COMPILER) && (TARGET_OS_MAC || TARGET_OS_EMBEDDED)
#define CF_FORMAT_FUNCTION(F,A) __attribute__((format(CFString, F, A)))
#define CF_FORMAT_ARGUMENT(A) __attribute__((format_arg(A)))
#else
#define CF_FORMAT_FUNCTION(F,A)
#define CF_FORMAT_ARGUMENT(A)
#endif
in /System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h which
makes the assumption that all gcc greater than gcc 4.2 supports the CFString
format. I had suggested in radar 6845745 that this be fixed in darwin10 with...
---
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h.orig
2009-04-30 20:23:48.000000000 -0400
+++ /System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h
2009-04-30 22:41:41.000000000 -0400
@@ -153,7 +153,7 @@
#define CFSTR(cStr) __CFStringMakeConstantString("" cStr "")
#endif
-#if defined(__GNUC__) && (__GNUC__*10+__GNUC_MINOR__ >= 42) &&
!defined(__INTEL_COMPILER) && (TARGET_OS_MAC || TARGET_OS_EMBEDDED)
+#if defined(__GNUC__) && (__APPLE_CC__ > 5600) && (__GNUC__*10+__GNUC_MINOR__
>= 42) && !defined(__INTEL_COMPILER) && (TARGET_OS_MAC || TARGET_OS_EMBEDDED)
#define CF_FORMAT_FUNCTION(F,A) __attribute__((format(CFString, F, A)))
#define CF_FORMAT_ARGUMENT(A) __attribute__((format_arg(A)))
#else
but I don't think this will ever happen for darwin10. Mike has suggested that
better fix is to add port over the support for the CFString format.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44981
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-01-09 17:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-44981-4@http.gcc.gnu.org/bugzilla/>
2010-11-06 10:48 ` [Bug target/44981] cfstring_format_type support needed darwin10 iains at gcc dot gnu.org
2010-11-06 10:57 ` iains at gcc dot gnu.org
2010-11-08 22:00 ` mrs at gcc dot gnu.org
2011-01-09 17:35 ` howarth at nitro dot med.uc.edu
2010-07-18 18:40 [Bug target/44981] New: cfstring_format_type supported " howarth at nitro dot med dot uc dot edu
2010-07-18 18:48 ` [Bug target/44981] cfstring_format_type support " howarth at nitro dot med dot uc dot edu
2010-07-24 20:18 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).