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

Some warnings in VC++ #62

Open
greenozon opened this issue Apr 2, 2024 · 0 comments
Open

Some warnings in VC++ #62

greenozon opened this issue Apr 2, 2024 · 0 comments

Comments

@greenozon
Copy link

tried to build a POC, got some warnings,
would be nice to get it down to 0!? :)

Build started...
1>------ Build started: Project: Lazy_importer_POC, Configuration: Debug x64 ------
1>Lazy_importer_POC.cpp
1>C:\Users\user\source\repos\Lazy_importer_POC\lazy_importer.hpp(658,1): warning C4127: conditional expression is constant
1>C:\Users\user\source\repos\Lazy_importer_POC\lazy_importer.hpp(658,1): message : consider using 'if constexpr' statement instead
1>C:\Users\user\source\repos\Lazy_importer_POC\Lazy_importer_POC.cpp(14): message : see reference to function template instantiation 'F (__cdecl *li::detail::lazy_function<1255338670209748596,BOOL (__cdecl *)(LPVOID,SIZE_T,DWORD,PDWORD)>::in<T,false,void*>(Module) noexcept)(LPVOID,SIZE_T,DWORD,PDWORD)' being compiled
1>        with
1>        [
1>            F=BOOL (__cdecl *)(LPVOID,SIZE_T,DWORD,PDWORD),
1>            T=BOOL (__cdecl *)(LPVOID,SIZE_T,DWORD,PDWORD),
1>            Module=void *
1>        ]
1>C:\Users\user\source\repos\Lazy_importer_POC\Lazy_importer_POC.cpp(14): message : see reference to function template instantiation 'F (__cdecl *li::detail::lazy_function<1255338670209748596,BOOL (__cdecl *)(LPVOID,SIZE_T,DWORD,PDWORD)>::in<T,false,void*>(Module) noexcept)(LPVOID,SIZE_T,DWORD,PDWORD)' being compiled
1>        with
1>        [
1>            F=BOOL (__cdecl *)(LPVOID,SIZE_T,DWORD,PDWORD),
1>            T=BOOL (__cdecl *)(LPVOID,SIZE_T,DWORD,PDWORD),
1>            Module=void *
1>        ]
1>C:\Users\user\source\repos\Lazy_importer_POC\lazy_importer.hpp(662,1): warning C4127: conditional expression is constant
1>C:\Users\user\source\repos\Lazy_importer_POC\lazy_importer.hpp(662,1): message : consider using 'if constexpr' statement instead
1>C:\Users\user\source\repos\Lazy_importer_POC\lazy_importer.hpp(666,1): warning C4127: conditional expression is constant
1>C:\Users\user\source\repos\Lazy_importer_POC\lazy_importer.hpp(666,1): message : consider using 'if constexpr' statement instead

POC app:

#include <Windows.h>
#include <iostream>
#include "lazy_importer.hpp"

int main()
{
    std::cout << "Hello World!\n";

    LI_FN(OutputDebugStringA)("hello world");
    LI_FN(VirtualProtect).in(LI_MODULE("kernel32.dll").cached());
}

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

No branches or pull requests

1 participant