Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable warnings as error and W4 on MSVC #83

Merged
merged 1 commit into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
target_compile_options(${PICT_BUILD_OPTIONS}
INTERFACE
/W3
/W4 /WX
/wd4189 # DOUT(arg) has unused parameters. Suppressing the warning here.
)

target_compile_definitions(${PICT_BUILD_OPTIONS}
Expand Down
2 changes: 1 addition & 1 deletion api-usage/pictapi-sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ void __cdecl wmain()
PICT_RET_CODE ret = PICT_SUCCESS;

PICT_HANDLE task = PictCreateTask();
checkNull( task );

//
// In a general case, models might form a tree-like hierarchy
// Let's try with only one model for now, pairwise is default
//

PICT_HANDLE model = PictCreateModel();
checkNull( task );
checkNull( model );

//
Expand Down
2 changes: 1 addition & 1 deletion api/generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class Exclusion
}

// for inserter() to work we need two-param insert
iterator insert( iterator pos, const ExclusionTerm& Term )
iterator insert( iterator, const ExclusionTerm& Term )
{
return insert( Term ).first;
}
Expand Down
3 changes: 0 additions & 3 deletions cli/ctokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,6 @@ RelationType ConstraintsTokenizer::getRelationType()
else throw CSyntaxError( SyntaxErrorType::UnknownRelation, _currentPosition );
}
else throw CSyntaxError( SyntaxErrorType::UnknownRelation, _currentPosition );

assert( false );
return ( RelationType::Unknown );
}

//
Expand Down
3 changes: 2 additions & 1 deletion cli/gcdmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ ErrorCode CGcdData::TranslateToGCD()
{
CModelParameter& param = _modelData.Parameters[ index ];

Parameter* gcdParam = new Parameter( UNDEFINED_ORDER, index, static_cast<int>( param.Values.size() ),
Parameter* gcdParam = new Parameter( UNDEFINED_ORDER, static_cast<int>(index),
static_cast<int>( param.Values.size() ),
param.Name, param.IsResultParameter );

// find out and assign weights to values
Expand Down
2 changes: 1 addition & 1 deletion cli/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class CModelParameter
CModelParameter() :
Name(L""),
IsResultParameter(false),
Order(UNDEFINED_ORDER),
Order(static_cast<unsigned int>(UNDEFINED_ORDER)),
GcdPointer(nullptr){}

int GetValueOrdinal( IN std::wstring& name, IN bool caseSensitive );
Expand Down
2 changes: 1 addition & 1 deletion cli/mparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ bool CModelData::readParameter( wstring& line )

wstring name = trim( line.substr( 0, paramSep ));

unsigned int order = UNDEFINED_ORDER;
unsigned int order = static_cast<unsigned int>(UNDEFINED_ORDER);

//check if this param has custom-order defined
wstrings nameAndOrder;
Expand Down
4 changes: 2 additions & 2 deletions clidll/dllmain.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#if defined(_WIN32)
#include "windows.h"

BOOL APIENTRY DllMain( HMODULE hModule,
BOOL APIENTRY DllMain( HMODULE /*hModule*/,
DWORD ul_reason_for_call,
LPVOID lpReserved
LPVOID /*lpReserved*/
)
{
switch (ul_reason_for_call)
Expand Down