[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, 06 Feb 2013 23:22:38 +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]
I can't make sense from "*((void *)&cval+4)". (Is it trying
to say "cval.tab[1]"?)
Only usage of cval is "address of" here:
cstr_cat(&cstr, get_tok_str(t, &cval));
Are you maybe using -O13 or something?
Declaring cval (two times) close to the places where it is are actually
used, fixes the warning and does not seem break the regression tests
/* we search the first '##' */
for(ptr = macro_str;;) {
CValue cval;
TOK_GET(&t, &ptr, &cval);
…
if (t && t != TOK_TWOSHARPS) {
CValue cval;
TOK_GET(&t, &ptr, &cval);
Which doesn't make neither "cval" any more initialized !?!
Maybe just a case of acute GCC warning hysteria. In fact I see
lots of warnings (with some gcc versions) that apparently you
don't see. I pass some --extra-cflags.
--- grischka