At 07:17 -0700 11 Apr 2019, "Kevin J. McCarthy" <ke...@8t8.us> wrote:
On Wed, Apr 10, 2019 at 07:44:45PM -0400, aaron+m...@schrab.com wrote:
Let compilers know that `mutt_buffer_printf()` and
`mutt_buffer_add_printf()` expect the second argument to be a
`printf`-style format string with the arguments for the format starting
at the third argument. This allows warnings to be shown if these are
incorrect.

AKAIK this is a GCC extension.

Yes, I think it is. Although it's also supported by clang.

Mutt thus far has tried to remain compiler agnostic, so I'm -0 to this.

There are already a few uses of __attribute__ in the mutt code; mostly in `intl/` but also one in `monitor.c`. The git codebase also tries to be extremely portable, but it makes a fair amount of use of __attribute__ including this one. For other compilers it does:

#ifndef __GNUC__
#ifndef __attribute__
#define __attribute__(x)
#endif
#endif

If not for the existing uses, I likely would have either looked into adding that as well or not sent the patch. As it is, it doesn't really matter much to me if this gets included; I ended up not using either of these functions in the code that I was writing that originally got me looking into that.

Attachment: signature.asc
Description: PGP signature

Reply via email to