This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

os_tsk_create_user definition

Hi !

In Keil os_tsk_create_user() doc it passes a void* for the stack parameter, but in the example (and example code in uVision) we do the following :

static U64 stk2[400/8];
...
os_tsk_create_user (task2, 1, &stk2, sizeof(stk2));
...


If I am right typeof &stk2 is U64 **.
As the test work I think the definition is wrong.

www.keil.com/.../rlarm_os_tsk_create_user.htm

Parents
  • If I am right typeof &stk2 is U64 **.

    You're not right. The type of &stk2 is pointer to array of 50 U64, or in code: U64(*)[50].

    You seem to have fallen prey to the misconception (taught by unbelievably many, unbelievably bad C textbooks) that arrays and pointers were the same thing. They're not.

Reply
  • If I am right typeof &stk2 is U64 **.

    You're not right. The type of &stk2 is pointer to array of 50 U64, or in code: U64(*)[50].

    You seem to have fallen prey to the misconception (taught by unbelievably many, unbelievably bad C textbooks) that arrays and pointers were the same thing. They're not.

Children