__wine_uuidof causing a wall of "warning: returning reference to temporary" on g++

Ilya Konstantinov future at shiny.co.il
Sun Jul 29 09:32:16 CDT 2012


I've just started porting my C++ application to Linux with Winelib.

Upon first attempts to compile, I've received a wall of "warning: returning
reference to temporary" on Wine's headers from g++.
All of those seem to stem from guidgen.h definition of
__wine_uuidof / __CRT_UUID_DECL for C++.

All in all, g++ seems to be right -- we are indeed returning a reference to
a IID struct that's allocated on the stack.

If I remove the '&' in this definition (in guidgen.h):
   template<typename T> const GUID &__wine_uuidof();
the warnings stop, but then I wonder, did the original author have some
good reasoning for returning a reference in the first place?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20120729/0df2fdee/attachment.html>

More information about the wine-devel mailing list