tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Last two warnings


From: Christian Jullien
Subject: [Tinycc-devel] Last two warnings
Date: Wed, 6 Feb 2013 21:49:21 +0100

Hi,

 

You use –Wall to compile tcc, that’s great it means you pay attention to compiler warnings (I love that).

So may I insist to remove the very last two remaining warnings:

 

tccpp.c: In function ‘macro_subst’:

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

 

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);

 

 

 

 

tccelf.c:1317:12: warning: ‘tcc_add_support’ defined but not used [-Wunused-function]

 

This one is probably easy to fix with

 

#if !defined(CONFIG_USE_LIBGCC) && !defined(WITHOUT_LIBTCC)

static int tcc_add_support(TCCState *s1, const char *filename)

{

    char buf[1024];

    snprintf(buf, sizeof(buf), "%s/%s", s1->tcc_lib_path, filename);

    return tcc_add_file(s1, buf);

}

#endif

 

Because we are close to next release, I let you check my changes and decide to push to mob.

 

Christian


reply via email to

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