]> git.ipfire.org Git - people/ms/gcc.git/commit
Fix "address will never be NULL" warning
authorJan-Benedict Glaw <jbglaw@lug-owl.de>
Fri, 9 Sep 2022 08:27:27 +0000 (10:27 +0200)
committerJan-Benedict Glaw <jbglaw@lug-owl.de>
Fri, 9 Sep 2022 08:30:43 +0000 (10:30 +0200)
commitc2c3e4f6698925c8c969d8525677fbfe98f78909
tree7fe86ebf718e7c7413a5ac5e363b951e60490581
parentb237e36b3864b64894fb4c342f8647e004c8f3de
Fix "address will never be NULL" warning

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.
gcc/c-family/c-format.cc
gcc/doc/tm.texi
gcc/doc/tm.texi.in