朕勒个擦,debian怎么报bug?

软件和网站开发以及相关技术探讨
回复
头像
youqika
帖子: 720
注册时间: 2008-09-25 20:56

朕勒个擦,debian怎么报bug?

#1

帖子 youqika » 2013-06-13 9:49

本来是写个测试工具,还没写几行链接器就挂了(vbox + debian6)

代码: 全选

#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>

#include <stdio.h>
#include <stdlib.h>


#define ECHO_PORT       9797


extern int errno;


int main(int argc, char *argv[])
{
    int srv_sock = 0;
    int tmp_err = 0;

    errno = 0;
    srv_sock = socket(PF_INET, SOCK_STREAM, 0);
    tmp_err = errno;
    if (-1 == srv_sock) {
        fprintf(stderr, "[ERROR] create socket failed: %d\n", tmp_err);

        return EXIT_FAILURE;
    }

    return EXIT_SUCCESS;
}

代码: 全选

gcc -Wall -g -o xxx xxx.c

代码: 全选

collect2: ld terminated with signal 11 [Segmentation fault], core dumped
/usr/bin/ld: make: *** [ALL] Error 1
UCHIHA
运气是为白痴准备的
头像
youqika
帖子: 720
注册时间: 2008-09-25 20:56

Re: 朕勒个擦,debian怎么报bug?

#2

帖子 youqika » 2013-06-13 10:33

加上#include <errno.h>搞定,话说这是bug么,大神解释下

代码: 全选

It was common in traditional C to declare errno manually (i.e., extern int errno) instead of including <errno.h>.  Do not do this.  It will not  work with modern versions of the C library.  However, on (very) old Unix systems, there may be no <errno.h> and the declaration is needed.
UCHIHA
运气是为白痴准备的
头像
adam8157
帖子: 2794
注册时间: 2009-03-05 16:31
联系:

Re: 朕勒个擦,debian怎么报bug?

#3

帖子 adam8157 » 2013-06-13 13:00

这是你的问题...

那句英文讲的是, 很多老代码喜欢手动定义errno, 但是现在的标准使用errno.h

另外, debian报bug是通过邮件或者reportbug这个软件.
回复