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

Fix a warning: 'ex' unreferenced local variable #783

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

Conversation

fengga
Copy link

@fengga fengga commented Feb 24, 2021

This is a

  • Bugfix

I have

After I updated easylogging from v9.96.7 to v9.97.0, this code:
catch(std::exception & ex){
// Extremely low memory situation; don't let exception be unhandled.
}
will generate a warning:
warning C4101: 'ex': unreferenced local variable
and our build will fail.

@simoc
Copy link

simoc commented Apr 1, 2022

I would also like this Pull Request included in the next version of Easylogging++.

I have the same problem compiling with Visual Studio 2019 and this Pull Request solves the problem.

A simple test program using the master version of Easylogging++ demonstrates the problem:

C:\Git_Repos\easyloggingpp\src>cl /EHsc /W4 test783.cpp easylogging++.cc
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29112 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

test783.cpp
easylogging++.cc
easylogging++.cc(2657): warning C4101: 'ex': unreferenced local variable
Generating Code...
Microsoft (R) Incremental Linker Version 14.27.29112.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:test783.exe
test783.obj
easylogging++.obj

@simoc
Copy link

simoc commented May 6, 2022

@yanchoyanev are you able to merge this Pull Request to master?

@DominionSoftware
Copy link
Contributor

Hi
please merge this to master

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.

4 participants