[zeromq-dev] Bug report for zeromq

Hejun (Jun He) jun.hejun at huawei.com
Tue Dec 17 15:31:06 CET 2013


________________________________

发件人: Hongsibao
发送时间: 2013年12月17日 20:00
收件人: Hejun (Jun He); Xiamingzhen
主题: 关于zeromq的一个bug,请转发邮件给:zeromq-dev at lists.zeromq.org



OS version: SUSE Linux Enterprise Server 11 (x86_64)
G++(gcc) version: gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux)
zeroMQ version: 4.0.3

Issue:
When compile my code with zeromq, there is a warnning of "zeromq-4.0.3/src/ipc_listener.cpp:127: warning: the use of `tempnam' is dangerous, better use `mkstemp' "
reported by gcc .
The warning means the gcc recommend to use mkstemp instead of tempnam.
I hope you can resolve this warning , because it will block the using of zmq.


here a example of fix the warning.
Code(ipc_listener.cpp):

    static char buffer[12] = "2134XXXXXX";
    // Allow wildcard file
    if (addr[0] == '*') {
        mkstemp(buffer);
        addr.assign (buffer);
    }

#if 0
    //  Allow wildcard file
    if (addr[0] == '*') {
        char *tmpstr = tempnam (NULL, NULL);
        addr.assign (tmpstr);
        free (tmpstr);
    }
#endif

Pls see the attachment of the code file:ipc_listener.cpp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20131217/7e817225/attachment.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ipc_listener.cpp
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20131217/7e817225/attachment.ksh>


More information about the zeromq-dev mailing list