[PATCH] msvcp120: Avoid type conversion warnings in test_tr2_sys__dir_operation.

Gerald Pfeifer gerald at pfeifer.com
Wed May 6 15:40:27 CDT 2020


On Tue, 5 May 2020, Piotr Caban wrote:
>> +    type = 0xdeadbeef;
> I guess this assignment will work on all compilers. Isn't assigning 
> the value outside of enum range unspecified in C standard?

Based on your question I dug into the C11 standard and found

  "An identifier declared as an enumeration constant has type int."

So that should not be a concern.  And if it turns out it ever triggers
something, we can...

> I don't know if it's a valid concern but I'm worried it may still cause 
> a warning on some compilers (I don't know any that actually warns in 
> this case). How about adding a new value to enum and using it in tests 
> for uninitialized value (or just using 0)?

...always follow the approach you outline (which will be easier than 
since there is a single assignment to adjust, not the current double 
assignment).

If after the above you'd still like to see us use 0x0 or an distinct 
member of the enum (how would you call that?) let me know and I'll cook
a new patch.

Gerald



More information about the wine-devel mailing list