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

[PATCH 0/2] mingw: macro main(), const warnings

From
Stepan Kasal <kasal@ucw.cz>
Date
May 29, 2014, 10:43 UTC
Message-ID
<20140529104329.GA24021@camelia.ucw.cz>
Hello,

mingw.h defines a preprocessor macro main(), so that it can wrap the original function and hoook into initialization.

The real main() function can have different types of its second parameter (char**, const char**, char*[]). It is not easy to match the type and gcc issues a const warning. My patch fixes that.

There were solutions for the same issue published ([1], [2]), but none of them appeared in junio/pu. This new solution should be more future proof, as it modifies only compat/mingw.h; the *.c files can have any of the types mentioned above.

I promise to take care of the integration into msysGit if this patch gets accepted. To make it easier, I'm submitting a patch that has been part of msysGit for 3 years.

Karsten Blees (1):
  Win32: move main macro to a function
Stepan Kasal (1):
  mingw: avoid const warning
 compat/mingw.c | 15 +++++++++++++++
 compat/mingw.h | 17 ++++++-----------
 2 files changed, 21 insertions(+), 11 deletions(-)
-- 
1.9.2.msysgit.0.496.g23aa553

[1] a hack to fix the warning, by Pat Thoyts, in msysGit since
1.8.5.2.msysgit.0 (Dec 2013):
https://github.com/msysgit/git/commit/6949537a

[2] more elgant fix:
From: Marat Radchenko <marat@slonopotamus.org>
Date: Tue, 29 Apr 2014 13:12:02 +0400
http://article.gmane.org/gmane.comp.version-control.git/247535

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Next: Stepan Kasal
Message 1 of 9 in “mingw: macro main(), const warnings”
  1. 0/2 mingw: macro main(), const warningsStepan Kasal, May 29, 2014
  2. 1/2 Win32: move main macro to a functionStepan Kasal, May 29, 2014
  3. 2/2 mingw: avoid const warningStepan Kasal, May 29, 2014
  4. Karsten BleesJun 6, 2014
  5. Junio C HamanoJun 6, 2014
  6. Karsten BleesJun 6, 2014
  7. 0/2 mingw: macro main(), const warningsStepan Kasal, Jun 7, 2014
  8. 1/2 Win32: move main macro to a functionStepan Kasal, Jun 7, 2014
  9. 2/2 mingw: avoid const warningStepan Kasal, Jun 7, 2014

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.