<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SIGILL bei va_start]]></title><description><![CDATA[<p>Hallo ich habe folgende Funktion:</p>
<pre><code class="language-cpp">ERRNO cGenericDevice::SendCommand(unsigned _Direction, unsigned _Command, ...)
{
    m_Command.clear();

    if (SendENQ())
    {
         return ERR_NAK;
    }

    if (ReceiveACK())
    {
         return ERR_NAK;
    }

    unsigned CommandSize;
    unsigned checksum = 0xff;

    m_Command.push_back(STX);

    m_Command.push_back(_Direction);
    CommandSize++;
    checksum -= _Direction;

    m_Command.push_back(_Command);
    CommandSize++;
    checksum -= _Command;

    va_list morebytes;
    va_start(morebytes, _Command);
    unsigned char tempbyte;

    for (;;)
    {
        tempbyte = va_arg(morebytes, unsigned char);

        if (tempbyte == '\0')
        {
            break;
        }

        m_Command.push_back(static_cast&lt;unsigned&gt;(tempbyte));
        CommandSize++;
        checksum -= tempbyte;
    }

    va_end(morebytes);

    if (SendByte(CommandSize))
    {
        return ERR_NAK;
    }

    checksum -= CommandSize;

    m_Command.push_back(checksum);
    m_Command.push_back(ETX);

    if (SendByteVector(m_Command))
    {
        return ERR_NAK;
    }

    return ERR_OK;
}
</code></pre>
<p>Ich verwende g++-4.3. Das Programm bricht bei va_start mit einem SIGILL ab.<br />
Ich kann in meinem Code aber keinen Fehler entdecken.<br />
Was mach ich falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/226458/sigill-bei-va_start</link><generator>RSS for Node</generator><lastBuildDate>Thu, 01 Oct 2026 00:00:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/226458.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 01 Nov 2008 14:26:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SIGILL bei va_start on Sat, 01 Nov 2008 14:26:48 GMT]]></title><description><![CDATA[<p>Hallo ich habe folgende Funktion:</p>
<pre><code class="language-cpp">ERRNO cGenericDevice::SendCommand(unsigned _Direction, unsigned _Command, ...)
{
    m_Command.clear();

    if (SendENQ())
    {
         return ERR_NAK;
    }

    if (ReceiveACK())
    {
         return ERR_NAK;
    }

    unsigned CommandSize;
    unsigned checksum = 0xff;

    m_Command.push_back(STX);

    m_Command.push_back(_Direction);
    CommandSize++;
    checksum -= _Direction;

    m_Command.push_back(_Command);
    CommandSize++;
    checksum -= _Command;

    va_list morebytes;
    va_start(morebytes, _Command);
    unsigned char tempbyte;

    for (;;)
    {
        tempbyte = va_arg(morebytes, unsigned char);

        if (tempbyte == '\0')
        {
            break;
        }

        m_Command.push_back(static_cast&lt;unsigned&gt;(tempbyte));
        CommandSize++;
        checksum -= tempbyte;
    }

    va_end(morebytes);

    if (SendByte(CommandSize))
    {
        return ERR_NAK;
    }

    checksum -= CommandSize;

    m_Command.push_back(checksum);
    m_Command.push_back(ETX);

    if (SendByteVector(m_Command))
    {
        return ERR_NAK;
    }

    return ERR_OK;
}
</code></pre>
<p>Ich verwende g++-4.3. Das Programm bricht bei va_start mit einem SIGILL ab.<br />
Ich kann in meinem Code aber keinen Fehler entdecken.<br />
Was mach ich falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1608560</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1608560</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Sat, 01 Nov 2008 14:26:48 GMT</pubDate></item></channel></rss>