In https://svnweb.freebsd.org/changeset/base/351659 @emaste removed gets() from
FreeBSD 13's libc, and our copies of libc++ and libstdc++. In that change, the
declarations were simply deleted, but I would like to propose this conditional
test instead.
Details
Details
Diff Detail
Diff Detail
- Repository
- rCXX libc++
- Build Status
Buildable 37893 Build 37892: arc lint + arc unit
Event Timeline
Comment Actions
I'm wondering if this has become complicated enough that we should define a _LIBCPP_C_HAS_NO_GETS config macro.
Then the code in cstdio becomes:
#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_C_HAS_NO_GETS) using ::gets; #endif
which I think is much clearer, and captures the intent
We do not import gets into namespace std when:
- It does not exist in the underlying C library, or
- We are compiling for C++14 or later.
This comment was removed by mclow.lists.
Comment Actions
LGTM with the one change I suggested.
include/__config | ||
---|---|---|
1147 | Even better would be to have a way to define it at build time as well. So wrap this in #ifndef _LIBCPP_C_HAS_NO_GETS ... #endif and then commit it. |
Even better would be to have a way to define it at build time as well.
So wrap this in
and then commit it.