[PATCH 1/6] build fix: unsigned long = %lX

Eugene Krasnikov k.eugene.e at gmail.com
Mon Mar 18 06:08:39 EDT 2013


For some reason 'make build' fails after applying this patch with a
following error:

target_firmware/magpie_fw_dev/build/magpie_1_1/image/magpie_ram/../../../..//build/magpie_1_1/image/magpie_ram/fwu.c:4:1:
warning: large integer implicitly truncated to unsigned type [-Woverflow]

Do you have the same error?

2013/3/17 Oleksij Rempel <linux at rempel-privat.de>

> From: Oleksij Rempel <bug-track at fisher-privat.net>
>
> Signed-off-by: Oleksij Rempel <linux at rempel-privat.de>
> ---
>  .../magpie_fw_dev/build/utility/bin2hex/bin2hex.c            | 12
> ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/target_firmware/magpie_fw_dev/build/utility/bin2hex/bin2hex.c
> b/target_firmware/magpie_fw_dev/build/utility/bin2hex/bin2hex.c
> index 6fd2541..5d3b14c 100755
> --- a/target_firmware/magpie_fw_dev/build/utility/bin2hex/bin2hex.c
> +++ b/target_firmware/magpie_fw_dev/build/utility/bin2hex/bin2hex.c
> @@ -23,7 +23,7 @@ void write_file(FILE *out, unsigned char *buf, unsigned
> long size, unsigned char
>                     tmp_buf[2] = buf[i+2];
>                     tmp_buf[3] = buf[i+3];
>
> -                       fprintf(out, "0x%08X, ", *((unsigned long
> *)(&tmp_buf[0])));
> +                       fprintf(out, "0x%08lX, ", *((unsigned long
> *)(&tmp_buf[0])));
>
>          } else {
>
> @@ -34,7 +34,7 @@ void write_file(FILE *out, unsigned char *buf, unsigned
> long size, unsigned char
>                         tmp_buf[1] = buf[i+2];
>                         tmp_buf[2] = buf[i+1];
>                         tmp_buf[3] = buf[i+0];
> -                       fprintf(out, "0x%08X, ", *((unsigned long
> *)(&tmp_buf[0])));
> +                       fprintf(out, "0x%08lX, ", *((unsigned long
> *)(&tmp_buf[0])));
>                 }
>          checksum = checksum ^ *((unsigned long *)(&tmp_buf[0]));
>         }
> @@ -58,7 +58,7 @@ void write_rom(FILE *out, FILE *in)
>                 if( size == 0 )
>                 {
>                         if (multiple)
> -                               fprintf(out, "%08X\n", checksum);
> +                               fprintf(out, "%08lX\n", checksum);
>
>                         goto ERR_DONE;
>                 }
> @@ -66,7 +66,7 @@ void write_rom(FILE *out, FILE *in)
>                 {
>                     multiple = 0;
>                         write_file(out, buffer, size, NULL, 1);
> -                       fprintf(out, "%08X\n", checksum);
> +                       fprintf(out, "%08lX\n", checksum);
>                         goto ERR_DONE;
>                 }
>                 else if (size==MAX_READ_SIZE)
> @@ -104,7 +104,7 @@ void write_array(FILE *out, FILE *in, unsigned char
> hif)
>                 {
>                         if (multiple)
>                         {
> -                               fprintf(out, "0x%08X\n", checksum);
> +                               fprintf(out, "0x%08lX\n", checksum);
>                                 file_size += 4;
>                         }
>
> @@ -118,7 +118,7 @@ void write_array(FILE *out, FILE *in, unsigned char
> hif)
>                         multiple = 0;
>
>                         write_file(out, buffer, size, NULL, hif);
> -                       fprintf(out, "0x%08X\n", checksum);
> +                       fprintf(out, "0x%08lX\n", checksum);
>
>                         if( (size%4)!=0 )
>                             file_size += (4-(size%4));
> --
> 1.8.1.2
>
>
> _______________________________________________
> Ath9k_htc_fw mailing list
> Ath9k_htc_fw at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath9k_htc_fw
>



-- 
Best regards,
Eugene
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/ath9k_htc_fw/attachments/20130318/20ee3f53/attachment.html>


More information about the Ath9k_htc_fw mailing list