Question: I have these warnings and I don't know how to solve them.

```
warning: left-hand operand of comma has no effect
warning: right-hand operand of comma has no effect

```

Code: 

```
size_t cCsvAlias::operator [] (const char* name) const
{
    NAME2INDEX_MAP::const_iterator itr(m_Name2Index.find(Lower(name)));
    if (itr == m_Name2Index.end())
    {
        LogToFile(NULL, "cannot find suitable conversion for %s", name);
        Assert(false && "cannot find suitable conversion");
        return 0;
    }

    return itr->second;
}

```

Warnings comes from:

```
LogToFile(NULL, "cannot find suitable conversion for %s", name);

```

Thanks in advance!

EDIT:

```
#define LogToFile (void)(0);

```

Answer: 
Expand the macro manually, as the preprocessor would do for you, and you get:

```
(void) (0);(NULL, "cannot find suitable conversion for %s", name);

```

The expression in the right set of parentheses consists of three statements separated by the comma operator. The compiler is warning you that the first two have no effect. 

The comma operator stitches together multiple expressions, evaluating them in order. The comma-separated expression in the right set of parentheses evaluates to the value of the final expression in the chain of commas (`name` in this case). The first two expressions, however, (`NULL` and `"cannot find suitable conversion for "%s"`), don't actually do anything; this is what the compiler is warning you about.
You can solve the warning by replacing the macro with:

```
inline void __throw_to_dev_null(const void*, const char*, ... ) {}
#define LogToFile __throw_to_dev_null

```