summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Tyser <ptyser@xes-inc.com>2010-04-04 22:36:03 -0500
committerWolfgang Denk <wd@denx.de>2010-04-10 00:30:26 +0200
commita2513e27e8df2b7bf481d03e7719f91ce19e89d5 (patch)
tree53db365ec87e50ad80d9d87139c4758f3aef22fb
parent1f2463d7642c582339c9f9d96471d5d2a169b9bb (diff)
downloadu-boot-imx-a2513e27e8df2b7bf481d03e7719f91ce19e89d5.zip
u-boot-imx-a2513e27e8df2b7bf481d03e7719f91ce19e89d5.tar.gz
u-boot-imx-a2513e27e8df2b7bf481d03e7719f91ce19e89d5.tar.bz2
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>
-rw-r--r--tools/mkimage.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/mkimage.c b/tools/mkimage.c
index 5c3e872..f5859d7 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -145,7 +145,7 @@ main (int argc, char **argv)
{
int ifd = -1;
struct stat sbuf;
- unsigned char *ptr;
+ char *ptr;
int retval = 0;
struct image_type_params *tparams = NULL;
@@ -201,8 +201,7 @@ main (int argc, char **argv)
case 'a':
if (--argc <= 0)
usage ();
- params.addr = strtoul (*++argv,
- (char **)&ptr, 16);
+ params.addr = strtoul (*++argv, &ptr, 16);
if (*ptr) {
fprintf (stderr,
"%s: invalid load address %s\n",
@@ -219,8 +218,7 @@ main (int argc, char **argv)
case 'e':
if (--argc <= 0)
usage ();
- params.ep = strtoul (*++argv,
- (char **)&ptr, 16);
+ params.ep = strtoul (*++argv, &ptr, 16);
if (*ptr) {
fprintf (stderr,
"%s: invalid entry point %s\n",