Author palotasb-conti
Recipients matrixise, palotasb-conti, paul.moore, steve.dower, tim.golden, zach.ware
Date 2019-02-18.12:03:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I have the following internal, almost-minimal test case for this bug. It also relies on Boost Python, but that could be eliminated to produce a similar test case.

# CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
find_package(Boost COMPONENTS python36 REQUIRED)
find_package(Python3 COMPONENTS Development REQUIRED)
target_link_libraries(python-boost-mcve PUBLIC Python3::Python Boost::python36)
target_sources(python-boost-mcve PUBLIC

// python-boost-mcve.cpp
// 1. This is a bug with MSVC Python
#if !defined(_MSC_VER) || _MSC_VER < 1900
#  error "The MCVE requires Visual Studio 14.0 or higher"
// 2. An MSVC system header is required to reproduce the error for some reason,
// perhaps it sets some macro. This needs to be BEFORE <boost/python.hpp>
#include <array>
// 3. Boost Python is required to include the system (MSVC) Python headers that
// define _snprintf as a macro under the circumstances
// #define HAVE_SNPRINTF // Define this macro as a workaround to fix the compile error
#include <boost/python.hpp>
// 4. Now we can observe that the following function won't compile
#include <cstdio>
void test() {
    char buf[2];
    std::snprintf(buf, 1, "x");
    // error C2039: '_snprintf': is not a member of 'std' [python-boost-mcve.vcxproj]
Date User Action Args
2019-02-18 12:03:41palotasb-contisetrecipients: + palotasb-conti, paul.moore, tim.golden, zach.ware, steve.dower, matrixise
2019-02-18 12:03:41palotasb-contisetmessageid: <>
2019-02-18 12:03:41palotasb-contilinkissue36020 messages
2019-02-18 12:03:41palotasb-conticreate