git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 4, 2017, 09:26 UTC
Message-ID
<alpine.DEB.2.21.1.1705041121520.4905@virtualbox>
In-Reply-To
<252ddd6a-3516-6619-8ea6-d3897f13d93d@ramsayjones.plus.com>
Hi Ramsay,
On Thu, 4 May 2017, Ramsay Jones wrote:
Show 12 quoted lines
> 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 */
Previous: Ramsay JonesNext: Ramsay Jones
Message 2 of 4 in “archive-tar: fix a sparse 'constant too large' warning”
  1. archive-tar: fix a sparse 'constant too large' warningRamsay Jones, May 3, 2017
  2. Johannes SchindelinMay 4, 2017
  3. Ramsay JonesMay 5, 2017
  4. Junio C HamanoMay 8, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.