From: "Philip Oakley" <philipoakley@iee.org>
To: "Jeff King" <peff@peff.net>
Cc: "Git List" <git@vger.kernel.org>, "Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH] remote.c: spell __attribute__ correctly
Date: Mon, 25 Apr 2016 22:50:53 +0100 [thread overview]
Message-ID: <2FDBFACB68254498A8F83367553AED80@PhilipOakley> (raw)
In-Reply-To: 20160425211523.GA11227@sigill.intra.peff.net
From: "Jeff King" <peff@peff.net>
> On Mon, Apr 25, 2016 at 05:10:30PM -0400, Jeff King wrote:
>
>> It should be handled in git-compat-util.h, which is included by cache.h,
>> which is included by remote.c.
>>
>> There we have:
>>
>> #ifndef __GNUC__
>> #ifndef __attribute__
>> #define __attribute__(x)
>> #endif
>> #endif
>>
>> which should make it a noop on compilers which don't know about it. Is
>> VS (or another file) setting __GNUC__?
>
> Of course it helps if we spell the name right...
>
> -- >8 --
> Subject: remote.c: spell __attribute__ correctly
>
> We want to tell the compiler that error_buf() uses
> printf()-style arguments via the __attribute__ mechanism,
> but the original commit (3a429d0), forgot the trailing "__".
> This happens to work with real GNUC-compatible compilers
> like gcc and clang, but confuses our fallback macro in
> git-compat-util.h, which only matches the official name (and
> thus the build fails on compilers like Visual Studio).
>
> Reported-by: Philip Oakley <philipoakley@iee.org>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> remote.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/remote.c b/remote.c
> index 28fd676..ddc4f8f 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -1660,7 +1660,7 @@ int branch_merge_matches(struct branch *branch,
> return refname_match(branch->merge[i]->src, refname);
> }
>
> -__attribute((format (printf,2,3)))
> +__attribute__((format (printf,2,3)))
> static const char *error_buf(struct strbuf *err, const char *fmt, ...)
> {
> if (err) {
> --
Thanks for clarifying that (sorry about the crossed emails). The compile is
now looking good.
I'm just left with some unresolved external symbol link errors now.
The same naming issue in compat/regex/regcomp.c, compat/regex/regexec.c,
compat/regex/regex_internal.c and compat/regex/regex_internal.h was
probably what lead me astray...
Philip
next prev parent reply other threads:[~2016-04-25 21:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-25 21:02 definition for _attribute() in remote.c Philip Oakley
2016-04-25 21:10 ` Jeff King
2016-04-25 21:15 ` [PATCH] remote.c: spell __attribute__ correctly Jeff King
2016-04-25 21:50 ` Philip Oakley [this message]
2016-04-25 22:14 ` Ramsay Jones
2016-04-26 13:19 ` Philip Oakley
2016-04-25 21:34 ` definition for _attribute() in remote.c Philip Oakley
2016-04-25 21:39 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2FDBFACB68254498A8F83367553AED80@PhilipOakley \
--to=philipoakley@iee.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox