Re: [PATCH] archive-tar: fix a sparse 'constant too large' warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ramsay,

On Thu, 4 May 2017, Ramsay Jones wrote:

> diff --git a/archive-tar.c b/archive-tar.c
> index 319a5b1c7..6dddc0cff 100644
> --- a/archive-tar.c
> +++ b/archive-tar.c
> @@ -33,7 +33,7 @@ static int write_tar_filter_archive(const struct archiver *ar,
>  #if TIME_MAX == 0xFFFFFFFF
>  #define USTAR_MAX_MTIME TIME_MAX
>  #else
> -#define USTAR_MAX_MTIME 077777777777UL
> +#define USTAR_MAX_MTIME 077777777777ULL
>  #endif
>  

Funny. This problem was pointed out by Hannes Sixt (IIRC) and I fixed this
very thing in v6.

Except I did not. I changed the wrong constant! Instead of
USTAR_MAX_MTIME, I adjusted USTAR_MAX_SIZE. D'oh.

I just saw that my patch series already hit `next`, so I fear you are
right that we need a follow-up patch. Maybe we want this diff, though?

-- snipsnap --
diff --git a/archive-tar.c b/archive-tar.c
index 319a5b1c7cd..073e60ebd3c 100644
--- a/archive-tar.c
+++ b/archive-tar.c
@@ -28,12 +28,12 @@ static int write_tar_filter_archive(const struct archiver *ar,
 #if ULONG_MAX == 0xFFFFFFFF
 #define USTAR_MAX_SIZE ULONG_MAX
 #else
-#define USTAR_MAX_SIZE 077777777777ULL
+#define USTAR_MAX_SIZE 077777777777UL
 #endif
 #if TIME_MAX == 0xFFFFFFFF
 #define USTAR_MAX_MTIME TIME_MAX
 #else
-#define USTAR_MAX_MTIME 077777777777UL
+#define USTAR_MAX_MTIME 077777777777ULL
 #endif
 
 /* writes out the whole block, but only if it is full */




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]