Difference between revisions of "Studio:How do I apply an SCL pragma to an array?"

From STRIDE Wiki
Jump to: navigation, search
Line 13: Line 13:
  
  
[[Category:SCL]]
+
[[Category:Application Notes]]

Revision as of 17:38, 4 February 2008

To apply an SCL pragma to an array, treat the array as if it was declared as a pointer and use pointer-type syntax. For example:

typedef unsigned char BOOL;
#define TRUE 1
#define FALSE 0
typedef struct
{
BOOL list[5];
int type;
} S_T;

int foo(BOOL flag, S_T p);

#pragma scl_function(foo)
#pragma scl_values(*S_T.list, TRUE, FALSE)