<div dir="ltr">Hi,<div><br></div><div>I've just started porting my C++ application to Linux with Winelib.</div><div><br></div><div>Upon first attempts to compile, I've received a wall of "warning: returning reference to temporary" on Wine's headers from g++.</div>

<div>All of those seem to stem from guidgen.h definition of 
__wine_uuidof / __CRT_UUID_DECL for C++.</div><div><br></div><div>All in all, g++ seems to be right -- we are indeed returning a reference to a IID struct that's allocated on the stack.</div><div><br></div><div>If I remove the '&' in this definition (in guidgen.h):</div>

<div>   template<typename T> const GUID &__wine_uuidof();<br>the warnings stop, but then I wonder, did the original author have some good reasoning for returning a reference in the first place?</div><div><br></div>

<div>Thanks.</div><div><br></div></div>