Re: [PATCH 00/37] removal of some c++ keywords
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 30, 2018, 22:36 UTC
- Message-ID
- <xmqq7erzrn3f.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <CACsJy8Cm8HsopKisiJkwtPyfv-O6Ei3waew6CsKLXzKv7=TriQ@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 8 quoted lines
> Is it simpler (though hacky) to just do > > #ifdef __cplusplus > #define new not_new > #define try really_try > ... > > somewhere in git-compat-util.h?
Very tempting, especially given that your approach automatically would cover topics in flight without any merge conflict ;-)
I agree that it is hacky and somewhat ugly, but the hackiness somehow does not bother me too much in this case; perhaps because attempting to use a C++ compiler may already be hacky in the first place?
It probably depends on the reason why we are doing this topic. If a report about our source code coming from the C++ oriented tool cite the symbol names seen by machines, then the "hacky" approach will give us "not_new" where Brandon's patch may give us "new_oid", or whatever symbol that is more appropriate for the context it appears than such an automated cute name.
> Do we use any C features that are incompatible with C++? (or do we not > need to care?)
Good question.