diff options
author | Daniel Jacobowitz <dan@debian.org> | 2004-07-19 14:48:09 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@gcc.gnu.org> | 2004-07-19 14:48:09 +0000 |
commit | a2bec818635587d03fa02bd57c2bf0985510de56 (patch) | |
tree | 906e9f5e207c1fa3893321a14e270e2788011949 /gcc/doc | |
parent | a38e09bc2137703767c8701ba05585b83c507919 (diff) | |
download | gcc-a2bec818635587d03fa02bd57c2bf0985510de56.zip gcc-a2bec818635587d03fa02bd57c2bf0985510de56.tar.gz gcc-a2bec818635587d03fa02bd57c2bf0985510de56.tar.bz2 |
Makefile.in (c-format.o): Depend on c-format.h.
gcc/
* Makefile.in (c-format.o): Depend on c-format.h.
* c-format.h: New file.
(struct format_char_info): Add CHAIN member.
* c-format.c: Move some types and constants to c-format.h.
(format_type_error): Set to -1.
(struct function_format_info): Use an int for format_type.
(decode_format_type): Return an int. Return format_type_error
on error.
(print_char_table, asm_fprintf_char_table, gcc_diag_char_table)
(gcc_diag_char_table, gcc_cdiag_char_table, gcc_cxxdiag_char_table)
(scan_char_table, time_char_table, monetary_char_table): Initialize
CHAIN to NULL.
(n_format_types): New variable.
(check_format_info_main): Handle CHAIN in format_char_info.
(handle_format_attribute): Handle TARGET_FORMAT_TYPES and
TARGET_N_FORMAT_TYPES.
* config.gcc (i[34567]86-*-solaris2*, sparc64-*-solaris2*)
(sparc-*-solaris2*): Include config/t-sol2 and config/sol2-c.c.
* config/sol2-c.c: New file.
* config/t-sol2: New file.
* config/sol2.h (TARGET_N_FORMAT_TYPES, TARGET_FORMAT_TYPES): Define.
* config/sparc/elf.h, config/sparc/sp64-elf.h: Undefine
TARGET_N_FORMAT_TYPES and TARGET_FORMAT_TYPES.
* doc/extend.texi (Target Format Checks): New section.
(Function Attributes): Mention it.
* doc/invoke.texi: Mention target format checks.
* doc/sourcebuild.texi: Mention target format checks.
* dc/tm.texi (Misc): Document TARGET_N_FORMAT_TYPES and
TARGET_FORMAT_TYPES.
testsuite/
* gcc.dg/format/cmn-err-1.c: New test.
From-SVN: r84920
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/extend.texi | 24 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 2 | ||||
-rw-r--r-- | gcc/doc/sourcebuild.texi | 3 | ||||
-rw-r--r-- | gcc/doc/tm.texi | 11 |
4 files changed, 39 insertions, 1 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 1df0221..3374bab 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -472,6 +472,7 @@ extensions, accepted by GCC in C89 mode and in C++. * Offsetof:: Special syntax for implementing @code{offsetof}. * Other Builtins:: Other built-in functions. * Target Builtins:: Built-in functions specific to particular targets. +* Target Format Checks:: Format checks specific to particular targets. * Pragmas:: Pragmas accepted by GCC. * Unnamed Fields:: Unnamed struct/union fields within structs/unions. * Thread-Local:: Per-thread variables. @@ -2173,6 +2174,10 @@ standard modes, the X/Open function @code{strfmon} is also checked as are @code{printf_unlocked} and @code{fprintf_unlocked}. @xref{C Dialect Options,,Options Controlling C Dialect}. +The target may provide additional types of format checks. +@xref{Target Format Checks,,Format Checks Specific to Particular +Target Machines}. + @item format_arg (@var{string-index}) @cindex @code{format_arg} function attribute @opindex Wformat-nonliteral @@ -7209,6 +7214,25 @@ vector signed int vec_any_numeric (vector float); vector signed int vec_any_out (vector float, vector float); @end smallexample +@node Target Format Checks +@section Format Checks Specific to Particular Target Machines + +For some target machines, GCC supports additional options to the +format attribute +(@pxref{Function Attributes,,Declaring Attributes of Functions}). + +@menu +* Solaris Format Checks:: +@end menu + +@node Solaris Format Checks +@subsection Solaris Format Checks + +Solaris targets support the @code{cmn_err} (or @code{__cmn_err__}) format +check. @code{cmn_err} accepts a subset of the standard @code{printf} +conversions, and the two-argument @code{%b} conversion for displaying +bit-fields. See the Solaris man page for @code{cmn_err} for more information. + @node Pragmas @section Pragmas Accepted by GCC @cindex pragmas diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 14f756b..43f2df6 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -2113,7 +2113,7 @@ specified, and that the conversions specified in the format string make sense. This includes standard functions, and others specified by format attributes (@pxref{Function Attributes}), in the @code{printf}, @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension, -not in the C standard) families. +not in the C standard) families (or other target-specific families). The formats are checked against the format features supported by GNU libc version 2.2. These include all ISO C90 and C99 features, as well diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index d2b834a..f985e50 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -766,6 +766,9 @@ pragmas supported. Documentation in @file{gcc/doc/extend.texi} of any target-specific built-in functions supported. @item +Documentation in @file{gcc/doc/extend.texi} of any target-specific +format checking styles supported. +@item Documentation in @file{gcc/doc/md.texi} of any target-specific constraint letters (@pxref{Machine Constraints, , Constraints for Particular Machines}). diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index c7aade3..a8c410f 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -9278,3 +9278,14 @@ for a virtual function @var{fndecl} when constructing thunks, functions, if a target supports aliases (ie. defines @code{ASM_OUTPUT_DEF}), @code{false} otherwise, @end deftypefn + +@defmac TARGET_FORMAT_TYPES +If defined, this macro is the name of a global variable containing +target-specific format checking information for the @option{-Wformat} +option. The default is to have no target-specific format checks. +@end defmac + +@defmac TARGET_N_FORMAT_TYPES +If defined, this macro is the number of entries in +@code{TARGET_FORMAT_TYPES}. +@end defmac |