The mingw32 port is the only port to have TARGET_OVERRIDES_FORMAT_ATTRIBUTES
defined. When this macro is defined, it will never evaluate to NULL and produce
a warning: "error: the address of 'mingw_format_attribute_overrides' will never
be NULL [-Werror=address]"
Also, when TARGET_OVERRIDES_FORMAT_ATTRIBUTES is defined,
TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT must be defined as well. Add that
requirement to the docs.
2022-09-07 Jan-Benedict Glaw <jbglaw@lug-owl.de>
gcc/c-family/ChangeLog:
* c-format.cc (convert_format_name_to_system_name): Fix warning.
gcc/ChangeLog:
* doc/tm.texi.in (TARGET_OVERRIDES_FORMAT_ATTRIBUTES): Document requirement
of TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT being defined as well.
* doc/tm.texi: Regenerate.
#ifdef TARGET_OVERRIDES_FORMAT_ATTRIBUTES
/* Check if format attribute is overridden by target. */
- if (TARGET_OVERRIDES_FORMAT_ATTRIBUTES != NULL
- && TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT > 0)
+ if (TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT > 0)
{
for (i = 0; i < TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT; ++i)
{
If defined, this macro is the name of a global variable containing
target-specific format overrides for the @option{-Wformat} option. The
default is to have no target-specific format overrides. If defined,
-@code{TARGET_FORMAT_TYPES} must be defined, too.
+@code{TARGET_FORMAT_TYPES} and @code{TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT}
+must be defined, too.
@end defmac
@defmac TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT
If defined, this macro is the name of a global variable containing
target-specific format overrides for the @option{-Wformat} option. The
default is to have no target-specific format overrides. If defined,
-@code{TARGET_FORMAT_TYPES} must be defined, too.
+@code{TARGET_FORMAT_TYPES} and @code{TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT}
+must be defined, too.
@end defmac
@defmac TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT