public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jeroen Hofstee <jeroen@myspectrum.nl>
To: u-boot@lists.denx.de
Subject: [U-Boot] clang sandbox warning
Date: Tue, 10 Jun 2014 20:38:28 +0200	[thread overview]
Message-ID: <1402425508.2437.37.camel@yellow> (raw)

Hello Simon,

While trying to find a u-boot make command which likely works with a
pre-build clang linux package I got the following warnings:

`make CC="clang -no-integrated-as" HOSTCC="clang -no-integrated-as"
HOST_TOOLS_ALL=y sandbox_config tools`


/home/jeroen/software/u-boot/arch/sandbox/include/asm/bitops.h:59:17:
warning: variable 'flags' is uninitialized when used here
[-Wuninitialized]
        local_irq_save(flags);
                       ^~~~~
/home/jeroen/software/u-boot/arch/sandbox/include/asm/bitops.h:56:21:
note: initialize the variable 'flags' to silence this warning
        unsigned long flags;
                           ^
                            = 0
/home/jeroen/software/u-boot/arch/sandbox/include/asm/bitops.h:81:17:
warning: variable 'flags' is uninitialized when used here
[-Wuninitialized]
        local_irq_save(flags);
                       ^~~~~
/home/jeroen/software/u-boot/arch/sandbox/include/asm/bitops.h:78:21:
note: initialize the variable 'flags' to silence this warning
        unsigned long flags;
                           ^
                            = 0

I guess gcc accepts this since flags is not actually used. Anyway merely
mentioned for completeness. You might be interested in:

/home/jeroen/software/u-boot/tools/../lib/rsa/rsa-sign.c:77:6: warning:
variable 'ret' is used uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
        if (!rsa) {
            ^~~~
/home/jeroen/software/u-boot/tools/../lib/rsa/rsa-sign.c:94:9: note:
uninitialized use occurs here
        return ret;
               ^~~
/home/jeroen/software/u-boot/tools/../lib/rsa/rsa-sign.c:77:2: note:
remove the 'if' if its condition is always false
        if (!rsa) {
        ^~~~~~~~~~~
/home/jeroen/software/u-boot/tools/../lib/rsa/rsa-sign.c:48:9: note:
initialize the variable 'ret' to silence this warning
        int ret;
               ^
                = 0

which actually looks like a bug. And:


/home/jeroen/software/u-boot/tools/../lib/rsa/rsa-verify.c:59:27:
warning: comparison of unsigned expression >= 0 is always true
[-Wtautological-compare]
        for (i = key->len - 1; i >= 0; i--) {
                               ~ ^  ~


which looks a bit odd, especially since there is no way to break out of
the loop and reach the final return statement, which has a comment to
that it might be useful (equal).

Regards,
Jeroen

             reply	other threads:[~2014-06-10 18:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10 18:38 Jeroen Hofstee [this message]
2014-07-30 15:57 ` [U-Boot] clang sandbox warning Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402425508.2437.37.camel@yellow \
    --to=jeroen@myspectrum.nl \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox