在GCC中,strlen()的实现在哪里? [英] Where is the implementation of strlen() in GCC?

查看:202
本文介绍了在GCC中,strlen()的实现在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以指出我在GCC中strlen()的定义吗?我已经将grep 4.4.2发行版保留了大约一个半小时(而Google疯狂地搜索),但似乎找不到真正实现strlen()的位置.

解决方案

您应该使用的是glibc,而不是GCC-它似乎是在strlen.c中定义的-这是 glibc SVN在线存储库以获取strlen.c .

您应该查看 glibc 而不是gcc的原因是:

GNU C库在GNU系统和大多数具有Linux内核的系统中用作 the C库.

Can anyone point me to the definition of strlen() in GCC? I've been grepping release 4.4.2 for about a half hour now (while Googling like crazy) and I can't seem to find where strlen() is actually implemented.

解决方案

You should be looking in glibc, not GCC -- it seems to be defined in strlen.c -- here's a link to strlen.c for glibc version 2.7... And here is a link to the glibc SVN repository online for strlen.c.

The reason you should be looking at glibc and not gcc is:

The GNU C library is used as the C library in the GNU system and most systems with the Linux kernel.

这篇关于在GCC中,strlen()的实现在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆