public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Niklaus Giger <niklaus.giger@member.fsf.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] 4xx warnings on cmd_elf.c
Date: Sat, 01 Nov 2008 11:30:40 +0100	[thread overview]
Message-ID: <gehb4g$s2q$1@ger.gmane.org> (raw)
In-Reply-To: 200810311616.15825.sr@denx.de

Stefan Roese wrote:

> On Friday 31 October 2008, Kumar Gala wrote:
>> So when I build a 4xx config I see:
>>
>> cmd_elf.c: In function 'do_bootvx':
>> cmd_elf.c:173: warning: array subscript is below array bounds
>> cmd_elf.c:176: warning: array subscript is below array bounds
>> cmd_elf.c:181: warning: array subscript is below array bounds
>>
>>                 sprintf (build_buf, "ibmEmac(0,0)");
>>
>>                 if ((tmp = getenv ("hostname")) != NULL) {
>>                         sprintf (&build_buf[strlen (build_buf - 1)],
>>                                 "host:%s ", tmp);
>>                 } else {
>>                         sprintf (&build_buf[strlen (build_buf - 1)],
>>                                 ": ");
>>                 }
>>
>>                 if ((tmp = getenv ("ipaddr")) != NULL) {
>>                         sprintf (&build_buf[strlen (build_buf - 1)],
>>                                 "e=%s ", tmp);
>>                 }
>>
>>
>> these seem suspect.. should this be &build_buf[strlen(build_buf) - 1] ?
> 
> I haven't seen those warnings before. Triggered by your newer gcc most
> likely. But you seem to be correct. The current code is definitely wrong.
> And I think that your version is wrong as well. This should do the "right
> thing":
> 
> &build_buf[strlen(build_buf)]
You are definitely right. But the code is broken in several ways as it does
no generate a correct bootline which can be interpreted by vxWorks
> I have no VxWorks platform to test this though.
A patch (tested) on my HCUx platform will follow soon.
> 
> Best regards,
> Stefan
Best regards

Niklaus

      reply	other threads:[~2008-11-01 10:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-31 14:30 [U-Boot] 4xx warnings on cmd_elf.c Kumar Gala
2008-10-31 15:16 ` Stefan Roese
2008-11-01 10:30   ` Niklaus Giger [this message]

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='gehb4g$s2q$1@ger.gmane.org' \
    --to=niklaus.giger@member.fsf.org \
    --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