I found that it was necessary to put a "static" below:
static int testGenericBlockDeviceRequest(void)
{
int ret;
int x;
int y;
static PB_1560 parm_block;
char *p=&parm_block;
Why is that? And why didn't the compiler (TC++ 1.01)
complain about it if it is wrong?
TC++ 1.01 sounds like a C++ compiler. That's OK if you were using it in
a mode where it was working as a C compiler; otherwise, you're likely to
get better answers to your question in comp.lang.c++.
PB_1560 is presumably a typedef. What is a typedef for?
There's two different occurrences of 'static' in that code. Which one
are you referring to?
If the compiler didn't complain, then you reached the conclusion that
'static' was needed based upon some evidence other than a compiler error
message. What was that evidence?
With an appropriate typedef of PB_1560, either or both of the
occurrences of 'static' could be removed from your code, and it could
still be part of a perfectly reasonable program, which is probably why
your compiler didn't complain. Of course, removing either one would
change the meaning of the program, and that difference in meaning could
cause problems, but that depends upon what the rest of your program does
with testGenericBlockDeviceRequest(). What was the problem you had,
which you fixed by inserting 'static'?