[cfe-dev] [libc++] gets removed from C11

Howard Hinnant hhinnant at apple.com
Sun Jun 30 14:27:20 PDT 2013


On Jun 30, 2013, at 5:23 PM, Игорь Пашев <pashev.igor at gmail.com> wrote:

> 2013/7/1 Howard Hinnant <hhinnant at apple.com>:
>> Please review the enclosed patch which guards against the removal of gets from <stdio.h> in C11 and addresses:
>> 
>> http://llvm.org/bugs/show_bug.cgi?id=16369
>> 
>> The current patch is known to be correct only on __APPLE__.  I need help from those testing libc++ on other platforms.  Specifically, <__config> now has:
>> 
>> +#ifdef __APPLE__
>> +#define _LIBCPP_HAS_GETS
>> +#endif
>> 
>> which causes <cstdio> to expose gets:
>> 
>> +#ifdef _LIBCPP_HAS_GETS
>> using ::gets;
>> +#endif
>> 
>> I need to know what other platforms (and possibly under what circumstances) should define _LIBCPP_HAS_GETS.  Patches to <__config> in reply to this request for a review are welcome.  It would be nice to not break others when checking in the fix for http://llvm.org/bugs/show_bug.cgi?id=16369.
> 
> Why not to remove ::gets ?

Two reasons, in order of importance:

1.  libc++ currently has clients using it.
2.  gets is required by C++11, which references C99, not C11.

Howard






More information about the cfe-dev mailing list