tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Last two warnings


From: grischka
Subject: Re: [Tinycc-devel] Last two warnings
Date: Wed, 13 Feb 2013 14:39:32 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Christian Jullien wrote:
tccpp.c: In function ‘macro_subst’:
tccpp.c:2803:12: warning: ‘*((void *)&cval+4)’ is used uninitialized in this function [-Wuninitialized]

Because gcc is unable to know if we entered the first loop (which
possibly can initialize some cval fields), it complains on line 2840
that cval might be used uninitialized (by 2810 if we do not enter the
first loop).

To me, the first use is only to find ## and we don't do anything
with cval, so it is safe to use a local declaration:

    /* we search the first '##' */
    for(ptr = macro_str;;) {
       CValue ignored;
        TOK_GET(&t, &ptr, &ignored);
        if (t == TOK_TWOSHARPS)
            break;
        /* nothing more to do if end of string */
        if (t == 0)
            return NULL;
    }

Anyway, this looks like a bug in gcc.  If you still want to
fix it in TCC, go for it.  Please move both declaration into
their local block, then.

--- grischka

(who wrote:)
Which doesn't make neither "cval" any more initialized !?!

Maybe just a case of acute GCC warning hysteria.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]