From: "Philip Oakley" <philipoakley@iee.org>
To: "Jeff King" <peff@peff.net>
Cc: "Git List" <git@vger.kernel.org>
Subject: Re: definition for _attribute() in remote.c
Date: Mon, 25 Apr 2016 22:34:27 +0100 [thread overview]
Message-ID: <F23050BD4C62408D97A64B1D885007A8@PhilipOakley> (raw)
In-Reply-To: 20160425211030.GA10309@sigill.intra.peff.net
From: "Jeff King" <peff@peff.net>
> On Mon, Apr 25, 2016 at 10:02:38PM +0100, Philip Oakley wrote:
>
>> I'm looking at getting Git for Windows to compile via Visual Studio
>> (https://github.com/git-for-windows/git/pull/256).
>>
>> However the use of __attribute() in remote.c at L1662
>> (https://github.com/git-for-windows/git/blob/master/remote.c#L1662) has
>> got
>> me confused in that I can't see how the regular definition of
>> __attribute()
>> is #included in this case. A definition is given in
>> git\compat\regex\regex_internal.h but doesn't appear to be on remote.c's
>> include path.
>>
>> The line was introduced by 3a429d0 (remote.c: report specific errors from
>> branch_get_upstream, 2015-05-21) which appears to be later than the
>> previous
>> MSVC testers had looked at.
>
> 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__?
It's not the __attribute__ definition (a Gnu C ism), rather its the
__attribute variant, which has a definition in regex_internal.h, and is used
in the regex code. It's that one that's used in remote.c that I can't fathom
(i.e. how it worked in normally)
regex_internal.h#L160-164
#ifdef __GNUC__
# define __attribute(arg) __attribute__ (arg)
#else
# define __attribute(arg)
#endif
thus when the compilation get to remote.c#L1662 it fails to find that
definition.
Should that line use the gnu extension name?
--
Philip
next prev parent reply other threads:[~2016-04-25 21:34 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
2016-04-25 22:14 ` Ramsay Jones
2016-04-26 13:19 ` Philip Oakley
2016-04-25 21:34 ` Philip Oakley [this message]
2016-04-25 21:39 ` definition for _attribute() in remote.c 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F23050BD4C62408D97A64B1D885007A8@PhilipOakley \
--to=philipoakley@iee.org \
--cc=git@vger.kernel.org \
--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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).