Re: [PATCH v3 5/5] list-objects-filter: remove OPT_PARSE_LIST_OBJECTS_FILTER_INIT()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 30, 2022, 01:20 UTC
- Message-ID
- <xmqqzgc91bn7.fsf@gitster.g>
- In-Reply-To
- <accc4f29-8e8e-5b8b-9409-6f2ac51c2936@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 5 quoted lines
> OPT_PARSE_LIST_OBJECTS_FILTER_INIT() with a non-NULL second argument > passes a function pointer via an object pointer, which is undefined. It > may work fine on platforms that implement C99 extension J.5.7 (Function > pointer casts). Remove the unused macro and avoid the dependency on > that extension.
Makes sense. Some of us may consider that no platform of importance exists in practice that breaks with such a cast, but our opinion does not matter at all, while opinion of those who supply compilers and checkers to us do---they may decide to flag such a use with a warning and that would break our build with the -Werror option. If we do not have to rely on the extension, we should.
Thanks.