Hi!

While building Pango with mingw-w64 (x86_64-w64-mingw32-gcc (GCC) 9.2.1
20190827 (Fedora MinGW 9.2.1-1.fc31)), the build failed with this error:

-----------------------------
[10/153] Compiling C object 'subprojects/fribidi/lib/c8b5423@@fribidi@sha
/fribidi-bidi-types.c.obj'.
FAILED: subprojects/fribidi/lib/c8b5423@@fribidi@sha/fribidi-bidi-types.c.obj

x86_64-w64-mingw32-gcc -Isubprojects/fribidi/lib/c8b5423@@fribidi@sha
-Isubprojects/fribidi/lib -I../subprojects/fribidi/lib
-Isubprojects/fribidi -I../subprojects/fribidi
-Isubprojects/fribidi/gen.tab -I../subprojects/fribidi/gen.tab
-fdiagnostics-color=always -pipe -Wall -Winvalid-pch -std=gnu99 -O2 -g
-ansi -fvisibility=hidden -DHAVE_CONFIG_H '-DFRIBIDI_ENTRY=extern
__attribute__ ((visibility ("default")))' -MD -MQ
'subprojects/fribidi/lib/c8b5423@@fribidi@sha/fribidi-bidi-types.c.obj' -MF
'subprojects/fribidi/lib/c8b5423@@fribidi@sha/fribidi-bidi-types.c.obj.d'
-o 'subprojects/fribidi/lib/c8b5423@@fribidi@sha/fribidi-bidi-types.c.obj'
-c ../subprojects/fribidi/lib/fribidi-bidi-types.c
In file included from ../subprojects/fribidi/lib/common.h:55,
                 from ../subprojects/fribidi/lib/fribidi-bidi-types.c:28:
/home/jehan/.local/share/crossroad/roads/w64/gimp/include/stdlib.h:473:1:
error: C++ style comments are not allowed in ISO C90
  473 | // The ucrtbase version of strtod is C99 compliant, so we don't
need to redirect it to the mingw version.
      | ^
-----------------------------

The attached patch fixes the build by simply using only C-style comments.
Thanks.

Jehan
-- 
ZeMarmot open animation film
http://film.zemarmot.net
Liberapay: https://liberapay.com/ZeMarmot/
Patreon: https://patreon.com/zemarmot
Tipeee: https://www.tipeee.com/zemarmot
From 9eadbcb43cc1a1c5febe3eee2d4a5c44f0010a11 Mon Sep 17 00:00:00 2001
From: Jehan <je...@girinstud.io>
Date: Thu, 21 Nov 2019 18:56:10 +0100
Subject: [PATCH] headers: non C90-compliant C++ style comments break builds.

Fixes such error when building strict C projects:
> include/stdlib.h:473:1: error: C++ style comments are not allowed in ISO C90
---
 mingw-w64-headers/crt/stdlib.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mingw-w64-headers/crt/stdlib.h b/mingw-w64-headers/crt/stdlib.h
index 7d758f30..e87f6398 100644
--- a/mingw-w64-headers/crt/stdlib.h
+++ b/mingw-w64-headers/crt/stdlib.h
@@ -498,7 +498,7 @@ float __cdecl __MINGW_NOTHROW strtof(const char * __restrict__ _Str,char ** __re
   /* libmingwex.a provides a c99-compliant strtod() exported as __strtod() */
   extern double __cdecl __MINGW_NOTHROW
   __strtod (const char * __restrict__ , char ** __restrict__);
-// The UCRT version of strtod is C99 compliant, so we don't need to redirect it to the mingw version.
+/* The UCRT version of strtod is C99 compliant, so we don't need to redirect it to the mingw version. */
 #if !defined(__USE_MINGW_STRTOX) && !defined(_UCRT)
 #define strtod __strtod
 #endif /* !defined(__USE_MINGW_STRTOX) */
-- 
2.23.0

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to