Fix "expression result unused" warning

This macro was expecting that parenthesis used in the macro would be
removed during macro expansion, when they are not removed. The result was
a function call like this:

```cpp
AZ_Assert(g_SymGetSearchPath != 0, ("Can not load %s function!","SymGetSearchPath"));
```

The parenthesis cause the contents of the parenthsis to be evaluated first,
and the result is an expression using the comma operator. The comma
operator evaluates the left expression, discards the result, then
evaluates the right expression, and returns that. So the above dropping
the message, and just leaving:

```cpp
AZ_Assert(g_SymGetSearchPath != 0, "SymGetSearchPath");
```

Signed-off-by: Chris Burel <burelc@amazon.com>
monroegm-disable-blank-issue-2
Chris Burel 4 years ago
parent 27abad7564
commit cff6fb97af

@ -140,7 +140,7 @@ namespace AZ {
SymRegisterCallback64_t g_SymRegisterCallback64;
HMODULE g_dbgHelpDll;
#define LOAD_FUNCTION(A) { g_##A = (A##_t)GetProcAddress(g_dbgHelpDll, #A); AZ_Assert(g_##A != 0, ("Can not load %s function!",#A)); }
#define LOAD_FUNCTION(A) { g_##A = (A##_t)GetProcAddress(g_dbgHelpDll, #A); AZ_Assert(g_##A != 0, "Can not load %s function!",#A); }
using namespace AZ::Debug;

Loading…
Cancel
Save