Memory Keywords And Function Arguments; Memory Keywords And Macros - Analog Devices VISUALDSP++ 3.5 Manual

C/c++ compiler and library for adsp-219x processors
Hide thumbs Also See for VISUALDSP++ 3.5:
Table of Contents

Advertisement

C/C++ Compiler Language Extensions

Memory Keywords and Function Arguments

The compiler checks calls to prototyped functions for memory space spec-
ifications consistent with the function prototype. The following example
shows sample code that
between a function prototype and a call to the function.
/* Illegal Dual Memory Support Keywords & Calls To Prototyped
Functions */
extern int foo(int pm*);
/* declare function foo() which expects a pointer to an int
residing in pm as its argument and which returns an int
int x;
/* define int x in dm
foo(&x); /* call function foo()
/* using pm pointer (location of x) as the
/* argument. cc219x FLAGS AS AN ERROR; this is an
/* inconsistency between the function's
/* declared memory space argument and function
/* call memory space argument

Memory Keywords and Macros

Using macros when making memory space specification for variables or
pointers can make your code easier to maintain. If you must change the
definition of a variable or pointer (moving it to another memory space),
declarations that depend on the definition may need to be changed to
ensure consistency between different declarations of the same variable or
pointer.
To make changes of this kind easier, you can use C preprocessor macros to
define common memory spaces that must be coordinated. The following
listing shows two code segments that are equivalent after preprocessing.
1-82
flags as inconsistent use of memory spaces
cc219x
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
*/
*/
*/
*/
*/
*/
*/
*/
for ADSP-219x DSPs

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?

Questions and answers

Related Products for Analog Devices VISUALDSP++ 3.5

Table of Contents