Re: git: cd0727ec709b - main - libc: Add <stdio.h> C23 feature test macro
Faraz Vahedi <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.cvs.src,gmane.os.freebsd.current.scm |
|---|---|
| Message-ID | <[email protected]> |
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. I honestly expected that we might encounter a case like this, but I would appreciate it if we could avoid defining an unnecessary macro solely to accommodate an approach that is not standards-compliant. > That said, I have applied such a patch locally, and it seems to work. > But obviously a maintainer of a port would say "this has worked for 20 > years, why change it now" ? :) I agree that it is a reasonable argument for a port maintainer, but it doesn’t really establish that the approach is correct or portable. It only establishes that the particular set of libc implementations the port has encountered happened to expose the macro it was looking for. If the port is relying on an implementation-defined include guard, then a libc changing that guard is not, strictly speaking, breaking a supported interface. Consequently, the appropriate fix is for the port to fix it rather than for libc to preserve it indefinitely as a compatibility interface that is neither established nor widely recognised. Cheers, Faraz
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEnunneCmADnpNx8ZMLdpU9MVz/74FAmqAsfAACgkQLdpU9MVz /76zOg/+OHsw3VPpNY+kGL2BVlZCd1rQewZn78DwW7wT5GVK0oX9pQc4t6gJNoa0 TjWGzojbvNcdRssTQ5HPpgFrNzIrwSf+UjT1AkQ2lM1rIuOzMy7hs+vkgwLPc7Z/ oHFgSn0/B/zW50SUQleYdfePAuj0jc20G07lC5ccy+PHFM8M3KmgtlL5mY5ehWgU uZ9jZyxi+1rvhtz/X9pCx5PhGwjlgYaqitGfliOononZ8iRoRcl0a6mQVJWPieia ExvlYCD4tkBvzjY7hrh8GdeW4qvqXP+6f/LycoMm6HISl0wwD+q76iZcJ81e40GP o59KTTkIpheuGcd9J90ERYPhfoT8Nc1S6Y/zpwlLeCnJRG1OLicux5ZC5PByIz8W XQarFncvIItvGI73gaIDBhlSHjMXCluUHJbkRvZbrDEYLsS72j+chlQaFDOTp5wK kvsG51vWbqoMVnC6B4M/I1BCk4MXJz8TrMfKHNFv1qYRQm8cM7M1VcStJJRLQ4RF 0HntKuTF9P3aoDtPLiPVEFkdCEV3RYjUpx7jVn2IiSYaykXx+JhPieGUwoP2nrop 1F6rIUJiFF2aO5dHZ9toJiKHMlQEZ1z5qOH5A5T7+A7vy+RF7zvN/k4ZlOZ4RJXi 6o9mZ2Fg6OxMadw0tEMjlphdw7EVOy1Dv/y2hfwBaQ2ufS/ZFvE= =ZYnj -----END PGP SIGNATURE-----