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

+static-analysis config, ++(warning levels) #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ariccio
Copy link

@ariccio ariccio commented Jun 5, 2015

Increased warning levels to 4, added a static analysis config.

@rpaquay
Copy link
Contributor

rpaquay commented Jun 30, 2015

Hmm, I get a bunch of C4100 errors when applying this patch (vs 2013):

1>------ Build started: Project: Native, Configuration: Release x64 ------
1>  stdafx.cpp
1>  dllmain.cpp
1>dllmain.cpp(10): warning C4100: 'lpReserved' : unreferenced formal parameter
1>dllmain.cpp(8): warning C4100: 'hModule' : unreferenced formal parameter
1>  search_base.cpp
1>d:\src\vsapps\vs-chromium\src\native\search_base.h(29): warning C4100: 'hr' : unreferenced formal parameter
1>d:\src\vsapps\vs-chromium\src\native\search_base.h(42): warning C4100: 'searchParams' : unreferenced formal parameter
1>search_base.cpp(66): warning C4127: conditional expression is constant
1>  search_boyer_moore.cpp
1>d:\src\vsapps\vs-chromium\src\native\search_base.h(29): warning C4100: 'hr' : unreferenced formal parameter
1>d:\src\vsapps\vs-chromium\src\native\search_base.h(42): warning C4100: 'searchParams' : unreferenced formal parameter

@ariccio
Copy link
Author

ariccio commented Jul 1, 2015

For the dllmain.cpp lines 8 & 10, those are legit, and can be fixed by changing:

BOOL APIENTRY DllMain(HMODULE hModule,
                      DWORD  ul_reason_for_call,
                      LPVOID lpReserved) {

to:

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

...to indicate that they're not used.

For search_base.h, lines 29 & 42, those are also legit....what's going on there??

    void SetError(HRESULT hr, const char* message) {
      this->HResult = E_OUTOFMEMORY;
      strcpy_s(this->ErrorMessage, message);
    }

...what's the point of passing hr if you're not going to use it in any way?

@rpaquay rpaquay force-pushed the master branch 2 times, most recently from 61240e9 to d846866 Compare February 15, 2018 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants