[Mesa-dev] c99 vs v90

Jose Fonseca jfonseca at vmware.com
Thu Aug 4 09:38:26 UTC 2016


On 04/08/16 01:48, Enrico Weigelt, metux IT consult wrote:
> On 03.08.2016 23:28, Jose Fonseca wrote:
>
> Hi,
>
>> There are minor inconsistencies.  For example, it doesn't support
>> __func__,  but doing
>>
>>   #define __func__ __FUNCTION__
>>
>> suffices to make __func__ work compatible.
>
> Wait a second ... IIRC, __FUNCTION__ was a non-standard gcc'ism - now
> msvc support that, but lacks the standardized __func__ ? Seriously ?

__FUNCTION__ has been around for a very long time (before 1999), so it's 
no surprise that MSVC has it.  But not implementing __func__ does seem a 
oversight.  I believe they fixed it on MSVC 2015.

Anyway, this was just an example.  Don't let it upset you.  Keeping code 
portable is full of this small inconsistencies due to 
bugs/historical-reasons/etc.  If this goes under your skin, then it 
might be better to spare your nerves and do something else.

>
>> Also MSVC C++ doesn't support many C99 that are not part of C++.  Where
>> as GNU C++ munches all.
>
> grmpf!

To be clear, GNU C++ is the non-standard one here.  MSVC is following 
the spec.  It's just a ptty that the C and C++ standard bodies don't 
strive for consistency.

> by the way: what's the exact reason for using msvc instead of gcc on
> win32 ?

GCC on Win32 (MinGW) is not reliable (lots of known bugs.)  But above 
all, it's impossible to debug Mingw executables on Windows: one has to 
use GDB to debug Mingw DLLs/EXEs because Microsft debuggers don't 
understand DWARF debug info, and one has to use Microsof debugger to 
debug Microsoft DLLs/EXEs.  So it's impossible to debug an app that uses 
both, which is always the case if the OpenGL driver is built with GCC.

But Microsoft has been working on a Clang/LLVM frontend for their 
compiler, capable of genering debug info on MS format.  So I have hopes 
we could one day switch to it.  It still in its early infancy though.

>>> hmm, I dont have any msvc here (actually, no windows at all), but I
>>> could prepare patches, which other people could test.
>>
>> You could make a fork on github and then register with AppVeyor.
>
> yeah, already got it running.
>
> can I also deploy it to some VM there and log in via VNC ?

No, not that I know of.

Jose



More information about the mesa-dev mailing list