![]() |
|
Fair Warning (MinGw Port's and C99+) - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: C, C++, & Obj-C (https://sinister.ly/Forum-C-C-Obj-C) +--- Thread: Fair Warning (MinGw Port's and C99+) (/Thread-Fair-Warning-MinGw-Port-s-and-C99) |
Fair Warning (MinGw Port's and C99+) - bitm0de - 12-30-2016 -- removed post content -- RE: Fair Warning (MinGw Port's and C99+) - Inori - 12-30-2016 Any dev who uses windows and doesn't use/have access to a Linux VM should use Cygwin imo, it's been a huge convenience to me so many times. Nice tip, though. Good to keep in mind when I have a limited environment. RE: Fair Warning (MinGw Port's and C99+) - bitm0de - 12-30-2016 (12-30-2016, 03:44 AM)Inori Wrote: Any dev who uses windows and doesn't use/have access to a Linux VM should use Cygwin imo, it's been a huge convenience to me so many times. Nice tip, though. Good to keep in mind when I have a limited environment. Cygwin is hard and sometimes annoying to work with, but if I'm just testing code (and I don't have to rely on platform specific headers, like in this particular case), I can just apt-get gcc from bash on Windows to get a real version of gcc (native), compile using bash to generate an ELF binary and run it afterwards because gcc (in contrast to ports like MinGw) actually better implement the modern C language standards -- unlike Microsoft and MinGw that relies on a Microsoft implemented backbone (MSVCRT). For all other cases I trust clang, and if I'm using C++ it doesn't matter as pretty much any compiler does the job for the most part -- Microsoft focuses mainly on C++ and so anything that uses Microsoft stuff as a backend will inherently gain C++ features that Microsoft has implemented (worst or perhaps best case depending on how you look at that). https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/2089423-c99-support Quote:Our primary goal is to support "most of C99/C11 that is a subset of ISO C++98/C++11. I think this is a pretty clear statement to all C programmers. In truth, gcc extensions will allow you to use compound literals in C++ too, but I highly disagree with that! The semantics are not even closely the same and if you don't understand what's going on, there are cases that guarantee you will run into undefined behavior. Never use non-standard language features unless you have to. http://stackoverflow.com/a/28116523 (well-defined C code, can have undefined behavior in C++.) C99 reference for compound literals: http://en.cppreference.com/w/c/language/compound_literal I begin to question the usefulness of flags like -std=c99 and -std=c11 with MinGw lol. At least provide a compiler warning if not an error for unsupported or buggy modern C language features? |