mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
mkimage: Fix strict-aliasing compiler warning
Version 4.2.4 of gcc produces the following warnings without this change: mkimage.c: In function ‘main’: mkimage.c:204: warning: dereferencing type-punned pointer will break strict-aliasing rules mkimage.c:222: warning: dereferencing type-punned pointer will break strict-aliasing rules Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
This commit is contained in:
parent
1f2463d764
commit
a2513e27e8
1 changed files with 3 additions and 5 deletions
|
@ -145,7 +145,7 @@ main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
int ifd = -1;
|
int ifd = -1;
|
||||||
struct stat sbuf;
|
struct stat sbuf;
|
||||||
unsigned char *ptr;
|
char *ptr;
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
struct image_type_params *tparams = NULL;
|
struct image_type_params *tparams = NULL;
|
||||||
|
|
||||||
|
@ -201,8 +201,7 @@ main (int argc, char **argv)
|
||||||
case 'a':
|
case 'a':
|
||||||
if (--argc <= 0)
|
if (--argc <= 0)
|
||||||
usage ();
|
usage ();
|
||||||
params.addr = strtoul (*++argv,
|
params.addr = strtoul (*++argv, &ptr, 16);
|
||||||
(char **)&ptr, 16);
|
|
||||||
if (*ptr) {
|
if (*ptr) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"%s: invalid load address %s\n",
|
"%s: invalid load address %s\n",
|
||||||
|
@ -219,8 +218,7 @@ main (int argc, char **argv)
|
||||||
case 'e':
|
case 'e':
|
||||||
if (--argc <= 0)
|
if (--argc <= 0)
|
||||||
usage ();
|
usage ();
|
||||||
params.ep = strtoul (*++argv,
|
params.ep = strtoul (*++argv, &ptr, 16);
|
||||||
(char **)&ptr, 16);
|
|
||||||
if (*ptr) {
|
if (*ptr) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"%s: invalid entry point %s\n",
|
"%s: invalid entry point %s\n",
|
||||||
|
|
Loading…
Reference in a new issue