What flavor of C does Wine source target?

Michael Stefaniuc mstefani at redhat.com
Fri Aug 26 10:09:30 CDT 2016


On 08/26/2016 04:31 PM, Andrew Eikum wrote:
> On Fri, Aug 26, 2016 at 08:59:01AM +0300, Ruslan Kabatsayev wrote:
>> While developing some code for Wine I wanted to ensure that I don't
>> use some C99 features like C++-style comments or declaration of
>> variables after statement. But the only way I found to do this with
>> gcc was to use '-std=c89 -pedantic'. This appears to break lots of
>> other things in winelib, particularly 'inline' functions, so it can't
>> really be used for Wine/Winelib sources. The default for GCC is gnu89,
>> which does allow the things Wine doesn't want.
>>
> 
> I don't think we really have a strict standard. You've already
> identified the two big no-nos. Someone can correct me, but I believe
> we use C89 for most of our code because we expect Microsoft's C++
> compiler to build it, and it only supports up to C89.
> 
> Some parts of Wine, for example winealsa.drv, will never be useful on
> Windows, so they may use features that wouldn't work in msvc,
> intentionally or not. But mostly we stick to C89 for consistency.
> 
>> So, I wonder now, what flavor of C does Wine actually target? What
>> tools can I use to automatically restrict language features?
>>
> 
> Wine's default flags should warn about declaring variables after code,
> and it's easy to make sure you're not using C++-style comments
> visually or with grep or so. There isn't really much else most
> developers will have to worry about. Feel free to ask if you think you
> might be using something that's not in C89.
Nameless structs and unions. But only Francois really cares about those
and he'll fix that code up later on.

bye
	michael



More information about the wine-devel mailing list