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 23, 2014, 17:12 UTC
Message-ID
<5472159B.4060905@ramsay1.demon.co.uk>
In-Reply-To
<5471EC26.3040705@web.de>
On 23/11/14 14:16, Torsten Bögershausen wrote:
Show 5 quoted lines
> 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

Heh, thanks for looking into this. Your email came at a good time, since I was just about to boot my old laptop into windows XP to test my patch on 32-bit cygwin! (If I had not been watching the F1 Grand Prix on TV, I would already have done so! ;-) ).

It's been a while since I updated my 32-bit cygwin installation (about 6 months) but I'm a little surprised you found this issue with gcc 4.7.3 (I'm _almost_ tempted to boot that laptop anyway just to see what versions of software it is running).

Just for the reccord, my patch follows.

ATB, Ramsay Jones

Show 26 quoted lines
> 
> 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
>  git-compat-util.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/git-compat-util.h b/git-compat-util.h
> index 400e921..cef2691 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -75,7 +75,8 @@
>  # endif
>  #elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \
>        !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \
> -      !defined(__TANDEM) && !defined(__QNX__) && !defined(__MirBSD__)
> +      !defined(__TANDEM) && !defined(__QNX__) && !defined(__MirBSD__) && \
> +      !defined(__CYGWIN__)
>  #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
>  #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
>  #endif
> 
Previous: Torsten BögershausenNext: Junio C Hamano
Message 2 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.