This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Updated: [Patch, c* ,ObjC*] handle string objects in format checking.
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: IainS <developer at sandoe-acoustics dot co dot uk>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Mike Stump <mrs at gcc dot gnu dot org>, Mike Stump <mikestump at comcast dot net>
- Date: Fri, 5 Nov 2010 16:57:00 +0000 (UTC)
- Subject: Re: Updated: [Patch, c* ,ObjC*] handle string objects in format checking.
- References: <3F894B1C-C5CE-45FD-B73F-843A2C7ED940@sandoe-acoustics.co.uk> <Pine.LNX.4.64.1010241417310.28734@digraph.polyomino.org.uk> <0F66301E-FC8C-46C1-AFAF-CDF2ACDA2EEA@sandoe-acoustics.co.uk> <Pine.LNX.4.64.1010241522470.28734@digraph.polyomino.org.uk> <CC2BDE64-B145-4A8B-BAA2-386DFE1E6629@sandoe-acoustics.co.uk> <A3F5BBF0-2A52-49C6-B369-391CE8A8EE03@comcast.net> <7E8FB7AA-C33B-4A87-A176-081C3E7787AC@sandoe-acoustics.co.uk> <Pine.LNX.4.64.1010281815260.31183@digraph.polyomino.org.uk> <98C75414-88E8-4E25-8943-27E332689B3E@sandoe-acoustics.co.uk>
On Thu, 28 Oct 2010, IainS wrote:
> +@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 will be parsed for correct syntax
> +and format argument types. However, parsing of the format string itself is currently undefined
> +and will not be carried out by this version of the compiler.
> +
> +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
> +available on Darwin (OSX) installations. On such installations, the XCode and system
Three spaces after ".", should be two; two before "XCode", should be one.
> +static int first_target_format_type;
> +static const char * format_name (int format_num);
No space after "*".
> + if (format_types[info->format_type].flags
> + & (int) FMT_FLAG_PARSE_ARG_CONVERT_EXTERNAL)
Bad indentation of the "&", should be in the column immediately after the
"(" on the line above.
> +(objc_construct_string_object,
> + "Targets may provide a string object type that can be used within\
> + and between c, c++ and their respective objective-c dialects.\
C, C++, Objective-C.
> + A string object might, for example, embed encoding and length information.\
> + These objects are considered opaque to the compiler and handled as references.\
> + An ideal implementation makes the composition of the string object\
> + match that of the objective-c @code{NSString} (@code{NXString} for GNUStep),\
Objective-C.
> + allowing efficient interworking between c-only and objective-c code.\
C-only, Objective-C.
> + If a target implements string objects then this hook should return a\
> + reference to such an object constructed from the normal 'c' string\
`C' (in TeXinfo, ` is an opening quote and ' a closing one).
> + representation provided in @var{string}.\
> + At present, the hook is used by objective-c only, to obtain a\
Objective-C.
> +(string_object_ref_type_p,
> + "If a target implements string objects then this hook should return\
> + 'true' if @var{stringref} is a valid reference to such an object.",
@code{true}.
The C and documentation changes are OK with those fixes (and of course
tm.texi regenerated).
--
Joseph S. Myers
joseph@codesourcery.com