I have macros like:
#define INCREMENT(ip) *ip++
#define RETAIN(ip) *ip
and in code, I use them like:
*op |= INCREMENT(ip)<<15;
*op |= INCREMENT(ip)<<20 | RETAIN(ip);
My issue is, I do not get any warning for first line where as I get a warning:
"operation on ‘*ip’ may be undefined [-Wsequence-point]"
for second line.
What is it going wrong?
How should I change my macro to avoid that warning?
Note: I have several statements in code which use macros. I can't change all of them(tidious task). So, please tell me the perfect way of writing macro to avaoid that warning.