-ansi, -pedantic warnings and errors on

Robert Shearman rob at codeweavers.com
Sat Feb 17 14:27:07 CST 2007

Joris Huizer wrote:
> Hello,
> I was looking at the result of configuring with -ansi,
> -pedantic flags. It gives loads of warnings (not all
> relevant - also complaining about 'long long' not
> being ansi) and indicates unnamed unions, among other
> things.
> Could someone confirm my idea that unnamed unions must
> all be dealt with? Am hoping to fix those if I get it
> to compile thus far;
> At this point, it complains about
> include/wine/unicode.h which has the combination
> 'extern' and 'inline', which it doesn't like.
> Getting rid of that, with -Dinline=__inline__, helps
> it get a bit further
> Next it complains about is libs/wine/string.c, which
> implements several functions that are also implemented
> in include/wine/unicode.h. These are again the 'extern
> inline' functions.
> As most headers have 'static inline' instead of
> 'extern inline', with the advantage of not having to
> duplicate the functions. I'm hoping this is an allowed
> fix, it gets compiling further anyway

On modern CPUs it is much better to have one copy of the function 
instead of inlining it. Making the functions static instead of extern 
will probably cause wine to be a bit slower at the expense of silencing 
some not very useful warnings. If you want to fix it for this case, I 
suggest you add a define that changes to "static inline" if 
pedantic/ansi mode is being used and "extern inline" otherwise and use 
it when declaring the functions.

Rob Shearman

More information about the wine-devel mailing list