Re: git: cd0727ec709b - main - libc: Add <stdio.h> C23 feature test macro
Date: Mon, 17 Aug 2026 14:35:00 UTC
On 8/15/26 14:37, Faraz Vahedi wrote: > Hello Dimitry, > > Thanks for the report. > >>> The test used by this package seems defective. >>> I don't think we should try to support such defective code. >>> Perhaps the gmp source can be patched to check for >>> __STDC_VERSION_STDIO_H__? >> >> Of course it could, and the patch is pretty simple. But I do not agree >> that the code is "defective". Before C23, there was no standard way of >> checking whether you had FILE declared. > > The approach is neither portable nor standard, and therefore I believe we > should not contaminate our libc with an unnecessary compatibility macro. > If gmp requires FILE, including <stdio.h> would be sufficient, and if for any > reason it prefers not to include it and instead relies on some indication, > that issue should be addressed therein. We can patch the port and, in > parallel, submit a fix upstream. This is not a realistic stance. There is a lot of software in the world written before C23 was standardized, and we cannot expect that ports will only contain C23 software. dim@'s patch looks sane to me and seems like the reasonable path foward. It also matches our historic behavior which has been to add new macros when required, but not retire existing header include guards when doing so. -- John Baldwin