{"thread":{"id":"62292","subject":"[PATCH] mimgw: remove Compiler Warnings","startedAt":"2024-10-09T10:41:02Z","lastAt":"2024-10-17T18:43:53Z","messageCount":16,"participants":["Sören Krecker","Torsten Bögershausen","Phillip Wood","Junio C Hamano","Taylor Blau"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"504536","messageId":"20241009103541.2887-1-soekkle@freenet.de","threadId":"62292","inReplyTo":null,"subject":"[PATCH] mimgw: remove Compiler Warnings","fromName":"Sören Krecker","fromEmail":"soekkle@freenet.de","sentAt":"2024-10-09T10:35:41Z","receivedAt":"2024-10-09T10:41:02Z","isPatch":true,"sender":{"key":"soekkle@freenet.de","avatar":"https://avatars.githubusercontent.com/u/6253399?v=4"},"body":"Remove some complier warnings from msvc in compat/mingw.c for value truncation from 64 bit to 32 bit intigers.\n\nSigned-off-by: Sören Krecker <soekkle@freenet.de>\n---\n compat/compiler.h               |  4 ++--\n compat/mingw.c                  | 26 ++++++++++++++++----------\n compat/vcbuild/include/unistd.h |  7 +++++++\n 3 files changed, 25 insertions(+), 12 deletions(-)\n\ndiff --git a/compat/compiler.h b/compat/compiler.h\nindex e9ad9db84f..e12e426404 100644\n--- a/compat/compiler.h\n+++ b/compat/compiler.h\n@@ -9,7 +9,7 @@\n \n static inline void get_compiler_info(struct strbuf *info)\n {\n-\tint len = info->len;\n+\tsize_t len = info->len;\n #ifdef __clang__\n \tstrbuf_addf(info, \"clang: %s\\n\", __clang_version__);\n #elif defined(__GNUC__)\n@@ -27,7 +27,7 @@ static inline void get_compiler_info(struct strbuf *info)\n \n static inline void get_libc_info(struct strbuf *info)\n {\n-\tint len = info->len;\n+\tsize_t len = info->len;\n \n #ifdef __GLIBC__\n \tstrbuf_addf(info, \"glibc: %s\\n\", gnu_get_libc_version());\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 0e851ecae2..dca0816267 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -782,7 +782,7 @@ static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)\n  */\n static int has_valid_directory_prefix(wchar_t *wfilename)\n {\n-\tint n = wcslen(wfilename);\n+\tssize_t n = wcslen(wfilename);\n \n \twhile (n > 0) {\n \t\twchar_t c = wfilename[--n];\n@@ -891,7 +891,7 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)\n  */\n static int do_stat_internal(int follow, const char *file_name, struct stat *buf)\n {\n-\tint namelen;\n+\tssize_t namelen;\n \tchar alt_name[PATH_MAX];\n \n \tif (!do_lstat(follow, file_name, buf))\n@@ -1274,7 +1274,8 @@ static const char *parse_interpreter(const char *cmd)\n {\n \tstatic char buf[100];\n \tchar *p, *opt;\n-\tint n, fd;\n+\tssize_t n;\n+\tint fd;\n \n \t/* don't even try a .exe */\n \tn = strlen(cmd);\n@@ -1339,7 +1340,7 @@ static char *path_lookup(const char *cmd, int exe_only)\n {\n \tconst char *path;\n \tchar *prog = NULL;\n-\tint len = strlen(cmd);\n+\tsize_t len = strlen(cmd);\n \tint isexe = len >= 4 && !strcasecmp(cmd+len-4, \".exe\");\n \n \tif (strpbrk(cmd, \"/\\\\\"))\n@@ -1956,7 +1957,7 @@ char *mingw_getenv(const char *name)\n #define GETENV_MAX_RETAIN 64\n \tstatic char *values[GETENV_MAX_RETAIN];\n \tstatic int value_counter;\n-\tint len_key, len_value;\n+\tsize_t len_key, len_value;\n \twchar_t *w_key;\n \tchar *value;\n \twchar_t w_value[32768];\n@@ -1968,7 +1969,9 @@ char *mingw_getenv(const char *name)\n \t/* We cannot use xcalloc() here because that uses getenv() itself */\n \tw_key = calloc(len_key, sizeof(wchar_t));\n \tif (!w_key)\n-\t\tdie(\"Out of memory, (tried to allocate %u wchar_t's)\", len_key);\n+\t\tdie(\"Out of memory, (tried to allocate %\"\n+\t\t\t    PRIuMAX\" wchar_t's)\",\n+\t\t    (uintmax_t)len_key);\n \txutftowcs(w_key, name, len_key);\n \t/* GetEnvironmentVariableW() only sets the last error upon failure */\n \tSetLastError(ERROR_SUCCESS);\n@@ -1983,7 +1986,8 @@ char *mingw_getenv(const char *name)\n \t/* We cannot use xcalloc() here because that uses getenv() itself */\n \tvalue = calloc(len_value, sizeof(char));\n \tif (!value)\n-\t\tdie(\"Out of memory, (tried to allocate %u bytes)\", len_value);\n+\t    die(\"Out of memory, (tried to allocate %\" PRIuMAX \" bytes)\",\n+\t    (uintmax_t)len_value);\n \txwcstoutf(value, w_value, len_value);\n \n \t/*\n@@ -2001,7 +2005,7 @@ char *mingw_getenv(const char *name)\n \n int mingw_putenv(const char *namevalue)\n {\n-\tint size;\n+\tsize_t size;\n \twchar_t *wide, *equal;\n \tBOOL result;\n \n@@ -2011,7 +2015,8 @@ int mingw_putenv(const char *namevalue)\n \tsize = strlen(namevalue) * 2 + 1;\n \twide = calloc(size, sizeof(wchar_t));\n \tif (!wide)\n-\t\tdie(\"Out of memory, (tried to allocate %u wchar_t's)\", size);\n+\t\tdie(\"Out of memory, (tried to allocate %\" PRIuMAX \" wchar_t's)\",\n+\t\t    (uintmax_t)size);\n \txutftowcs(wide, namevalue, size);\n \tequal = wcschr(wide, L'=');\n \tif (!equal)\n@@ -3085,7 +3090,8 @@ static void maybe_redirect_std_handles(void)\n  */\n int wmain(int argc, const wchar_t **wargv)\n {\n-\tint i, maxlen, exit_status;\n+\tint exit_status;\n+\tsize_t i, maxlen;\n \tchar *buffer, **save;\n \tconst char **argv;\n \ndiff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h\nindex 3a959d124c..ab3dc06709 100644\n--- a/compat/vcbuild/include/unistd.h\n+++ b/compat/vcbuild/include/unistd.h\n@@ -13,8 +13,15 @@ typedef _mode_t\tmode_t;\n #endif\t/* Not _MODE_T_ */\n \n #ifndef _SSIZE_T_\n+#ifdef _WIN64\n #define _SSIZE_T_\n+typedef __int64 _ssize_t;\n+#pragma message(\"Compiling on Win64\")\n+#else\n typedef long _ssize_t;\n+#endif // _AMD64\n+\n+\n \n #ifndef\t_OFF_T_\n #define\t_OFF_T_\n\nbase-commit: 777489f9e09c8d0dd6b12f9d90de6376330577a2\n-- \n2.39.5\n\n"},{"id":"504596","messageId":"20241009152628.GA16993@tb-raspi4","threadId":"62292","inReplyTo":"20241009103541.2887-1-soekkle@freenet.de","subject":"Re: [PATCH] mimgw: remove Compiler Warnings","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2024-10-09T15:26:28Z","receivedAt":"2024-10-09T15:26:37Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On Wed, Oct 09, 2024 at 12:35:41PM +0200, Sören Krecker wrote:\n\nThanks for the patch. All looks sensible - 2 comments inline.\n\n> Remove some complier warnings from msvc in compat/mingw.c for value truncation from 64 bit to 32 bit intigers.\nsmall typo: compiler\n>\n> Signed-off-by: Sören Krecker <soekkle@freenet.de>\n> ---\n>  compat/compiler.h               |  4 ++--\n>  compat/mingw.c                  | 26 ++++++++++++++++----------\n>  compat/vcbuild/include/unistd.h |  7 +++++++\n>  3 files changed, 25 insertions(+), 12 deletions(-)\n>\n> diff --git a/compat/compiler.h b/compat/compiler.h\n> index e9ad9db84f..e12e426404 100644\n> --- a/compat/compiler.h\n> +++ b/compat/compiler.h\n> @@ -9,7 +9,7 @@\n>\n>  static inline void get_compiler_info(struct strbuf *info)\n>  {\n> -\tint len = info->len;\n> +\tsize_t len = info->len;\n>  #ifdef __clang__\n>  \tstrbuf_addf(info, \"clang: %s\\n\", __clang_version__);\n>  #elif defined(__GNUC__)\n> @@ -27,7 +27,7 @@ static inline void get_compiler_info(struct strbuf *info)\n>\n>  static inline void get_libc_info(struct strbuf *info)\n>  {\n> -\tint len = info->len;\n> +\tsize_t len = info->len;\n>\n>  #ifdef __GLIBC__\n>  \tstrbuf_addf(info, \"glibc: %s\\n\", gnu_get_libc_version());\n> diff --git a/compat/mingw.c b/compat/mingw.c\n> index 0e851ecae2..dca0816267 100644\n> --- a/compat/mingw.c\n> +++ b/compat/mingw.c\n> @@ -782,7 +782,7 @@ static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)\n>   */\n>  static int has_valid_directory_prefix(wchar_t *wfilename)\n>  {\n> -\tint n = wcslen(wfilename);\n> +\tssize_t n = wcslen(wfilename);\n>\n>  \twhile (n > 0) {\n>  \t\twchar_t c = wfilename[--n];\n> @@ -891,7 +891,7 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)\n>   */\n>  static int do_stat_internal(int follow, const char *file_name, struct stat *buf)\n>  {\n> -\tint namelen;\n> +\tssize_t namelen;\n>  \tchar alt_name[PATH_MAX];\n>\n>  \tif (!do_lstat(follow, file_name, buf))\n> @@ -1274,7 +1274,8 @@ static const char *parse_interpreter(const char *cmd)\n>  {\n>  \tstatic char buf[100];\n>  \tchar *p, *opt;\n> -\tint n, fd;\n> +\tssize_t n;\n> +\tint fd;\n>\n>  \t/* don't even try a .exe */\n>  \tn = strlen(cmd);\n> @@ -1339,7 +1340,7 @@ static char *path_lookup(const char *cmd, int exe_only)\n>  {\n>  \tconst char *path;\n>  \tchar *prog = NULL;\n> -\tint len = strlen(cmd);\n> +\tsize_t len = strlen(cmd);\n>  \tint isexe = len >= 4 && !strcasecmp(cmd+len-4, \".exe\");\n>\n>  \tif (strpbrk(cmd, \"/\\\\\"))\n> @@ -1956,7 +1957,7 @@ char *mingw_getenv(const char *name)\n>  #define GETENV_MAX_RETAIN 64\n>  \tstatic char *values[GETENV_MAX_RETAIN];\n>  \tstatic int value_counter;\n> -\tint len_key, len_value;\n> +\tsize_t len_key, len_value;\n>  \twchar_t *w_key;\n>  \tchar *value;\n>  \twchar_t w_value[32768];\n> @@ -1968,7 +1969,9 @@ char *mingw_getenv(const char *name)\n>  \t/* We cannot use xcalloc() here because that uses getenv() itself */\n>  \tw_key = calloc(len_key, sizeof(wchar_t));\n>  \tif (!w_key)\n> -\t\tdie(\"Out of memory, (tried to allocate %u wchar_t's)\", len_key);\n> +\t\tdie(\"Out of memory, (tried to allocate %\"\n\nIs there a reason to split the line like this ?\n\n> +\t\t\t    PRIuMAX\" wchar_t's)\",\n> +\t\t    (uintmax_t)len_key);\n>  \txutftowcs(w_key, name, len_key);\n>  \t/* GetEnvironmentVariableW() only sets the last error upon failure */\n>  \tSetLastError(ERROR_SUCCESS);\n> @@ -1983,7 +1986,8 @@ char *mingw_getenv(const char *name)\n>  \t/* We cannot use xcalloc() here because that uses getenv() itself */\n>  \tvalue = calloc(len_value, sizeof(char));\n>  \tif (!value)\n> -\t\tdie(\"Out of memory, (tried to allocate %u bytes)\", len_value);\n> +\t    die(\"Out of memory, (tried to allocate %\" PRIuMAX \" bytes)\",\n> +\t    (uintmax_t)len_value);\n\nIndentation should be a TAB, not 4 spaces. And why this line-split ?\n\n>  \txwcstoutf(value, w_value, len_value);\n>\n>  \t/*\n> @@ -2001,7 +2005,7 @@ char *mingw_getenv(const char *name)\n>\n>  int mingw_putenv(const char *namevalue)\n>  {\n> -\tint size;\n> +\tsize_t size;\n>  \twchar_t *wide, *equal;\n>  \tBOOL result;\n>\n> @@ -2011,7 +2015,8 @@ int mingw_putenv(const char *namevalue)\n>  \tsize = strlen(namevalue) * 2 + 1;\n>  \twide = calloc(size, sizeof(wchar_t));\n>  \tif (!wide)\n> -\t\tdie(\"Out of memory, (tried to allocate %u wchar_t's)\", size);\n> +\t\tdie(\"Out of memory, (tried to allocate %\" PRIuMAX \" wchar_t's)\",\n> +\t\t    (uintmax_t)size);\n>  \txutftowcs(wide, namevalue, size);\n>  \tequal = wcschr(wide, L'=');\n>  \tif (!equal)\n> @@ -3085,7 +3090,8 @@ static void maybe_redirect_std_handles(void)\n>   */\n>  int wmain(int argc, const wchar_t **wargv)\n>  {\n> -\tint i, maxlen, exit_status;\n> +\tint exit_status;\n> +\tsize_t i, maxlen;\n>  \tchar *buffer, **save;\n>  \tconst char **argv;\n>\n> diff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h\n> index 3a959d124c..ab3dc06709 100644\n> --- a/compat/vcbuild/include/unistd.h\n> +++ b/compat/vcbuild/include/unistd.h\n> @@ -13,8 +13,15 @@ typedef _mode_t\tmode_t;\n>  #endif\t/* Not _MODE_T_ */\n\n\n>\n>  #ifndef _SSIZE_T_\n> +#ifdef _WIN64\n>  #define _SSIZE_T_\n> +typedef __int64 _ssize_t;\n> +#pragma message(\"Compiling on Win64\")\n> +#else\n>  typedef long _ssize_t;\n> +#endif // _AMD64\n\nIs this needed, or is it a rest from a trial to use _ssize_t instead of ssize_t ?\n\n> +\n> +\n>\n>  #ifndef\t_OFF_T_\n>  #define\t_OFF_T_\n>\n> base-commit: 777489f9e09c8d0dd6b12f9d90de6376330577a2\n> --\n> 2.39.5\n>\n>\n"},{"id":"504600","messageId":"4530b7cc-3f91-4009-977e-97519a5a9f85@gmail.com","threadId":"62292","inReplyTo":"20241009103541.2887-1-soekkle@freenet.de","subject":"Re: [PATCH] mimgw: remove Compiler Warnings","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2024-10-09T16:13:33Z","receivedAt":"2024-10-09T16:13:36Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Sören\n\nOn 09/10/2024 11:35, Sören Krecker wrote:\n> Remove some complier warnings from msvc in compat/mingw.c for value truncation from 64 bit to 32 bit intigers.\n\nThanks for working on this, it is a useful improvement. It would be \nhelpful to explain the choice of signed/unsigned type in each case to \nhelp reviewers check that the conversion is correct. I've looked through \nthe code and there are a couple I'm not sure about. I'd also echo \nTorsten's code formatting comments.\n\n> Signed-off-by: Sören Krecker <soekkle@freenet.de>\n> ---\n>   compat/compiler.h               |  4 ++--\n>   compat/mingw.c                  | 26 ++++++++++++++++----------\n>   compat/vcbuild/include/unistd.h |  7 +++++++\n>   3 files changed, 25 insertions(+), 12 deletions(-)\n> \n> diff --git a/compat/compiler.h b/compat/compiler.h\n> index e9ad9db84f..e12e426404 100644\n> --- a/compat/compiler.h\n> +++ b/compat/compiler.h\n> @@ -9,7 +9,7 @@\n>   \n>   static inline void get_compiler_info(struct strbuf *info)\n>   {\n> -\tint len = info->len;\n> +\tsize_t len = info->len;\n>   #ifdef __clang__\n>   \tstrbuf_addf(info, \"clang: %s\\n\", __clang_version__);\n>   #elif defined(__GNUC__)\n> @@ -27,7 +27,7 @@ static inline void get_compiler_info(struct strbuf *info)\n>   \n>   static inline void get_libc_info(struct strbuf *info)\n>   {\n> -\tint len = info->len;\n> +\tsize_t len = info->len;\n>   \n>   #ifdef __GLIBC__\n>   \tstrbuf_addf(info, \"glibc: %s\\n\", gnu_get_libc_version());\n\nThese two look straight forward - we save info->len at the start of the \nfunction and see if it has changed at the end.\n\n> diff --git a/compat/mingw.c b/compat/mingw.c\n> index 0e851ecae2..dca0816267 100644\n> --- a/compat/mingw.c\n> +++ b/compat/mingw.c\n> @@ -782,7 +782,7 @@ static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)\n>    */\n>   static int has_valid_directory_prefix(wchar_t *wfilename)\n>   {\n> -\tint n = wcslen(wfilename);\n> +\tssize_t n = wcslen(wfilename);\n\nThis is ssize_t because n maybe negative as seen in the context below - good\n\n>   \n>   \twhile (n > 0) {\n>   \t\twchar_t c = wfilename[--n];\n> @@ -891,7 +891,7 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)\n>    */\n>   static int do_stat_internal(int follow, const char *file_name, struct stat *buf)\n>   {\n> -\tint namelen;\n> +\tssize_t namelen;\n\nLooking at this function I can't see why this is ssize_t rather than size_t\n\n> @@ -1274,7 +1274,8 @@ static const char *parse_interpreter(const char *cmd)\n>   {\n>   \tstatic char buf[100];\n>   \tchar *p, *opt;\n> -\tint n, fd;\n> +\tssize_t n;\n\nThis is ssize_t because we assign the return value of read() to n which \nmaybe negative - good\n\n> @@ -1339,7 +1340,7 @@ static char *path_lookup(const char *cmd, int exe_only)\n>   {\n>   \tconst char *path;\n>   \tchar *prog = NULL;\n> -\tint len = strlen(cmd);\n> +\tsize_t len = strlen(cmd);\n\nThis looks good we're holding the length of a string\n\n>   \tint isexe = len >= 4 && !strcasecmp(cmd+len-4, \".exe\");\n>   \n>   \tif (strpbrk(cmd, \"/\\\\\"))\n> @@ -1956,7 +1957,7 @@ char *mingw_getenv(const char *name)\n>   #define GETENV_MAX_RETAIN 64\n>   \tstatic char *values[GETENV_MAX_RETAIN];\n>   \tstatic int value_counter;\n> -\tint len_key, len_value;\n> +\tsize_t len_key, len_value;\n\nThis looks good too, they're holding the length of a string\n\n> @@ -2001,7 +2005,7 @@ char *mingw_getenv(const char *name)\n>   \n>   int mingw_putenv(const char *namevalue)\n>   {\n> -\tint size;\n> +\tsize_t size;\n\nThis looks correct - another string length\n\n> @@ -3085,7 +3090,8 @@ static void maybe_redirect_std_handles(void)\n>    */\n>   int wmain(int argc, const wchar_t **wargv)\n>   {\n> -\tint i, maxlen, exit_status;\n> +\tint exit_status;\n> +\tsize_t i, maxlen;\n\n\"i\" loops over 0..argc so I think we want to keep it as an int. maxlen \nis a string length so should be size_t.\n\nBest Wishes\n\nPhillip\n\n>   \tchar *buffer, **save;\n>   \tconst char **argv;\n>   \n> diff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h\n> index 3a959d124c..ab3dc06709 100644\n> --- a/compat/vcbuild/include/unistd.h\n> +++ b/compat/vcbuild/include/unistd.h\n> @@ -13,8 +13,15 @@ typedef _mode_t\tmode_t;\n>   #endif\t/* Not _MODE_T_ */\n>   \n>   #ifndef _SSIZE_T_\n> +#ifdef _WIN64\n>   #define _SSIZE_T_\n> +typedef __int64 _ssize_t;\n> +#pragma message(\"Compiling on Win64\")\n> +#else\n>   typedef long _ssize_t;\n> +#endif // _AMD64\n> +\n> +\n>   \n>   #ifndef\t_OFF_T_\n>   #define\t_OFF_T_\n> \n> base-commit: 777489f9e09c8d0dd6b12f9d90de6376330577a2\n\n"},{"id":"504607","messageId":"20241009171342.2354-1-soekkle@freenet.de","threadId":"62292","inReplyTo":"4530b7cc-3f91-4009-977e-97519a5a9f85@gmail.com","subject":"[PATCH] mimgw: remove Compiler Warnings","fromName":"Sören Krecker","fromEmail":"soekkle@freenet.de","sentAt":"2024-10-09T17:13:41Z","receivedAt":"2024-10-09T17:13:52Z","isPatch":true,"sender":{"key":"soekkle@freenet.de","avatar":"https://avatars.githubusercontent.com/u/6253399?v=4"},"body":"Hi Torsten, Hi Phillip,\n\nI have tried to implement your comments. I add som comments after the verable to explain what there contains.\nI try to do less a possiable changes, the _ssize_t was there before and I change the type on win 64.\n\nBest regards,\n\nSören Krecker\n\nSören Krecker (1):\n  mimgw: remove Compiler Warnings\n\n compat/compiler.h               |  4 ++--\n compat/mingw.c                  | 25 +++++++++++++++----------\n compat/vcbuild/include/unistd.h |  4 ++++\n 3 files changed, 21 insertions(+), 12 deletions(-)\n\n\nbase-commit: 777489f9e09c8d0dd6b12f9d90de6376330577a2\n-- \n2.39.5\n\n"},{"id":"504608","messageId":"20241009171342.2354-2-soekkle@freenet.de","threadId":"62292","inReplyTo":"20241009171342.2354-1-soekkle@freenet.de","subject":"[PATCH v2 1/1] [PATCH] mimgw: remove Compiler Warnings","fromName":"Sören Krecker","fromEmail":"soekkle@freenet.de","sentAt":"2024-10-09T17:13:42Z","receivedAt":"2024-10-09T17:13:54Z","isPatch":true,"sender":{"key":"soekkle@freenet.de","avatar":"https://avatars.githubusercontent.com/u/6253399?v=4"},"body":"Remove some compiler warnings from msvc in compat/mingw.c for value truncation from 64 bit to 32 bit intigers.\n\nSigned-off-by: Sören Krecker <soekkle@freenet.de>\n---\n compat/compiler.h               |  4 ++--\n compat/mingw.c                  | 25 +++++++++++++++----------\n compat/vcbuild/include/unistd.h |  4 ++++\n 3 files changed, 21 insertions(+), 12 deletions(-)\n\ndiff --git a/compat/compiler.h b/compat/compiler.h\nindex e9ad9db84f..e12e426404 100644\n--- a/compat/compiler.h\n+++ b/compat/compiler.h\n@@ -9,7 +9,7 @@\n \n static inline void get_compiler_info(struct strbuf *info)\n {\n-\tint len = info->len;\n+\tsize_t len = info->len;\n #ifdef __clang__\n \tstrbuf_addf(info, \"clang: %s\\n\", __clang_version__);\n #elif defined(__GNUC__)\n@@ -27,7 +27,7 @@ static inline void get_compiler_info(struct strbuf *info)\n \n static inline void get_libc_info(struct strbuf *info)\n {\n-\tint len = info->len;\n+\tsize_t len = info->len;\n \n #ifdef __GLIBC__\n \tstrbuf_addf(info, \"glibc: %s\\n\", gnu_get_libc_version());\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 0e851ecae2..5293f4cdae 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -782,7 +782,7 @@ static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)\n  */\n static int has_valid_directory_prefix(wchar_t *wfilename)\n {\n-\tint n = wcslen(wfilename);\n+\tssize_t n = wcslen(wfilename); /*can become negative*/\n \n \twhile (n > 0) {\n \t\twchar_t c = wfilename[--n];\n@@ -891,7 +891,7 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)\n  */\n static int do_stat_internal(int follow, const char *file_name, struct stat *buf)\n {\n-\tint namelen;\n+\tsize_t namelen; /* contains length of a string*/\n \tchar alt_name[PATH_MAX];\n \n \tif (!do_lstat(follow, file_name, buf))\n@@ -1274,7 +1274,8 @@ static const char *parse_interpreter(const char *cmd)\n {\n \tstatic char buf[100];\n \tchar *p, *opt;\n-\tint n, fd;\n+\tssize_t n; /* read() can return negativ values */\n+\tint fd;\n \n \t/* don't even try a .exe */\n \tn = strlen(cmd);\n@@ -1339,7 +1340,7 @@ static char *path_lookup(const char *cmd, int exe_only)\n {\n \tconst char *path;\n \tchar *prog = NULL;\n-\tint len = strlen(cmd);\n+\tsize_t len = strlen(cmd);\n \tint isexe = len >= 4 && !strcasecmp(cmd+len-4, \".exe\");\n \n \tif (strpbrk(cmd, \"/\\\\\"))\n@@ -1956,7 +1957,7 @@ char *mingw_getenv(const char *name)\n #define GETENV_MAX_RETAIN 64\n \tstatic char *values[GETENV_MAX_RETAIN];\n \tstatic int value_counter;\n-\tint len_key, len_value;\n+\tsize_t len_key, len_value; /* lengt of strings */\n \twchar_t *w_key;\n \tchar *value;\n \twchar_t w_value[32768];\n@@ -1968,7 +1969,8 @@ char *mingw_getenv(const char *name)\n \t/* We cannot use xcalloc() here because that uses getenv() itself */\n \tw_key = calloc(len_key, sizeof(wchar_t));\n \tif (!w_key)\n-\t\tdie(\"Out of memory, (tried to allocate %u wchar_t's)\", len_key);\n+\t\tdie(\"Out of memory, (tried to allocate %\"PRIuMAX\" wchar_t's)\",\n+\t\t\t(uintmax_t)len_key);\n \txutftowcs(w_key, name, len_key);\n \t/* GetEnvironmentVariableW() only sets the last error upon failure */\n \tSetLastError(ERROR_SUCCESS);\n@@ -1983,7 +1985,8 @@ char *mingw_getenv(const char *name)\n \t/* We cannot use xcalloc() here because that uses getenv() itself */\n \tvalue = calloc(len_value, sizeof(char));\n \tif (!value)\n-\t\tdie(\"Out of memory, (tried to allocate %u bytes)\", len_value);\n+\t\tdie(\"Out of memory, (tried to allocate %\"PRIuMAX\" bytes)\",\n+\t\t\t(uintmax_t)len_value);\n \txwcstoutf(value, w_value, len_value);\n \n \t/*\n@@ -2001,7 +2004,7 @@ char *mingw_getenv(const char *name)\n \n int mingw_putenv(const char *namevalue)\n {\n-\tint size;\n+\tsize_t size; /* lengt of a string */\n \twchar_t *wide, *equal;\n \tBOOL result;\n \n@@ -2011,7 +2014,8 @@ int mingw_putenv(const char *namevalue)\n \tsize = strlen(namevalue) * 2 + 1;\n \twide = calloc(size, sizeof(wchar_t));\n \tif (!wide)\n-\t\tdie(\"Out of memory, (tried to allocate %u wchar_t's)\", size);\n+\t\tdie(\"Out of memory, (tried to allocate %\" PRIuMAX \" wchar_t's)\",\n+\t\t    (uintmax_t)size);\n \txutftowcs(wide, namevalue, size);\n \tequal = wcschr(wide, L'=');\n \tif (!equal)\n@@ -3085,7 +3089,8 @@ static void maybe_redirect_std_handles(void)\n  */\n int wmain(int argc, const wchar_t **wargv)\n {\n-\tint i, maxlen, exit_status;\n+\tint i, exit_status;\n+\tsize_t maxlen; /*contains length os arguments*/\n \tchar *buffer, **save;\n \tconst char **argv;\n \ndiff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h\nindex 3a959d124c..1c0096ab21 100644\n--- a/compat/vcbuild/include/unistd.h\n+++ b/compat/vcbuild/include/unistd.h\n@@ -14,7 +14,11 @@ typedef _mode_t\tmode_t;\n \n #ifndef _SSIZE_T_\n #define _SSIZE_T_\n+#ifdef _WIN64\n+typedef __int64 _ssize_t;\n+#else\n typedef long _ssize_t;\n+#endif // _AMD64\n \n #ifndef\t_OFF_T_\n #define\t_OFF_T_\n-- \n2.39.5\n\n"},{"id":"504620","messageId":"xmqq4j5lt9xe.fsf@gitster.g","threadId":"62292","inReplyTo":"20241009171342.2354-2-soekkle@freenet.de","subject":"Re: [PATCH v2 1/1] [PATCH] mimgw: remove Compiler Warnings","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-10-09T18:20:45Z","receivedAt":"2024-10-09T18:20:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sören Krecker <soekkle@freenet.de> writes:\n\n> Remove some compiler warnings from msvc in compat/mingw.c for value truncation from 64 bit to 32 bit intigers.\n\nAn overly long line?\n\n> diff --git a/compat/mingw.c b/compat/mingw.c\n> index 0e851ecae2..5293f4cdae 100644\n> --- a/compat/mingw.c\n> +++ b/compat/mingw.c\n> @@ -782,7 +782,7 @@ static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)\n>   */\n>  static int has_valid_directory_prefix(wchar_t *wfilename)\n>  {\n> -\tint n = wcslen(wfilename);\n> +\tssize_t n = wcslen(wfilename); /*can become negative*/\n\nAside from the malformed comment (\"/* can become negative */\" with\nspaces would have been OK), I am not sure where it can become\nnegative, unless wcslen() is allowed to return a negative value to\nsignal some kind of error (in which case, the comment should say\nthat), which is not the case.\n\nThe loop body in the post-context of this hunk looks like\n\n>  \twhile (n > 0) {\n>  \t\twchar_t c = wfilename[--n];\n\t\t... 'n' is not written anywhere else in this loop ...\n\t}\n\nso an 'n' that is not negative before entering the loop can never\nbecome negative by what the loop body does.\n\n> @@ -891,7 +891,7 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)\n>   */\n>  static int do_stat_internal(int follow, const char *file_name, struct stat *buf)\n>  {\n> -\tint namelen;\n> +\tsize_t namelen; /* contains length of a string*/\n\nIndeed, this receives the return value of strlen().  I am not sure\nif this comment is necessary, though.  Just like you omitted any\ncomment on size_t variables that receives .len in a strbuf, its\ncorrectness is rather obvious.\n\n> @@ -1274,7 +1274,8 @@ static const char *parse_interpreter(const char *cmd)\n>  {\n>  \tstatic char buf[100];\n>  \tchar *p, *opt;\n> -\tint n, fd;\n> +\tssize_t n; /* read() can return negativ values */\n\nThe word is \"negative\".\n\nBut 'n' is also used to receive the result of strlen().  A kosher\nrewrite may be to split it into two separate variables, \n\n\tsize_t cmdlen = strlen(cmd);\n\tssize_t bytes_read = read(fd, buf, sizeof(buf)-1);\n\n> @@ -1956,7 +1957,7 @@ char *mingw_getenv(const char *name)\n>  #define GETENV_MAX_RETAIN 64\n>  \tstatic char *values[GETENV_MAX_RETAIN];\n>  \tstatic int value_counter;\n> -\tint len_key, len_value;\n> +\tsize_t len_key, len_value; /* lengt of strings */\n\n\"length\".\n\nAgain given \"size_t strlen(const char *)\", this may be sufficiently\nobvious.\n\n> @@ -2001,7 +2004,7 @@ char *mingw_getenv(const char *name)\n>  \n>  int mingw_putenv(const char *namevalue)\n>  {\n> -\tint size;\n> +\tsize_t size; /* lengt of a string */\n\nDitto.\n\n> @@ -3085,7 +3089,8 @@ static void maybe_redirect_std_handles(void)\n>   */\n>  int wmain(int argc, const wchar_t **wargv)\n>  {\n> -\tint i, maxlen, exit_status;\n> +\tint i, exit_status;\n> +\tsize_t maxlen; /*contains length os arguments*/\n\nMissing SP around the words.\n\nAgain, given \"size_t wcslen(const wchar_t *)\", it may be obvious to\nreaders.\n\n> diff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h\n> ...\n> +#ifdef _WIN64\n> +typedef __int64 _ssize_t;\n> +#else\n>  typedef long _ssize_t;\n> +#endif // _AMD64\n\nIt is a bit unusual that \"#ifdef X\" is not closed with \"#endif /* X */\".\nSome folks write \"#endif /* !X */\" but what I am wondering about is\na mismatch between _WIN64 and _AMD64.\n\n\n"},{"id":"504684","messageId":"e7646092-84e0-4210-88e9-98352e1f60e0@gmail.com","threadId":"62292","inReplyTo":"20241009171342.2354-2-soekkle@freenet.de","subject":"Re: [PATCH v2 1/1] [PATCH] mimgw: remove Compiler Warnings","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2024-10-10T08:59:18Z","receivedAt":"2024-10-10T08:59:21Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Sören\n\nOn 09/10/2024 18:13, Sören Krecker wrote:\n> Remove some compiler warnings from msvc in compat/mingw.c for value truncation from 64 bit to 32 bit intigers.\n\nThanks for re-rolling, I think \"Fix some compiler warnings\" would be \nclearer than \"Remove\", also \"integers\" is misspelt. As Junio said we \nfold our commit messages at 72 characters. When I said it would be \nhelpful to explain the choice of signed/unsigned I meant an explanation \nin the commit message, not code comments. I agree with Junio that the \nremaining ssize_t should be a size_t so the commit message could say \nsomething like\n\n     Use size_t instead of int as all of the changed variables hold the\n     result of strlen() or wcslen() which cannot be negative.\n\nIt would also be helpful to explain in the commit message the changes to \n_ssize_t\n\n> +#ifdef _WIN64\n> +typedef __int64 _ssize_t;\n> +#else\n>   typedef long _ssize_t;\n> +#endif // _AMD64\n\nPlease note that we do not use \"//\" comments so this should be \"/* \n_WIN64 */\" so that the comment matches the opening #ifdef\n\nThanks for working on this\n\nPhillip\n\n"},{"id":"504687","messageId":"20241010102950.2151-1-soekkle@freenet.de","threadId":"62292","inReplyTo":"e7646092-84e0-4210-88e9-98352e1f60e0@gmail.com","subject":"[PATCH] [PATCH] mimgw: Remove Compiler Warnings","fromName":"Sören Krecker","fromEmail":"soekkle@freenet.de","sentAt":"2024-10-10T10:29:50Z","receivedAt":"2024-10-10T10:35:09Z","isPatch":true,"sender":{"key":"soekkle@freenet.de","avatar":"https://avatars.githubusercontent.com/u/6253399?v=4"},"body":"Remove some complier warnings from msvc in compat/mingw.c for value truncation from 64 bit to 32 bit integers.\n\nUse size_t instead of int as all of the changed variables hold the result of strlen() or wcslen() which cannot be negative.\nand set the size of ssize_t to 64 bit on windwos 64 bit.\n\nSigned-off-by: Sören Krecker <soekkle@freenet.de>\n---\n compat/compiler.h               |  4 ++--\n compat/mingw.c                  | 25 +++++++++++++++----------\n compat/vcbuild/include/unistd.h |  4 ++++\n 3 files changed, 21 insertions(+), 12 deletions(-)\n\ndiff --git a/compat/compiler.h b/compat/compiler.h\nindex e9ad9db84f..e12e426404 100644\n--- a/compat/compiler.h\n+++ b/compat/compiler.h\n@@ -9,7 +9,7 @@\n \n static inline void get_compiler_info(struct strbuf *info)\n {\n-\tint len = info->len;\n+\tsize_t len = info->len;\n #ifdef __clang__\n \tstrbuf_addf(info, \"clang: %s\\n\", __clang_version__);\n #elif defined(__GNUC__)\n@@ -27,7 +27,7 @@ static inline void get_compiler_info(struct strbuf *info)\n \n static inline void get_libc_info(struct strbuf *info)\n {\n-\tint len = info->len;\n+\tsize_t len = info->len;\n \n #ifdef __GLIBC__\n \tstrbuf_addf(info, \"glibc: %s\\n\", gnu_get_libc_version());\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 0e851ecae2..0ff550cef3 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -782,7 +782,7 @@ static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)\n  */\n static int has_valid_directory_prefix(wchar_t *wfilename)\n {\n-\tint n = wcslen(wfilename);\n+\tsize_t n = wcslen(wfilename);\n \n \twhile (n > 0) {\n \t\twchar_t c = wfilename[--n];\n@@ -891,7 +891,7 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)\n  */\n static int do_stat_internal(int follow, const char *file_name, struct stat *buf)\n {\n-\tint namelen;\n+\tsize_t namelen;\n \tchar alt_name[PATH_MAX];\n \n \tif (!do_lstat(follow, file_name, buf))\n@@ -1274,7 +1274,8 @@ static const char *parse_interpreter(const char *cmd)\n {\n \tstatic char buf[100];\n \tchar *p, *opt;\n-\tint n, fd;\n+\tssize_t n; /* read() can return negative values */\n+\tint fd;\n \n \t/* don't even try a .exe */\n \tn = strlen(cmd);\n@@ -1339,7 +1340,7 @@ static char *path_lookup(const char *cmd, int exe_only)\n {\n \tconst char *path;\n \tchar *prog = NULL;\n-\tint len = strlen(cmd);\n+\tsize_t len = strlen(cmd);\n \tint isexe = len >= 4 && !strcasecmp(cmd+len-4, \".exe\");\n \n \tif (strpbrk(cmd, \"/\\\\\"))\n@@ -1956,7 +1957,7 @@ char *mingw_getenv(const char *name)\n #define GETENV_MAX_RETAIN 64\n \tstatic char *values[GETENV_MAX_RETAIN];\n \tstatic int value_counter;\n-\tint len_key, len_value;\n+\tsize_t len_key, len_value;\n \twchar_t *w_key;\n \tchar *value;\n \twchar_t w_value[32768];\n@@ -1968,7 +1969,8 @@ char *mingw_getenv(const char *name)\n \t/* We cannot use xcalloc() here because that uses getenv() itself */\n \tw_key = calloc(len_key, sizeof(wchar_t));\n \tif (!w_key)\n-\t\tdie(\"Out of memory, (tried to allocate %u wchar_t's)\", len_key);\n+\t\tdie(\"Out of memory, (tried to allocate %\"PRIuMAX\" wchar_t's)\",\n+\t\t\t(uintmax_t)len_key);\n \txutftowcs(w_key, name, len_key);\n \t/* GetEnvironmentVariableW() only sets the last error upon failure */\n \tSetLastError(ERROR_SUCCESS);\n@@ -1983,7 +1985,8 @@ char *mingw_getenv(const char *name)\n \t/* We cannot use xcalloc() here because that uses getenv() itself */\n \tvalue = calloc(len_value, sizeof(char));\n \tif (!value)\n-\t\tdie(\"Out of memory, (tried to allocate %u bytes)\", len_value);\n+\t\tdie(\"Out of memory, (tried to allocate %\"PRIuMAX\" bytes)\",\n+\t\t\t(uintmax_t)len_value);\n \txwcstoutf(value, w_value, len_value);\n \n \t/*\n@@ -2001,7 +2004,7 @@ char *mingw_getenv(const char *name)\n \n int mingw_putenv(const char *namevalue)\n {\n-\tint size;\n+\tsize_t size;\n \twchar_t *wide, *equal;\n \tBOOL result;\n \n@@ -2011,7 +2014,8 @@ int mingw_putenv(const char *namevalue)\n \tsize = strlen(namevalue) * 2 + 1;\n \twide = calloc(size, sizeof(wchar_t));\n \tif (!wide)\n-\t\tdie(\"Out of memory, (tried to allocate %u wchar_t's)\", size);\n+\t\tdie(\"Out of memory, (tried to allocate %\" PRIuMAX \" wchar_t's)\",\n+\t\t    (uintmax_t)size);\n \txutftowcs(wide, namevalue, size);\n \tequal = wcschr(wide, L'=');\n \tif (!equal)\n@@ -3085,7 +3089,8 @@ static void maybe_redirect_std_handles(void)\n  */\n int wmain(int argc, const wchar_t **wargv)\n {\n-\tint i, maxlen, exit_status;\n+\tint i, exit_status;\n+\tsize_t maxlen;\n \tchar *buffer, **save;\n \tconst char **argv;\n \ndiff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h\nindex 3a959d124c..a261a925b7 100644\n--- a/compat/vcbuild/include/unistd.h\n+++ b/compat/vcbuild/include/unistd.h\n@@ -14,7 +14,11 @@ typedef _mode_t\tmode_t;\n \n #ifndef _SSIZE_T_\n #define _SSIZE_T_\n+#ifdef _WIN64\n+typedef __int64 _ssize_t;\n+#else\n typedef long _ssize_t;\n+#endif /* _WIN64 */\n \n #ifndef\t_OFF_T_\n #define\t_OFF_T_\n\nbase-commit: 777489f9e09c8d0dd6b12f9d90de6376330577a2\n-- \n2.39.5\n\n"},{"id":"504711","messageId":"xmqqldywlz3a.fsf@gitster.g","threadId":"62292","inReplyTo":"e7646092-84e0-4210-88e9-98352e1f60e0@gmail.com","subject":"Re: [PATCH v2 1/1] [PATCH] mimgw: remove Compiler Warnings","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-10-10T16:08:57Z","receivedAt":"2024-10-10T16:09:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phillip Wood <phillip.wood123@gmail.com> writes:\n\n> Thanks for re-rolling, I think \"Fix some compiler warnings\" would be\n> clearer than \"Remove\", also \"integers\" is misspelt.\n\nThough \"Fix\" is a word with less information than other words we\ncould use.  The changes in the patch are primarily about mismatched\ntype, so perhaps\n\n    mingw: use size_t insead of int for lengths\n      \nwould make a better commit title.\n\nI agree with everything you said including this part:\n\n> It would also be helpful to explain in the commit message the changes\n> to _ssize_t\n>\n>> +#ifdef _WIN64\n>> +typedef __int64 _ssize_t;\n>> +#else\n>>   typedef long _ssize_t;\n>> +#endif // _AMD64\n>\n> Please note that we do not use \"//\" comments so this should be \"/*\n> _WIN64 */\" so that the comment matches the opening #ifdef\n>\n> Thanks for working on this\n\nThanks.\n"},{"id":"504737","messageId":"20241010191939.GA17171@tb-raspi4","threadId":"62292","inReplyTo":"20241010102950.2151-1-soekkle@freenet.de","subject":"Re: [PATCH] [PATCH] mimgw: Remove Compiler Warnings","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2024-10-10T19:19:39Z","receivedAt":"2024-10-10T19:19:46Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On Thu, Oct 10, 2024 at 12:29:50PM +0200, Sören Krecker wrote:\n> Remove some complier warnings from msvc in compat/mingw.c for value truncation from 64 bit to 32 bit integers.\n>\n> Use size_t instead of int as all of the changed variables hold the result of strlen() or wcslen() which cannot be negative.\n> and set the size of ssize_t to 64 bit on windwos 64 bit.\n>\n> Signed-off-by: Sören Krecker <soekkle@freenet.de>\n\nI think that commit message can be improved a little bit.\nThe headline deserves to be shortened,\nin order to fit the rest of the commit messages in Git.\nThe non-headlines should stay below 72 characters or so, and it could make sense\nto explain the problem for the readers that are not as familiar with the\nproblem as you.\n\nSomething like this, please treat it as inspiration, I am not a user of msvc.\n\n===========================================\nmingw.c: Fix complier warnings for a 64 bit msvc\n\nCompiling compat/mingw.c under a 64 bit version of msvc produces warnings.\nAn \"int\" is 32 bit, and ssize_t or size_t should be 64 bit long.\nPrepare compat/vcbuild/include/unistd.h to have a 64 bit type _ssize_t,\nwhen _WIN64 is defined and 32 bit otherwise.\n\nFurther down in this include file, as before,\nssize_t is defined as _ssize_t, if needed.\n\nUse size_t instead of int for all variables that hold\nthe result of strlen() or wcslen() (which cannot be negative).\n\nUse ssize_t to hold the return value of read().\n===========================================\n\nHowever, looking at the current code:\n\nstatic const char *parse_interpreter(const char *cmd)\n{\n\tstatic char buf[100];\n\tchar *p, *opt;\n\tint n, fd;\n\n\t/* don't even try a .exe */\n\tn = strlen(cmd);\n\tif (n >= 4 && !strcasecmp(cmd+n-4, \".exe\"))\n\t\treturn NULL;\n\n\tfd = open(cmd, O_RDONLY);\n\tif (fd < 0)\n\t\treturn NULL;\n\tn = read(fd, buf, sizeof(buf)-1);\n\nIt looks as if 2 variables are better:\nsize_t n;\nssize_t i;\n[]\nn = strlen(cmd);\ni = read();\n\n\n>\n> ---\n>  compat/compiler.h               |  4 ++--\n>  compat/mingw.c                  | 25 +++++++++++++++----------\n>  compat/vcbuild/include/unistd.h |  4 ++++\n>  3 files changed, 21 insertions(+), 12 deletions(-)\n>\n> diff --git a/compat/compiler.h b/compat/compiler.h\n> index e9ad9db84f..e12e426404 100644\n> --- a/compat/compiler.h\n> +++ b/compat/compiler.h\n> @@ -9,7 +9,7 @@\n>\n>  static inline void get_compiler_info(struct strbuf *info)\n>  {\n> -\tint len = info->len;\n> +\tsize_t len = info->len;\n>  #ifdef __clang__\n>  \tstrbuf_addf(info, \"clang: %s\\n\", __clang_version__);\n>  #elif defined(__GNUC__)\n> @@ -27,7 +27,7 @@ static inline void get_compiler_info(struct strbuf *info)\n>\n>  static inline void get_libc_info(struct strbuf *info)\n>  {\n> -\tint len = info->len;\n> +\tsize_t len = info->len;\n>\n>  #ifdef __GLIBC__\n>  \tstrbuf_addf(info, \"glibc: %s\\n\", gnu_get_libc_version());\n> diff --git a/compat/mingw.c b/compat/mingw.c\n> index 0e851ecae2..0ff550cef3 100644\n> --- a/compat/mingw.c\n> +++ b/compat/mingw.c\n> @@ -782,7 +782,7 @@ static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)\n>   */\n>  static int has_valid_directory_prefix(wchar_t *wfilename)\n>  {\n> -\tint n = wcslen(wfilename);\n> +\tsize_t n = wcslen(wfilename);\n>\n>  \twhile (n > 0) {\n>  \t\twchar_t c = wfilename[--n];\n> @@ -891,7 +891,7 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)\n>   */\n>  static int do_stat_internal(int follow, const char *file_name, struct stat *buf)\n>  {\n> -\tint namelen;\n> +\tsize_t namelen;\n>  \tchar alt_name[PATH_MAX];\n>\n>  \tif (!do_lstat(follow, file_name, buf))\n> @@ -1274,7 +1274,8 @@ static const char *parse_interpreter(const char *cmd)\n>  {\n>  \tstatic char buf[100];\n>  \tchar *p, *opt;\n> -\tint n, fd;\n> +\tssize_t n; /* read() can return negative values */\n> +\tint fd;\n>\n>  \t/* don't even try a .exe */\n>  \tn = strlen(cmd);\n> @@ -1339,7 +1340,7 @@ static char *path_lookup(const char *cmd, int exe_only)\n>  {\n>  \tconst char *path;\n>  \tchar *prog = NULL;\n> -\tint len = strlen(cmd);\n> +\tsize_t len = strlen(cmd);\n>  \tint isexe = len >= 4 && !strcasecmp(cmd+len-4, \".exe\");\n>\n>  \tif (strpbrk(cmd, \"/\\\\\"))\n> @@ -1956,7 +1957,7 @@ char *mingw_getenv(const char *name)\n>  #define GETENV_MAX_RETAIN 64\n>  \tstatic char *values[GETENV_MAX_RETAIN];\n>  \tstatic int value_counter;\n> -\tint len_key, len_value;\n> +\tsize_t len_key, len_value;\n>  \twchar_t *w_key;\n>  \tchar *value;\n>  \twchar_t w_value[32768];\n> @@ -1968,7 +1969,8 @@ char *mingw_getenv(const char *name)\n>  \t/* We cannot use xcalloc() here because that uses getenv() itself */\n>  \tw_key = calloc(len_key, sizeof(wchar_t));\n>  \tif (!w_key)\n> -\t\tdie(\"Out of memory, (tried to allocate %u wchar_t's)\", len_key);\n> +\t\tdie(\"Out of memory, (tried to allocate %\"PRIuMAX\" wchar_t's)\",\n> +\t\t\t(uintmax_t)len_key);\n>  \txutftowcs(w_key, name, len_key);\n>  \t/* GetEnvironmentVariableW() only sets the last error upon failure */\n>  \tSetLastError(ERROR_SUCCESS);\n> @@ -1983,7 +1985,8 @@ char *mingw_getenv(const char *name)\n>  \t/* We cannot use xcalloc() here because that uses getenv() itself */\n>  \tvalue = calloc(len_value, sizeof(char));\n>  \tif (!value)\n> -\t\tdie(\"Out of memory, (tried to allocate %u bytes)\", len_value);\n> +\t\tdie(\"Out of memory, (tried to allocate %\"PRIuMAX\" bytes)\",\n> +\t\t\t(uintmax_t)len_value);\n>  \txwcstoutf(value, w_value, len_value);\n>\n>  \t/*\n> @@ -2001,7 +2004,7 @@ char *mingw_getenv(const char *name)\n>\n>  int mingw_putenv(const char *namevalue)\n>  {\n> -\tint size;\n> +\tsize_t size;\n>  \twchar_t *wide, *equal;\n>  \tBOOL result;\n>\n> @@ -2011,7 +2014,8 @@ int mingw_putenv(const char *namevalue)\n>  \tsize = strlen(namevalue) * 2 + 1;\n>  \twide = calloc(size, sizeof(wchar_t));\n>  \tif (!wide)\n> -\t\tdie(\"Out of memory, (tried to allocate %u wchar_t's)\", size);\n> +\t\tdie(\"Out of memory, (tried to allocate %\" PRIuMAX \" wchar_t's)\",\n> +\t\t    (uintmax_t)size);\n>  \txutftowcs(wide, namevalue, size);\n>  \tequal = wcschr(wide, L'=');\n>  \tif (!equal)\n> @@ -3085,7 +3089,8 @@ static void maybe_redirect_std_handles(void)\n>   */\n>  int wmain(int argc, const wchar_t **wargv)\n>  {\n> -\tint i, maxlen, exit_status;\n> +\tint i, exit_status;\n> +\tsize_t maxlen;\n>  \tchar *buffer, **save;\n>  \tconst char **argv;\n>\n> diff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h\n> index 3a959d124c..a261a925b7 100644\n> --- a/compat/vcbuild/include/unistd.h\n> +++ b/compat/vcbuild/include/unistd.h\n> @@ -14,7 +14,11 @@ typedef _mode_t\tmode_t;\n>\n>  #ifndef _SSIZE_T_\n>  #define _SSIZE_T_\n> +#ifdef _WIN64\n> +typedef __int64 _ssize_t;\n> +#else\n>  typedef long _ssize_t;\n> +#endif /* _WIN64 */\n>\n>  #ifndef\t_OFF_T_\n>  #define\t_OFF_T_\n>\n> base-commit: 777489f9e09c8d0dd6b12f9d90de6376330577a2\n> --\n> 2.39.5\n>\n>\n"},{"id":"504903","messageId":"20241012062243.3350-1-soekkle@freenet.de","threadId":"62292","inReplyTo":"20241010191939.GA17171@tb-raspi4","subject":"[PATCH v4] mingw.c: Fix complier warnings for a 64 bit msvc","fromName":"Sören Krecker","fromEmail":"soekkle@freenet.de","sentAt":"2024-10-12T06:22:43Z","receivedAt":"2024-10-12T06:23:02Z","isPatch":true,"sender":{"key":"soekkle@freenet.de","avatar":"https://avatars.githubusercontent.com/u/6253399?v=4"},"body":"Remove some complier warnings from msvc in compat/mingw.c for value\ntruncation from 64 bit to 32 bit integers.\n\nCompiling compat/mingw.c under a 64 bit version of msvc produces\nwarnings. An \"int\" is 32 bit, and ssize_t or size_t should be 64 bit\nlong. Prepare compat/vcbuild/include/unistd.h to have a 64 bit type\n_ssize_t, when _WIN64 is defined and 32 bit otherwise.\n\nFurther down in this include file, as before,ssize_t is defined as\n_ssize_t, if needed.\n\nUse size_t instead of int for all variables that hold the result of\nstrlen() or wcslen() (which cannot be negative).\n\nUse ssize_t to hold the return value of read().\n\nSigned-off-by: Sören Krecker <soekkle@freenet.de>\n---\n compat/compiler.h               |  4 ++--\n compat/mingw.c                  | 25 +++++++++++++++----------\n compat/vcbuild/include/unistd.h |  4 ++++\n 3 files changed, 21 insertions(+), 12 deletions(-)\n\ndiff --git a/compat/compiler.h b/compat/compiler.h\nindex e9ad9db84f..e12e426404 100644\n--- a/compat/compiler.h\n+++ b/compat/compiler.h\n@@ -9,7 +9,7 @@\n \n static inline void get_compiler_info(struct strbuf *info)\n {\n-\tint len = info->len;\n+\tsize_t len = info->len;\n #ifdef __clang__\n \tstrbuf_addf(info, \"clang: %s\\n\", __clang_version__);\n #elif defined(__GNUC__)\n@@ -27,7 +27,7 @@ static inline void get_compiler_info(struct strbuf *info)\n \n static inline void get_libc_info(struct strbuf *info)\n {\n-\tint len = info->len;\n+\tsize_t len = info->len;\n \n #ifdef __GLIBC__\n \tstrbuf_addf(info, \"glibc: %s\\n\", gnu_get_libc_version());\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 0e851ecae2..0ff550cef3 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -782,7 +782,7 @@ static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)\n  */\n static int has_valid_directory_prefix(wchar_t *wfilename)\n {\n-\tint n = wcslen(wfilename);\n+\tsize_t n = wcslen(wfilename);\n \n \twhile (n > 0) {\n \t\twchar_t c = wfilename[--n];\n@@ -891,7 +891,7 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)\n  */\n static int do_stat_internal(int follow, const char *file_name, struct stat *buf)\n {\n-\tint namelen;\n+\tsize_t namelen;\n \tchar alt_name[PATH_MAX];\n \n \tif (!do_lstat(follow, file_name, buf))\n@@ -1274,7 +1274,8 @@ static const char *parse_interpreter(const char *cmd)\n {\n \tstatic char buf[100];\n \tchar *p, *opt;\n-\tint n, fd;\n+\tssize_t n; /* read() can return negative values */\n+\tint fd;\n \n \t/* don't even try a .exe */\n \tn = strlen(cmd);\n@@ -1339,7 +1340,7 @@ static char *path_lookup(const char *cmd, int exe_only)\n {\n \tconst char *path;\n \tchar *prog = NULL;\n-\tint len = strlen(cmd);\n+\tsize_t len = strlen(cmd);\n \tint isexe = len >= 4 && !strcasecmp(cmd+len-4, \".exe\");\n \n \tif (strpbrk(cmd, \"/\\\\\"))\n@@ -1956,7 +1957,7 @@ char *mingw_getenv(const char *name)\n #define GETENV_MAX_RETAIN 64\n \tstatic char *values[GETENV_MAX_RETAIN];\n \tstatic int value_counter;\n-\tint len_key, len_value;\n+\tsize_t len_key, len_value;\n \twchar_t *w_key;\n \tchar *value;\n \twchar_t w_value[32768];\n@@ -1968,7 +1969,8 @@ char *mingw_getenv(const char *name)\n \t/* We cannot use xcalloc() here because that uses getenv() itself */\n \tw_key = calloc(len_key, sizeof(wchar_t));\n \tif (!w_key)\n-\t\tdie(\"Out of memory, (tried to allocate %u wchar_t's)\", len_key);\n+\t\tdie(\"Out of memory, (tried to allocate %\"PRIuMAX\" wchar_t's)\",\n+\t\t\t(uintmax_t)len_key);\n \txutftowcs(w_key, name, len_key);\n \t/* GetEnvironmentVariableW() only sets the last error upon failure */\n \tSetLastError(ERROR_SUCCESS);\n@@ -1983,7 +1985,8 @@ char *mingw_getenv(const char *name)\n \t/* We cannot use xcalloc() here because that uses getenv() itself */\n \tvalue = calloc(len_value, sizeof(char));\n \tif (!value)\n-\t\tdie(\"Out of memory, (tried to allocate %u bytes)\", len_value);\n+\t\tdie(\"Out of memory, (tried to allocate %\"PRIuMAX\" bytes)\",\n+\t\t\t(uintmax_t)len_value);\n \txwcstoutf(value, w_value, len_value);\n \n \t/*\n@@ -2001,7 +2004,7 @@ char *mingw_getenv(const char *name)\n \n int mingw_putenv(const char *namevalue)\n {\n-\tint size;\n+\tsize_t size;\n \twchar_t *wide, *equal;\n \tBOOL result;\n \n@@ -2011,7 +2014,8 @@ int mingw_putenv(const char *namevalue)\n \tsize = strlen(namevalue) * 2 + 1;\n \twide = calloc(size, sizeof(wchar_t));\n \tif (!wide)\n-\t\tdie(\"Out of memory, (tried to allocate %u wchar_t's)\", size);\n+\t\tdie(\"Out of memory, (tried to allocate %\" PRIuMAX \" wchar_t's)\",\n+\t\t    (uintmax_t)size);\n \txutftowcs(wide, namevalue, size);\n \tequal = wcschr(wide, L'=');\n \tif (!equal)\n@@ -3085,7 +3089,8 @@ static void maybe_redirect_std_handles(void)\n  */\n int wmain(int argc, const wchar_t **wargv)\n {\n-\tint i, maxlen, exit_status;\n+\tint i, exit_status;\n+\tsize_t maxlen;\n \tchar *buffer, **save;\n \tconst char **argv;\n \ndiff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h\nindex 3a959d124c..a261a925b7 100644\n--- a/compat/vcbuild/include/unistd.h\n+++ b/compat/vcbuild/include/unistd.h\n@@ -14,7 +14,11 @@ typedef _mode_t\tmode_t;\n \n #ifndef _SSIZE_T_\n #define _SSIZE_T_\n+#ifdef _WIN64\n+typedef __int64 _ssize_t;\n+#else\n typedef long _ssize_t;\n+#endif /* _WIN64 */\n \n #ifndef\t_OFF_T_\n #define\t_OFF_T_\n\nbase-commit: 777489f9e09c8d0dd6b12f9d90de6376330577a2\n-- \n2.39.5\n\n"},{"id":"505271","messageId":"20241016165124.GA32387@tb-raspi4","threadId":"62292","inReplyTo":"20241012062243.3350-1-soekkle@freenet.de","subject":"Re: [PATCH v4] mingw.c: Fix complier warnings for a 64 bit msvc","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2024-10-16T16:51:24Z","receivedAt":"2024-10-16T16:51:31Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On Sat, Oct 12, 2024 at 08:22:43AM +0200, Sören Krecker wrote:\n> Remove some complier warnings from msvc in compat/mingw.c for value\n> truncation from 64 bit to 32 bit integers.\n\nThis looks good to me.\n"},{"id":"505294","messageId":"ZxAgmvoyxZNnY1nQ@nand.local","threadId":"62292","inReplyTo":"20241012062243.3350-1-soekkle@freenet.de","subject":"Re: [PATCH v4] mingw.c: Fix complier warnings for a 64 bit msvc","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-16T20:22:50Z","receivedAt":"2024-10-16T20:22:54Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Sat, Oct 12, 2024 at 08:22:43AM +0200, Sören Krecker wrote:\n> Remove some complier warnings from msvc in compat/mingw.c for value\n> truncation from 64 bit to 32 bit integers.\n>\n> Compiling compat/mingw.c under a 64 bit version of msvc produces\n> warnings. An \"int\" is 32 bit, and ssize_t or size_t should be 64 bit\n> long. Prepare compat/vcbuild/include/unistd.h to have a 64 bit type\n> _ssize_t, when _WIN64 is defined and 32 bit otherwise.\n>\n> Further down in this include file, as before,ssize_t is defined as\n> _ssize_t, if needed.\n\nThere is a missing ' ' space character between \"before,\" and \"ssize_t\",\nbut I fixed it up when queueing.\n\nThanks!\n\nThanks,\nTaylor\n"},{"id":"505378","messageId":"20241017171820.2679-2-soekkle@freenet.de","threadId":"62292","inReplyTo":"20241017171820.2679-1-soekkle@freenet.de","subject":"[PATCH 1/1] [PATCH] mingw.c: Fix complier warnings for a 64 bit msvc","fromName":"Sören Krecker","fromEmail":"soekkle@freenet.de","sentAt":"2024-10-17T17:18:20Z","receivedAt":"2024-10-17T17:23:50Z","isPatch":true,"sender":{"key":"soekkle@freenet.de","avatar":"https://avatars.githubusercontent.com/u/6253399?v=4"},"body":"Remove some complier warnings from msvc in compat/mingw.c for value\ntruncation from 64 bit to 32 bit integers.\n\nCompiling compat/mingw.c under a 64 bit version of msvc produces\nwarnings. An \"int\" is 32 bit, and ssize_t or size_t should be 64 bit\nlong. Prepare compat/vcbuild/include/unistd.h to have a 64 bit type\n_ssize_t, when _WIN64 is defined and 32 bit otherwise.\n\nFurther down in this include file, as before, ssize_t is defined as\n_ssize_t, if needed.\n\nUse size_t instead of int for all variables that hold the result of\nstrlen() or wcslen() (which cannot be negative).\n\nUse ssize_t to hold the return value of read().\n\nSigned-off-by: Sören Krecker <soekkle@freenet.de>\n---\n compat/compiler.h               |  4 ++--\n compat/mingw.c                  | 25 +++++++++++++++----------\n compat/vcbuild/include/unistd.h |  4 ++++\n 3 files changed, 21 insertions(+), 12 deletions(-)\n\ndiff --git a/compat/compiler.h b/compat/compiler.h\nindex e9ad9db84f..e12e426404 100644\n--- a/compat/compiler.h\n+++ b/compat/compiler.h\n@@ -9,7 +9,7 @@\n \n static inline void get_compiler_info(struct strbuf *info)\n {\n-\tint len = info->len;\n+\tsize_t len = info->len;\n #ifdef __clang__\n \tstrbuf_addf(info, \"clang: %s\\n\", __clang_version__);\n #elif defined(__GNUC__)\n@@ -27,7 +27,7 @@ static inline void get_compiler_info(struct strbuf *info)\n \n static inline void get_libc_info(struct strbuf *info)\n {\n-\tint len = info->len;\n+\tsize_t len = info->len;\n \n #ifdef __GLIBC__\n \tstrbuf_addf(info, \"glibc: %s\\n\", gnu_get_libc_version());\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 0e851ecae2..0ff550cef3 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -782,7 +782,7 @@ static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)\n  */\n static int has_valid_directory_prefix(wchar_t *wfilename)\n {\n-\tint n = wcslen(wfilename);\n+\tsize_t n = wcslen(wfilename);\n \n \twhile (n > 0) {\n \t\twchar_t c = wfilename[--n];\n@@ -891,7 +891,7 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)\n  */\n static int do_stat_internal(int follow, const char *file_name, struct stat *buf)\n {\n-\tint namelen;\n+\tsize_t namelen;\n \tchar alt_name[PATH_MAX];\n \n \tif (!do_lstat(follow, file_name, buf))\n@@ -1274,7 +1274,8 @@ static const char *parse_interpreter(const char *cmd)\n {\n \tstatic char buf[100];\n \tchar *p, *opt;\n-\tint n, fd;\n+\tssize_t n; /* read() can return negative values */\n+\tint fd;\n \n \t/* don't even try a .exe */\n \tn = strlen(cmd);\n@@ -1339,7 +1340,7 @@ static char *path_lookup(const char *cmd, int exe_only)\n {\n \tconst char *path;\n \tchar *prog = NULL;\n-\tint len = strlen(cmd);\n+\tsize_t len = strlen(cmd);\n \tint isexe = len >= 4 && !strcasecmp(cmd+len-4, \".exe\");\n \n \tif (strpbrk(cmd, \"/\\\\\"))\n@@ -1956,7 +1957,7 @@ char *mingw_getenv(const char *name)\n #define GETENV_MAX_RETAIN 64\n \tstatic char *values[GETENV_MAX_RETAIN];\n \tstatic int value_counter;\n-\tint len_key, len_value;\n+\tsize_t len_key, len_value;\n \twchar_t *w_key;\n \tchar *value;\n \twchar_t w_value[32768];\n@@ -1968,7 +1969,8 @@ char *mingw_getenv(const char *name)\n \t/* We cannot use xcalloc() here because that uses getenv() itself */\n \tw_key = calloc(len_key, sizeof(wchar_t));\n \tif (!w_key)\n-\t\tdie(\"Out of memory, (tried to allocate %u wchar_t's)\", len_key);\n+\t\tdie(\"Out of memory, (tried to allocate %\"PRIuMAX\" wchar_t's)\",\n+\t\t\t(uintmax_t)len_key);\n \txutftowcs(w_key, name, len_key);\n \t/* GetEnvironmentVariableW() only sets the last error upon failure */\n \tSetLastError(ERROR_SUCCESS);\n@@ -1983,7 +1985,8 @@ char *mingw_getenv(const char *name)\n \t/* We cannot use xcalloc() here because that uses getenv() itself */\n \tvalue = calloc(len_value, sizeof(char));\n \tif (!value)\n-\t\tdie(\"Out of memory, (tried to allocate %u bytes)\", len_value);\n+\t\tdie(\"Out of memory, (tried to allocate %\"PRIuMAX\" bytes)\",\n+\t\t\t(uintmax_t)len_value);\n \txwcstoutf(value, w_value, len_value);\n \n \t/*\n@@ -2001,7 +2004,7 @@ char *mingw_getenv(const char *name)\n \n int mingw_putenv(const char *namevalue)\n {\n-\tint size;\n+\tsize_t size;\n \twchar_t *wide, *equal;\n \tBOOL result;\n \n@@ -2011,7 +2014,8 @@ int mingw_putenv(const char *namevalue)\n \tsize = strlen(namevalue) * 2 + 1;\n \twide = calloc(size, sizeof(wchar_t));\n \tif (!wide)\n-\t\tdie(\"Out of memory, (tried to allocate %u wchar_t's)\", size);\n+\t\tdie(\"Out of memory, (tried to allocate %\" PRIuMAX \" wchar_t's)\",\n+\t\t    (uintmax_t)size);\n \txutftowcs(wide, namevalue, size);\n \tequal = wcschr(wide, L'=');\n \tif (!equal)\n@@ -3085,7 +3089,8 @@ static void maybe_redirect_std_handles(void)\n  */\n int wmain(int argc, const wchar_t **wargv)\n {\n-\tint i, maxlen, exit_status;\n+\tint i, exit_status;\n+\tsize_t maxlen;\n \tchar *buffer, **save;\n \tconst char **argv;\n \ndiff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h\nindex 3a959d124c..a261a925b7 100644\n--- a/compat/vcbuild/include/unistd.h\n+++ b/compat/vcbuild/include/unistd.h\n@@ -14,7 +14,11 @@ typedef _mode_t\tmode_t;\n \n #ifndef _SSIZE_T_\n #define _SSIZE_T_\n+#ifdef _WIN64\n+typedef __int64 _ssize_t;\n+#else\n typedef long _ssize_t;\n+#endif /* _WIN64 */\n \n #ifndef\t_OFF_T_\n #define\t_OFF_T_\n-- \n2.39.5\n\n"},{"id":"505379","messageId":"20241017171820.2679-1-soekkle@freenet.de","threadId":"62292","inReplyTo":"ZxAgmvoyxZNnY1nQ@nand.local","subject":"[PATCH v5 0/1] mingw.c: Fix complier warnings for a 64 bit msvc","fromName":"Sören Krecker","fromEmail":"soekkle@freenet.de","sentAt":"2024-10-17T17:18:19Z","receivedAt":"2024-10-17T17:23:54Z","isPatch":true,"sender":{"key":"soekkle@freenet.de","avatar":"https://avatars.githubusercontent.com/u/6253399?v=4"},"body":"Hi everyone,\n\nI fix the missing space in the commit message.\n\nBest regards,\n\nSören\n\nSören Krecker (1):\n  mingw.c: Fix complier warnings for a 64 bit msvc\n\n compat/compiler.h               |  4 ++--\n compat/mingw.c                  | 25 +++++++++++++++----------\n compat/vcbuild/include/unistd.h |  4 ++++\n 3 files changed, 21 insertions(+), 12 deletions(-)\n\n\nbase-commit: 777489f9e09c8d0dd6b12f9d90de6376330577a2\n-- \n2.39.5\n\n"},{"id":"505383","messageId":"ZxFa5ucGZAVfqlkX@nand.local","threadId":"62292","inReplyTo":"20241017171820.2679-2-soekkle@freenet.de","subject":"Re: [PATCH 1/1] [PATCH] mingw.c: Fix complier warnings for a 64 bit msvc","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-17T18:43:50Z","receivedAt":"2024-10-17T18:43:53Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Thu, Oct 17, 2024 at 07:18:20PM +0200, Sören Krecker wrote:\n> ---\n>  compat/compiler.h               |  4 ++--\n>  compat/mingw.c                  | 25 +++++++++++++++----------\n>  compat/vcbuild/include/unistd.h |  4 ++++\n>  3 files changed, 21 insertions(+), 12 deletions(-)\n\nThanks, this version looks good to me. Unless we hear otherwise, let's\nstart merging this one down.\n\nThanks,\nTaylor\n"}]}