Re: N3322 functionality tests
Paul Eggert <[email protected]> Fri, 31 Jul 2026 21:50:01 -0700
| Newsgroups | gmane.comp.lib.gnulib.bugs |
|---|---|
| Organization | UCLA Computer Science Department |
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --------------aRrV8JbjBq68oX6vwu4os8Km Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2026-07-31 14:34, Bruno Haible wrote: > Lasse has already done a large part of the testing work. I guess I don't have quite the confidence that the testing work is close to done. And part of this is it sounds like my goals weren't the same. Mine was to guarantee a small extra element of software safety by ensuring N3322 semantics, whereas the current Gnulib goal, I guess, is more modest, namely, to scout for implementations that obviously don't conform to N3322. > So, IMO, what we can aim for, here, is: > > - Enhance the unit tests. > > - Refine the #if conditions: Replace 2.45 with 2.99, maybe add an > __STDC_VERSION__ test to the __GNUC__ and __GNUC_MAJOR__ condition. There are many compiler configurations out there - some that don't even exist yet. And our tests are not likely to be complete enough to check for all plausible failures in this area. > > - In gnulib-readme.texi say that portable code should not assume N3322, other > than assuming that NULL + 0 works. Yes, that's prudent. Done via the attached patch. > Then, 10 years from now, users can judge from the #if conditions whether they > can assume N3322 or not. I suspect that ten years from now it'll still be dicey in general, and there still won't be a good way for users to see whether their guess is right if they guess the riskier approach of assuming N3322 in their apps. The more prudent approach would be to follow the advice in the attached patch, namely, don't assume most of N3322. With that in mind, we might want to reconsider Gnulib's current redeclarations of memcpy etc., as they're likely to make it harder to follow that advice. --------------aRrV8JbjBq68oX6vwu4os8Km Content-Type: text/x-patch; charset=UTF-8; name="0001-doc-N3322-cautions.patch" Content-Disposition: attachment; filename="0001-doc-N3322-cautions.patch" Content-Transfer-Encoding: base64 RnJvbSBjYTMxNzRjYWRhZDhiYzU1NzM0NDg0NjRhZmU0NmJiMDVhZGI5YTkyIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1 PgpEY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