Thanks Frankie,
Here is an example attached. It demonstrates my question regarding #2046, at least the first part.
Here is a deconstructed
example.
In creating it I found there may be a bit more to the issue, as you suggested, but it still does what I suggested.
Just compile to see the #2046 warnings.
There are 4 tiny procedures named Warning_Check1-4
Warning_Check1 and Warning_Check2 show the #2046 warning moving when using or not using the return value, and when used there is no warning generated.
Warning_Check3 shows the error on both statements when not using the return value from either
Warning_Check4 is an
interesting complication because here I just change the return variable declaration type and then there are no warnings when the return is not used.
So perhaps the warning should be that the return value may be larger than the store variable declaration, but then why does using it eliminate the error message?
Building main.obj.
C:\Program Files\PellesC\Files\Hello_World\main.c(143): warning #2046: Expression with no effect removed.
C:\Program Files\PellesC\Files\Hello_World\main.c(161): warning #2046: Expression with no effect removed.
C:\Program Files\PellesC\Files\Hello_World\main.c(181): warning #2046: Expression with no effect removed.
C:\Program Files\PellesC\Files\Hello_World\main.c(183): warning #2046: Expression with no effect removed.
Done.
John Z
"You learn more from your mistakes than from your successes."