[Mingw-users] Yet another compilation problem with building gcc 7.3.0

Back to archive index

David Gressett DGres****@amli-*****
Fri Jun 29 11:52:07 JST 2018


(this message has been double-spaced to keep Microsoft Outlook from merging lines)

The unicode  misuse patch fixed the problem with compiling adaint.c.

Unfortunately, the next attempt failed with another file in the same directory.

The offender is rtinit.c, which has three undefined constants.

The first error message is

../../../src/gcc-7.3.0/gcc/ada/rtinit.c:195:44: error: '_O_U16TEXT' was not declared in this scope

              __gnat_current_ccs_encoding = _O_U16TEXT;

The other two undefined items were _O_WTEXT and _O_U8TEXT.

For all three of these, the compiler suggested _O_TEXT as an alternative.

rtinit.c includes <fcntl.h> which defines the three undefined items:


#if (__MSVCRT_VERSION__ >= 0x0800)

#define _O_WTEXT	0x10000

#define _O_U16TEXT	0x20000

#define _O_U8TEXT	0x40000

#endif

fcntl.h includes _mingw.h which includes mscrtver.h, which defines a default value for __MSVCRT_VERSION__

The default value is 0x0600, so unless an overriding #define produces a larger value, these constants will be undefined.

rtinit.c contains 

#ifdef IN_RTS

#include "tconfig.h"

#include "tsystem.h"

... 3 lines snipped out ...

#else

#include "config.h"

#include "system.h"

#endif

This provides some places that might define a larger value for __MSVCRT_VERSION__.

I found that my successful gcc 7.1.0 build has tconfig.h, but my failed 7.3.0 build has config.h.

This is where my detective work stopped for the day.




More information about the MinGW-Users mailing list
Back to archive index