Remove various warning suppression pragmas

This requires a small change to to use strncpy() instead of strcpy(),
as well as change of include paths to not use "..". The other warnings
are just not being hit anymore.
This commit is contained in:
Arcady Goldmints-Orlov 2023-11-30 10:50:12 -05:00 committed by arcady-lunarg
parent a1138bacff
commit e854c8de10
5 changed files with 1476 additions and 1514 deletions

View file

@ -48,14 +48,9 @@
#ifndef __INTERMEDIATE_H #ifndef __INTERMEDIATE_H
#define __INTERMEDIATE_H #define __INTERMEDIATE_H
#if defined(_MSC_VER) && _MSC_VER >= 1900 #include "Common.h"
#pragma warning(disable : 4464) // relative include path contains '..' #include "Types.h"
#pragma warning(disable : 5026) // 'glslang::TIntermUnary': move constructor was implicitly defined as deleted #include "ConstantUnion.h"
#endif
#include "../Include/Common.h"
#include "../Include/Types.h"
#include "../Include/ConstantUnion.h"
namespace glslang { namespace glslang {

View file

@ -110,13 +110,6 @@ using namespace glslang;
%{ %{
/* windows only pragma */
#ifdef _MSC_VER
#pragma warning(disable : 4065)
#pragma warning(disable : 4127)
#pragma warning(disable : 4244)
#endif
#define parseContext (*pParseContext) #define parseContext (*pParseContext)
#define yyerror(context, msg) context->parserError(msg) #define yyerror(context, msg) context->parserError(msg)

File diff suppressed because it is too large Load diff

View file

@ -86,11 +86,6 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../ParseHelper.h" #include "../ParseHelper.h"
#include "PpTokens.h" #include "PpTokens.h"
/* windows only pragma */
#ifdef _MSC_VER
#pragma warning(disable : 4127)
#endif
namespace glslang { namespace glslang {
class TPpToken { class TPpToken {

View file

@ -42,28 +42,14 @@ const glslang_resource_t* glslang_default_resource(void)
return reinterpret_cast<const glslang_resource_t*>(GetDefaultResources()); return reinterpret_cast<const glslang_resource_t*>(GetDefaultResources());
} }
#if defined(__clang__) || defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
const char* glslang_default_resource_string() const char* glslang_default_resource_string()
{ {
std::string cpp_str = GetDefaultTBuiltInResourceString(); std::string cpp_str = GetDefaultTBuiltInResourceString();
char* c_str = (char*)malloc(cpp_str.length() + 1); char* c_str = (char*)malloc(cpp_str.length() + 1);
strcpy(c_str, cpp_str.c_str()); strncpy(c_str, cpp_str.c_str(), cpp_str.length() + 1);
return c_str; return c_str;
} }
#if defined(__clang__) || defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(_MSC_VER)
#pragma warning(pop)
#endif
void glslang_decode_resource_limits(glslang_resource_t* resources, char* config) void glslang_decode_resource_limits(glslang_resource_t* resources, char* config)
{ {
DecodeResourceLimits(reinterpret_cast<TBuiltInResource*>(resources), config); DecodeResourceLimits(reinterpret_cast<TBuiltInResource*>(resources), config);