28-04-2014, 03:13 PM
Sorry about the late reply, I have been away from this code for a long time, due to being put on more urgent projects. Now I'm back to it, and I have my code working, using the declarations recommended above.
The Lint message was a warning, not an error, and says the usage was "suspicious", not wrong. Gimpel's documentation says that taking the address of an array name (which is itself an address, as you say) used to be officially illegal, as opposed to benign. But it goes on to say
So I think adding the directive to suppress this warning to std.lnt is the correct thing to do here, and that is what I have done.
Thanks again
Frank
The Lint message was a warning, not an error, and says the usage was "suspicious", not wrong. Gimpel's documentation says that taking the address of an array name (which is itself an address, as you say) used to be officially illegal, as opposed to benign. But it goes on to say
Quote:...given
int a[10];
int (*p) [10];
Then a and &a, as pointers, both represent the same bit pattern, but whereas a is a pointer to int, &a is a pointer to an array of 10 integers. Of the two only &a may be assigned to p without complaint. If you are using the & operator in this way, we recommend that you disable this message.
So I think adding the directive to suppress this warning to std.lnt is the correct thing to do here, and that is what I have done.
Thanks again
Frank
<t></t>