[PATCH 2/2] mingw: avoid const warning

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

 



Fix const warnings in http-fetch.c and remote-curl.c main() where is
argv declared as const.

The fix should work for all future declarations of main, no matter
whether the second parameter's type is "char**", "const char**", or
"char *[]".

Signed-off-by: Stepan Kasal <kasal@xxxxxx>
---
 compat/mingw.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/compat/mingw.h b/compat/mingw.h
index 15f0c9d..8745d19 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -369,10 +369,11 @@ extern CRITICAL_SECTION pinfo_cs;
 void mingw_startup();
 #define main(c,v) dummy_decl_mingw_main(); \
 static int mingw_main(c,v); \
-int main(int argc, char **argv) \
+int main(c, char **main_argv_not_used) \
 { \
+	typedef v, **argv_type; \
 	mingw_startup(); \
-	return mingw_main(__argc, __argv); \
+	return mingw_main(__argc, (argv_type)__argv); \
 } \
 static int mingw_main(c,v)
 
-- 
1.9.2.msysgit.0.496.g23aa553
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]