[issue20221] #define hypot _hypot conflicts with existing definition

Brecht Van Lommel report at bugs.python.org
Thu Jan 23 20:52:22 CET 2014


Brecht Van Lommel added the comment:

We have a similar issue in Blender (where Python is embedded), but it's actually causing a crash instead of only a compiler warning: https://developer.blender.org/T38256

The code in the Visual Studio 2013 math.h looks like this:

__inline double __CRTDECL hypot(_In_ double _X, _In_ double _Y)
{
    return _hypot(_X, _Y);
}

With the #define hypot _hypot that becomes:

__inline double __CRTDECL _hypot(_In_ double _X, _In_ double _Y)
{
    return _hypot(_X, _Y);
}

So you get infinite recursive calls when using hypot and the application crashes. The patch fix20221.patch that was attach here solves the issue.

----------
nosy: +Brecht.Van.Lommel

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20221>
_______________________________________


More information about the Python-bugs-list mailing list