Keil Logo

ARMCC: STATIC FUNCTION POINTERS


Information in this article applies to:RealView Microporcessor Development Kit - All Versions


SYMPTOM

The following code will not compile under RealView:

Void (*MyFunc) (void) = 0x6000;

CAUSE

The RealView C compiler is quite particular about symbol types.  It does not automatically cast an integer constant to a code pointer.

RESOLUTION

To make sure the types of your pointer and constant agree, define a new type, and then use that to declare your pointer and constant.  For example:

typedef void (*t_funcPtr)(void);
t_funcPtr MyFunc = (t_funcPtr)0x6000;

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Wednesday, November 15, 2006


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.