Add BUILD_WERROR option

Adds a cmake BUILD_WERROR option to enable warnings as errors. This
option is off by default.

This change also cleans up a few more compiler warnings.
This commit is contained in:
Nathaniel Cesario 2023-11-29 12:58:56 -07:00 committed by arcady-lunarg
parent 719b6b7deb
commit 3f615ad93e
6 changed files with 22 additions and 12 deletions

View file

@ -7458,7 +7458,7 @@ static void ForEachOpaque(const TType& type, const TString& path, Function callb
++flatIndex)
{
TString subscriptPath = path;
for (int dimIndex = 0; dimIndex < indices.size(); ++dimIndex)
for (size_t dimIndex = 0; dimIndex < indices.size(); ++dimIndex)
{
int index = indices[dimIndex];
subscriptPath.append("[");
@ -7468,7 +7468,7 @@ static void ForEachOpaque(const TType& type, const TString& path, Function callb
recursion(type, subscriptPath, true, recursion);
for (int dimIndex = 0; dimIndex < indices.size(); ++dimIndex)
for (size_t dimIndex = 0; dimIndex < indices.size(); ++dimIndex)
{
++indices[dimIndex];
if (indices[dimIndex] < type.getArraySizes()->getDimSize(dimIndex))
@ -7537,7 +7537,7 @@ void TParseContext::vkRelaxedRemapUniformMembers(const TSourceLoc& loc, const TP
});
}
void TParseContext::vkRelaxedRemapFunctionParameter(const TSourceLoc& loc, TFunction* function, TParameter& param, std::vector<int>* newParams)
void TParseContext::vkRelaxedRemapFunctionParameter(TFunction* function, TParameter& param, std::vector<int>* newParams)
{
function->addParameter(param);
@ -7615,7 +7615,7 @@ TIntermNode* TParseContext::vkRelaxedRemapFunctionArgument(const TSourceLoc& loc
param.type->shallowCopy(intermTyped->getType());
std::vector<int> newParams = {};
vkRelaxedRemapFunctionParameter(loc, function, param, &newParams);
vkRelaxedRemapFunctionParameter(function, param, &newParams);
if (intermTyped->getType().isOpaque())
{

View file

@ -369,7 +369,7 @@ public:
// returns true if the variable was remapped to something else
bool vkRelaxedRemapUniformVariable(const TSourceLoc&, TString&, const TPublicType&, TArraySizes*, TIntermTyped*, TType&);
void vkRelaxedRemapUniformMembers(const TSourceLoc&, const TPublicType&, const TType&, const TString&);
void vkRelaxedRemapFunctionParameter(const TSourceLoc&, TFunction*, TParameter&, std::vector<int>* newParams = nullptr);
void vkRelaxedRemapFunctionParameter(TFunction*, TParameter&, std::vector<int>* newParams = nullptr);
TIntermNode* vkRelaxedRemapFunctionArgument(const TSourceLoc&, TFunction*, TIntermTyped*);
TIntermTyped* vkRelaxedRemapDotDereference(const TSourceLoc&, TIntermTyped&, const TType&, const TString&);

View file

@ -1007,7 +1007,7 @@ function_header_with_parameters
if (!(parseContext.spvVersion.vulkan > 0 && parseContext.spvVersion.vulkanRelaxed))
$1->addParameter($2.param);
else
parseContext.vkRelaxedRemapFunctionParameter($2.loc, $1, $2.param);
parseContext.vkRelaxedRemapFunctionParameter($1, $2.param);
}
else
delete $2.param.type;
@ -1029,7 +1029,7 @@ function_header_with_parameters
if (!(parseContext.spvVersion.vulkan > 0 && parseContext.spvVersion.vulkanRelaxed))
$1->addParameter($3.param);
else
parseContext.vkRelaxedRemapFunctionParameter($3.loc, $1, $3.param);
parseContext.vkRelaxedRemapFunctionParameter($1, $3.param);
}
}
;

View file

@ -6319,7 +6319,7 @@ yyreduce:
if (!(parseContext.spvVersion.vulkan > 0 && parseContext.spvVersion.vulkanRelaxed))
(yyvsp[-1].interm.function)->addParameter((yyvsp[0].interm).param);
else
parseContext.vkRelaxedRemapFunctionParameter((yyvsp[0].interm).loc, (yyvsp[-1].interm.function), (yyvsp[0].interm).param);
parseContext.vkRelaxedRemapFunctionParameter((yyvsp[-1].interm.function), (yyvsp[0].interm).param);
}
else
delete (yyvsp[0].interm).param.type;
@ -6346,7 +6346,7 @@ yyreduce:
if (!(parseContext.spvVersion.vulkan > 0 && parseContext.spvVersion.vulkanRelaxed))
(yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param);
else
parseContext.vkRelaxedRemapFunctionParameter((yyvsp[0].interm).loc, (yyvsp[-2].interm.function), (yyvsp[0].interm).param);
parseContext.vkRelaxedRemapFunctionParameter((yyvsp[-2].interm.function), (yyvsp[0].interm).param);
}
}
#line 6353 "MachineIndependent/glslang_tab.cpp"