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

Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Nov 24, 2014, 21:41 UTC
Message-ID
<5473A602.30505@ramsay1.demon.co.uk>
In-Reply-To
<20141124175947.GN6527@google.com>
On 24/11/14 17:59, Jonathan Nieder wrote:
Show 26 quoted lines
> Torsten Bögershausen wrote:
> 
>> gcc under cygwin reports several warnings like this:
>>
>>  warning: implicit declaration of function 'memmem'
>>   [-Wimplicit-function-declaration]
>>
>> This has been observed under CYGWIN-32 with GCC 4.7.3 as well
>> as CYGWIN-64 with gcc v4.8.3-5 x86-64
>>
>> Do not #define _XOPEN_SOURCE 600 for CYGWIN.
>>
>> Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
>> Signed-off-by: Torsten Bögershausen <tboegi@web.de>
>> ---
>> This may be a start for a patch, tested under CYGWIN-32,
>> both Windows7 and XP
> 
> The "tested under" part would also be a good addition to the commit
> message.
> 
>>  git-compat-util.h | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Patch looks good to me.  Do you know if this has been reported to the
> Cygwin maintainers?

As I said in an earlier email, I have searched the cygwin mailing list (a few days ago now), but this issue had not been mentioned (modulo my poor list searching fu!).

However, since I don't want to subscribe to (yet another) busy mailing list, I won't be reporting this issue there. (If someone on this list is already subscribed to that list, then ... ;-) ).

>                       The behavior seems counterintuitive --- I would
> expect _GNU_SOURCE to override everything else (since I thought that
> was the point of _GNU_SOURCE).
I had that impression too, but I need to read some more first.

Also, my theory about the cause of the problem has changed slightly this evening, after booting up my old laptop and looking at an old 32-bit cygwin installation.

Rather than a change to '..../sys/cdefs.h' which changed the priority of _XOPEN_SOURCE, it seems that it was the <string.h> header that changed; those functions used to be declared unconditionally, whereas the new headers have them within preprocessor conditionals.

ATB, Ramsay Jones

Previous: Torsten Bögershausen
Message 17 of 17 in “CYGWIN: avoid implicit declaration warning”
  1. CYGWIN: avoid implicit declaration warningTorsten Bögershausen, Nov 23, 2014
  2. Ramsay JonesNov 23, 2014
  3. Junio C HamanoNov 23, 2014
  4. Ramsay JonesNov 23, 2014
  5. Torsten BögershausenNov 24, 2014
  6. Torsten BögershausenNov 24, 2014
  7. t5000 on Windows: do not mistake "sh.exe" as "sh"Johannes Sixt, Nov 24, 2014
  8. Torsten BögershausenNov 24, 2014
  9. Ramsay JonesNov 24, 2014
  10. Junio C HamanoNov 24, 2014
  11. Ramsay JonesNov 24, 2014
  12. Ramsay JonesNov 24, 2014
  13. Junio C HamanoNov 24, 2014
  14. Ramsay JonesNov 24, 2014
  15. Jonathan NiederNov 24, 2014
  16. Torsten BögershausenNov 24, 2014
  17. Ramsay JonesNov 24, 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.