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>
{
int ifd = -1;
struct stat sbuf;
- unsigned char *ptr;
+ char *ptr;
int retval = 0;
struct image_type_params *tparams = NULL;
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",
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",