From 23db6ced33c245c38c147c31011bbafa392e4328 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Mon, 14 Jan 2019 18:44:00 +0000 Subject: PR target/88638 - FAIL: fsf-nsstring-format-1.s on darwin gcc/c-family/ChangeLog: PR target/88638 * c-attribs.c (positional_argument): Call valid_format_string_type_p and issue errors if it fails. * c-common.h (valid_format_string_type_p): Declare. * c-format.c (valid_stringptr_type_p): Rename... (valid_format_string_type_p): ...to this and make extern. (handle_format_arg_attribute): Adjust to new name. (check_format_string): Same. gcc/testsuite/ChangeLog: PR target/88638 * gcc.dg/format/attr-8.c: New test. * gcc.dg/darwin-cfstring-format-1.c: Adjust diagnostics. * gcc.dg/format/attr-3.c: Same. * obj-c++.dg/fsf-nsstring-format-1.mm: Same. * objc.dg/fsf-nsstring-format-1.m: Same. gcc/ChangeLog: PR target/88638 * doc/extend.texi (Darwin Format Checks): Clarify. From-SVN: r267922 --- gcc/doc/extend.texi | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'gcc/doc') diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index f013057..c81092d 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -22397,10 +22397,14 @@ bit-fields. See the Solaris man page for @code{cmn_err} for more information. @node Darwin Format Checks @subsection Darwin Format Checks -Darwin targets support the @code{CFString} (or @code{__CFString__}) in the format -attribute context. Declarations made with such attribution are parsed for correct syntax -and format argument types. However, parsing of the format string itself is currently undefined -and is not carried out by this version of the compiler. +In addition to the full set of format archetypes (attribute format style +arguments such as @code{printf}, @code{scanf}, @code{strftime}, and +@code{strfmon}), Darwin targets also support the @code{CFString} (or +@code{__CFString__}) archetype in the @code{format} attribute. +Declarations with this archetype are parsed for correct syntax +and argument types. However, parsing of the format string itself and +validating arguments against it in calls to such functions is currently +not performed. Additionally, @code{CFStringRefs} (defined by the @code{CoreFoundation} headers) may also be used as format arguments. Note that the relevant headers are only likely to be -- cgit v1.1