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

__at for Function Address

void __at(0x2000) test(void)
{ int i; i++
}

This Function is right by MDK3.05, but is warning by MDK3.24?
warning:: Sources\BSP.c(50): warning: #1202-D: invalid attribute for function "test"

why?

Thank you!

Parents
  • place a function at an absolute address by giving it an attribute in the C code.

    Because I see a friend's program used the mode. but he uses the MDK3.05.
    The MDK3.05 can place a function at an absolute address by giving it an attribute in the C code.
    I think this is the easiest mode to carry out .

    I have tryed to use the MDK3.05 to place a function at an absolute address by giving it an attribute in the C code. That is OK! Just like my first description.

    So I think the MDK3.24 can do it too.
    Can you help me to do it used the MDK3.24.

    thanks for your help!

Reply
  • place a function at an absolute address by giving it an attribute in the C code.

    Because I see a friend's program used the mode. but he uses the MDK3.05.
    The MDK3.05 can place a function at an absolute address by giving it an attribute in the C code.
    I think this is the easiest mode to carry out .

    I have tryed to use the MDK3.05 to place a function at an absolute address by giving it an attribute in the C code. That is OK! Just like my first description.

    So I think the MDK3.24 can do it too.
    Can you help me to do it used the MDK3.24.

    thanks for your help!

Children
  • And what compiler is your friend using? The old CARM compiler?

    The CARM compiler manual says:
    "__at locates functions or variables to absolute memory addresses."

    But the CARM compiler is discontinued, so it doesn't matter what language extensions the CARM compiler supports unless you happen to have an old version of the compiler installed.