1

What versions of C does minigw-w64 support? It uses msvcrt.dll so wouldn't it only support ANSI C? But then i see programs like VLC use it but say that they require C11. How is this possible?

EDIT: Some sources: How to printf a size_t without warning in mingw-w64 gcc 7.1?

http://www.mingw.org/wiki/c99

Cyburg3
  • 19
  • 3
  • Generally speaking: it implements the C library by a combination of calls to msvcrt, and its own implementation. For areas where msvcrt is bugged or lacking, it avoids calling msvcrt. – M.M Sep 17 '18 at 23:08
  • The C language version is not determined by the runtime library. https://stackoverflow.com/questions/14737104/what-is-the-default-c-mode-for-the-current-gcc-especially-on-ubuntu – Hans Passant Sep 18 '18 at 00:05
  • 1
    @HansPassant That is not relevant to Minigw-w64 and windows. – Cyburg3 Sep 18 '18 at 02:15
  • It is just as relevant, mingw-w64 bundles gcc. – Hans Passant Sep 18 '18 at 07:31
  • It mostly depends on which gcc version that's used. Somewhere from gcc 4.7 and onward supports C11 language, although C11 standard library is separate. Mingw indeed uses Microsoft's crap standard lib, which is at best C90 compliant. You can toss in a compiler switch `#define __USE_MINGW_ANSI_STDIO` to get C11 stdio.h, but not the other C11 libraries. [See this](https://stackoverflow.com/questions/44382862/how-to-printf-a-size-t-without-warning-in-mingw-w64-gcc-7-1), I just posted an example that fixes stdio.h. – Lundin Sep 18 '18 at 09:59
  • @HansPassant No it is not, read Lundin's comment. – Cyburg3 Sep 19 '18 at 01:49

1 Answers1

2

MinGW uses msvcrt.dll, but integrates it where needed to support newer/fixed features, in some cases providing complete reimplementations of some functions (e.g. you can opt-in for GNU printf/scanf). Such extras are either linked statically, or provided into a separate dll (mingw1.dll, IIRC).

Matteo Italia
  • 123,740
  • 17
  • 206
  • 299