autoconf: check for format __attribute__ to avoid warnings 56/12956/6
authorMichael Meffie <mmeffie@sinenomine.net>
Sun, 14 Jan 2018 14:38:26 +0000 (09:38 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 10 Aug 2018 11:55:08 +0000 (07:55 -0400)
commitf9b3cf888304d42c2a1a8472fdeeab68a7347859
tree9f092f36c2d651263a2c7d5c17bc4802815d7ab4
parentb818854f19e33315d1b6453b72a55b54d740e976
autoconf: check for format __attribute__ to avoid warnings

Building with Solaris Studio generates a ludicrous number of warnings
in the form:

   roken.h, line ...: warning: attribute "format" is unknown, ignored

Modern Solaris Studio supports several GCC-style function attributes,
including the `noreturn' attribute, however does not support the
`format' attribute.

Currently, configure defines HAVE___ATTRIBUTE__ when the `noreturn'
attribute is available. roken headers conditionally declare printf-like
functions with the `format' function attribute when HAVE___ATTRIBUTE__
is defined, leading to the warning messages when building under Solaris
Studio. Unsupported function attributes generate warnings, not errors.

Fix these warnings by defining HAVE___ATTRIBUTE__ if and only if the
`format' attribute is supported by the compiler, instead of checking for
`noreturn'.  Note that the `format' type is currently the only attribute
used by roken at this time.

Change-Id: I569167333d65df2583befc19befa8d719b93d75a
Reviewed-on: https://gerrit.openafs.org/12956
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/cf/c-attribute.m4