ARM Technical Support Knowledge Articles

STATIC FUNCTION POINTERS

Applies to: RealView C Compiler

Answer


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;


Article last edited on: 2006-11-15 10:08:02

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential