[New-bugs-announce] [issue20221] #define hypot _hypot conflicts with existing definition

Tabrez Mohammed report at bugs.python.org
Sat Jan 11 04:09:28 CET 2014

New submission from Tabrez Mohammed:

In pyconfig.h (line 216), there is this line:
#define hypot _hypot

This conflicts with the definition of _hypot that ships with VS2010 (math.h, line 161):
static __inline double __CRTDECL hypot(_In_ double _X, _In_ double _Y)

The result of the redefinition is that the following warning occurs during compilation:
1>c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h(162): warning C4211: nonstandard extension used : redefined extern to static

When compiling with warnings being treated as errors, this will obviously result in failed builds.

The recommendation from Microsoft (see http://connect.microsoft.com/VisualStudio/feedback/details/633988/warning-in-math-h-line-162-re-nonstandard-extensions-used) is to change the definition to:
#if _MSC_VER < 1600
#define hypot _hypot

components: Windows
messages: 207894
nosy: tabrezm
priority: normal
severity: normal
status: open
title: #define hypot _hypot conflicts with existing definition
type: compile error
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list