..\display.h(72): warning: #231-D: declaration is not visible outside of function
I got message when I included a header file containing this line:
void DISPLAY_string_date_time(const struct tm * tim, DISPLAY_MSG * p_message);
I found the problem - I hadn't included <time.h> in the two cases that caused the warning.
After a lot of searching for what this warning means, I can't find any explanation.
Can anyone translate what the compiler is saying?
I don't understand why I wouldn't just get an "Identifier undefined" type of error.
The function prototype declaration does not require knowledge about the size of "struct tm", so is allowed without the complete structure type definition being in scope. An error diagnostic would be unwarranted in this case (but compilers are allowed to warn about anything).
You are right.
The compiler makes a difference between:
int function(struct tm* t);
and
struct tm; int function(struct tm* t);
I haven't thought about this case before. I always have the second alternative, if I need to make use of a struct or class pointer without letting the header file see the full definition.
Thanks Dan.
That makes perfect sense now. Life would be simpler if there were a place where the error message was explained with the two paragraphs you just wrote.
Yes, indeed - this has been noted before!
eg, my post of 4-Sep-2009 17:22 GMT in this thread: http://www.keil.com/forum/docs/thread15484.asp