Skip to main content

IAR Embedded Workbench for RX 5.20

__as_make_bounds

In this section:
Syntax
__as_make_bounds(ptr, number)
__as_make_bounds(ptr, base, bound)
Parameters

ptr

A pointer that has no bounds.

number

The number of elements.

base

The start of the object pointed to.

bound

The end of the object pointed to.

Description

Use this operator to create a pointer with bounds information. Use the first syntax to create the bounds ptr up to ptr + size for ptr. The second syntax has explicit bounds. base is a pointer to the first element of the area. bound is a pointer to just beyond the area. Except that each expression will be evaluated only once, the two-parameter variant is equivalent to __as_make_bounds(ptr, ptr, ptr + size).

Example
/* Starting here, p points to a single element */
p = __as_make_bounds(p, 1);
/* Call fun with a pointer with the specified bounds */
fun(__as_make_bounds(q, start, end));