easyloggingpp icon indicating copy to clipboard operation
easyloggingpp copied to clipboard

Fix a warning: 'ex' unreferenced local variable

Open fengga opened this issue 4 years ago • 4 comments
trafficstars

This is a

  • [x] Bugfix

I have

  • [x] Run the tests

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.

fengga avatar Feb 24 '21 23:02 fengga

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 avatar Apr 01 '22 15:04 simoc

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

simoc avatar May 06 '22 19:05 simoc

Hi please merge this to master

DominionSoftware avatar Nov 10 '22 15:11 DominionSoftware