为什么strcpy_s在我的系统中不存在
Why does strcpy_s not exist anywhere on my system?
我在Debian 8系统上使用clang
。我有标准的C++头。然而,没有定义strcpy_s
的报头。为什么会这样?
# grep -iRHI 'strcpy_s' /usr 2>/dev/null
/usr/include/x86_64-linux-gnu/bits/string2.h: ? __strcpy_small (dest, __strcpy_args (src),
/usr/include/x86_64-linux-gnu/bits/string2.h:__STRING_INLINE char *__strcpy_small (char *, __uint16_t, __uint16_t,
/usr/include/x86_64-linux-gnu/bits/string2.h:__strcpy_small (char *__dest,
/usr/include/x86_64-linux-gnu/bits/string2.h:__STRING_INLINE char *__strcpy_small (char *, __STRING2_COPY_ARR2,
/usr/include/x86_64-linux-gnu/bits/string2.h:__strcpy_small (char *__dest,
/usr/src/broadcom-sta-6.30.223.248/src/include/bcmutils.h:#define bcm_strcpy_s(dst, noOfElements, src) strcpy((dst), (src))
为什么strcpy_s在我的系统中不存在?
strcpy_s
不是由C++标准库提供的。
然而strcpy_s
是由C标准从C11开始指定的。但即使在C11中,strcpy_s
也是可选的。所有标准库实现都不提供所有可选功能。因此,答案似乎是:因为你安装的C标准库中没有一个声明它
如何在系统中获取strcpy_s、strtok_s和所有其他安全字符串函数?
您需要找到一个实现它们的库,或者自己实现它们。
显然,这些不存在是因为它们不存在。我可以通过查找和安装它们来查找和安装;或者,通过自己对它们进行编码。显然,这是一个有用的解决方案,所以让投票开始吧。
相关文章:
- 我们可以访问一个不存在的联盟的成员吗
- C++:对不存在的命名空间使用命名空间指令
- g++ 说函数不存在,即使包含正确的标头
- 显式 std::exception_ptr 转换为 bool 不存在.VS2010 错误?
- C++ 尝试在不存在的构造函数中引用已删除的函数(使用 rapidJson)
- 查找第一个数组中不存在的元素
- 查找不存在的键时,unordered_map返回什么
- 如何优化代码以返回最接近给定整数的数字,但给定列表中不存在?
- set::find 查找不存在的元素
- 有没有办法将字符串添加到 Vector 中,但前提是它尚不存在?->C++
- inet_ntop返回不存在的地址
- CPP 使用不存在的键访问映射
- 为什么QMediaGaplessPlaybackControl不存在?
- 如果键不存在,使用 [] 运算符访问 STL Map 元素会添加新元素
- 标记未定义的颜色,并且颜色匹配系统中不存在样品
- 为什么minhook库目录不存在
- qwebengineview 组件在我的系统中不存在
- 为什么strcpy_s在我的系统中不存在
- 将相对路径转换为完整路径的系统功能,即使对于不存在的路径也适用
- 清理系统托盘中不存在的进程的NotifyIcons