Re: [PATCH] features.h: do not consider _GNU_SOURCE for gets
Arsen Arsenović <[email protected]>
| Newsgroups | gmane.comp.lib.glibc.alpha |
|---|---|
| Message-ID | <[email protected]> |
Hi H.J, Thanks for responding. "H.J. Lu" <[email protected]> writes: > On Sun, Aug 16, 2026 at 5:05 PM Arsen Arsenović <[email protected]> wrote: >> >> Arsen Arsenović <[email protected]> writes: >> >> > Currently, -std=c99 -D_GNU_SOURCE and similar lack the 'gets' >> > declaration. >> > >> > This causes, say, programs using the: >> > >> > extern __typeof__ (gets) function __attribute__ ((__warning__ (...))) >> >> There's a typo there. That's meant to be: >> >> extern __typeof__ (gets) gets __attribute__ ((__warning__ (...))) >> >> ... of course. >> -- >> Arsen Arsenović > > At least, more tests are needed for changed behavior: > > 1. No gets prototype for ISO C11 and ISO C++14. Isn't C11 covered by conform/ already? I initially accidentally made the 'gets' signature available in C11 (by typo-ing the stdc value), and it was caught. And, indeed, stdio.h has: #if !defined ISO11 && !defined ISO23 function {char*} gets (char*) #endif As for C++, sure, that makes sense, but there's no existing framework for writing those as far as I can tell. Similarly, for ... > 2. Warnings of gets usage from compiler before ISO C11 or ISO C++14. ... I am not sure how diagnostic tests would work in glibc (obviously its testsuite differs to that of GCC), and I haven't been able to parse out the right approach from the makefiles. AFAICS, the right thing to do would be a tst-*.sh that greps compiler output? But then, that seems redundant with the existing conform/ machinery (and the warnings are not something peculiar to this patch, they already exist in glibc today). Guidance appreciated on how to approach writing these two tests. Thanks in advance! Have a lovely evening. -- Arsen Arsenović
signature.asc
(application/pgp-signature, 288 B)
-----BEGIN PGP SIGNATURE----- iKIEARYKAEoWIQT+4rPRE/wAoxYtYGFSwpQwHqLEkwUCapILFBsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDIQHGFyc2VuQGFhcnNlbi5tZQAKCRBSwpQwHqLEk5+G AQD5JG4V8o2QaXjNsmWKbn2y8vubAkCeoDIOo0xuUFINPQEA7fquEjtnYV83kVmd oiei6tJSFmcxORkeH6B4Z9SBGwk= =Y87M -----END PGP SIGNATURE-----