diff --git a/3rdparty/python-console/ParseHelper.h b/3rdparty/python-console/ParseHelper.h index d01e2627..e0fe9550 100644 --- a/3rdparty/python-console/ParseHelper.h +++ b/3rdparty/python-console/ParseHelper.h @@ -28,7 +28,7 @@ THE SOFTWARE. #include #include "ParseMessage.h" -class ParseListener; +struct ParseListener; /** Helps chunk lines of Python code into compilable statements. @@ -94,7 +94,7 @@ public: // return if there was an error bool initializeIndent(const std::string& str); }; - friend class BlockParseState; + friend struct BlockParseState; struct BracketParseState : public ParseState { diff --git a/3rdparty/python-console/modified/pyconsole.cc b/3rdparty/python-console/modified/pyconsole.cc index 186d74d2..d724553b 100644 --- a/3rdparty/python-console/modified/pyconsole.cc +++ b/3rdparty/python-console/modified/pyconsole.cc @@ -95,7 +95,7 @@ void PythonConsole::parseEvent( const ParseMessage& message ) } // interpret valid user input - int errorCode; + int errorCode = 0; std::string res; if ( message.message.size() ) res = pyinterpreter_execute( message.message, &errorCode ); diff --git a/3rdparty/python-console/modified/pyinterpreter.cc b/3rdparty/python-console/modified/pyinterpreter.cc index ee8c4aa8..f53207ad 100644 --- a/3rdparty/python-console/modified/pyinterpreter.cc +++ b/3rdparty/python-console/modified/pyinterpreter.cc @@ -38,9 +38,9 @@ static std::list m_suggestions; template std::string string_format(const std::string &format, Args... args) { - size_t size = std::snprintf(nullptr, 0, format.c_str(), args...) + 1; // Extra space for '\0' + size_t size = snprintf(nullptr, 0, format.c_str(), args...) + 1; // Extra space for '\0' std::unique_ptr buf(new char[size]); - std::snprintf(buf.get(), size, format.c_str(), args...); + snprintf(buf.get(), size, format.c_str(), args...); return std::string(buf.get(), buf.get() + size - 1); // We don't want the '\0' inside } diff --git a/CMakeLists.txt b/CMakeLists.txt index c3650a05..93ef6ada 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,8 @@ set(FAMILIES generic ice40) set(CMAKE_CXX_STANDARD 11) if (MSVC) set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE) -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /W4 /wd4100 /wd4244 /wd4125 /wd4800 /wd4456 /wd4458 /wd4305 /wd4459 /wd4121") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W4 /wd4100 /wd4244 /wd4125 /wd4800 /wd4456 /wd4458 /wd4305 /wd4459 /wd4121") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /W4 /wd4100 /wd4244 /wd4125 /wd4800 /wd4456 /wd4458 /wd4305 /wd4459 /wd4121 /wd4996") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W4 /wd4100 /wd4244 /wd4125 /wd4800 /wd4456 /wd4458 /wd4305 /wd4459 /wd4121 /wd4996") else() set(CMAKE_CXX_FLAGS_DEBUG "-Wall -fPIC -ggdb") set(CMAKE_CXX_FLAGS_RELEASE "-Wall -fPIC -O3 -g") @@ -21,6 +21,10 @@ set(CMAKE_DEFIN) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/3rdparty/sanitizers-cmake/cmake" ${CMAKE_MODULE_PATH}) +if(NOT DEFINED CMAKE_SUPPRESS_DEVELOPER_WARNINGS) + set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS 1 CACHE INTERNAL "No dev warnings") +endif() + find_package(Sanitizers) # List of Boost libraries to include diff --git a/gui/fpgaviewwidget.h b/gui/fpgaviewwidget.h index 0cd84c9c..0342bb8a 100644 --- a/gui/fpgaviewwidget.h +++ b/gui/fpgaviewwidget.h @@ -34,17 +34,17 @@ NEXTPNR_NAMESPACE_BEGIN // Vertex2DPOD is a structure of X, Y coordinates that can be passed to OpenGL // directly. -struct Vertex2DPOD +NPNR_PACKED_STRUCT(struct Vertex2DPOD { GLfloat x; GLfloat y; Vertex2DPOD(GLfloat X, GLfloat Y) : x(X), y(Y) {} -} __attribute__((packed)); +}); // Vertex2DPOD is a structure of R, G, B, A values that can be passed to OpenGL // directly. -struct ColorPOD +NPNR_PACKED_STRUCT(struct ColorPOD { GLfloat r; GLfloat g; @@ -53,7 +53,7 @@ struct ColorPOD ColorPOD(GLfloat R, GLfloat G, GLfloat B, GLfloat A) : r(R), g(G), b(B), a(A) {} ColorPOD(const QColor &color) : r(color.redF()), g(color.greenF()), b(color.blueF()), a(color.alphaF()) {} -} __attribute__((packed)); +}); // LineShaderData is a built set of vertices that can be rendered by the // LineShader.