4.2.3 #pragma directive

Below are #pragma directives supported as extended language specifications.

Table 4.15

List of Supported #pragma Directive

#pragma directive

Definition

#pragma section attribute-strings "section-name"

Data or program memory allocation

#pragma section attribute-strings

#pragma section [character string]

#pragma inline_asm [(]function-name[(size=numerical value)][,...][)]

Description with assembler instruction

#pragma inline [(]function-name[, function-name ...][)]

Inline expansion

#pragma noinline [(]function-name[, function-name, ...][)]

#pragma interrupt [(]function-name[(interrupt specification [, interrupt specification]...)] [,...] [)]

Interrupt/Exception handler specification

#pragma block_interrupt [(]function-name[)]

Interrupt disable function specification

#pragma pack [(][1|2|4][)]

Structure type packing specification

#pragma bit_order [{left|right}]

Bit field assignment

#pragma pmodule pm-specification

Core number specification (for a multi-core device)

#pragma align4 [(]function-name[(spec)][)]

Specifying alignment value for branch destination addresses

#pragma stack_protector [(]function-name[(num=value)][)]

Detection of stack smashing

[Professional Edition only]

#pragma no_stack_protector [(]function-name[)]

(1)

Data or program memory allocation

Allocates variables to an arbitrary section.

For details about the allocation method, see "4.2.4.1 Allocation of data and program to section".

(2)

Description with assembler instruction

Assembler directives can be described in a C source program.

For the details of description, see "4.2.4.2 Describing assembler instruction".

(3)

Inline expansion

(a)

Inline expansion specification

A function that is expanded inline can be specified.

For the details of expansion specification, see "4.2.4.3 Inline expansion".

(b)

Specifying functions ineligible for inline expansion

You can specify that a function is not eligible for inline expansion.

See "4.2.4.3 Inline expansion" for details about specifying functions to be ineligible for inline expansion.

(4)

Interrupt/Exception handler specification

Interrupt/Exception handlers are described in C language.

For details, see "(3) Describing interrupt/exception handler".

#pragma interrupt   [(]function-name[(interrupt specification [,interrupt specification]...)] [,...] [)]

(5)

Interrupt disable function specification

Interrupts are disabled for the entire function.

For details, see "(2) Disabling interrupts in entire function".

#pragma block_interrupt [(]function-name[)]

(6)

Structure type packing specification

Specifies the packing of a structure type. The packing value, which is an alignment value of the member, is specified as the numeric value. A value of 1, 2, 4 can be specified. When the numeric value is not specified, the setting is the default alignment.

For details, see "4.2.4.8 Structure type packing".

#pragma pack [(][1|2|4][)]

(7)

Bit field assignment

CC-RH can switch the order of a bit field.Specifies the switching the order of a bit field.

For details, see "4.2.4.9 Bit field assignment".

#pragma bit_order [{left|right}]

(8)

Core number specification (for a multi-core device)

A function to which a core number is to be assigned can be specified.

For details, see "4.2.4.10 Core number specification (for a multi-core device)".

#pragma pmodule pm-specification

(9)

Specifying alignment value for branch destination addresses

This specifies the alignment value for branch destination addresses.

For details, see "4.2.4.11 Specifying alignment value for branch destination addresses".

#pragma align4 [(]function-name[(spec)][)]

(10)

Detection of stack smashing [Professional Edition only]

(a)

Specifying function to generate code for detection of stack smashing

This specifies a function for generating a code for detection of stack smashing.

For details, see "4.2.4.12 Detection of stack smashing [Professional Edition only]".

#pragma stack_protector [(]function-name[(num=value)][)]

(b)

Specifying function not to generate code for detection of stack smashing

This specifies a function for not generating a code for detection of stack smashing.

For details, see "4.2.4.12 Detection of stack smashing [Professional Edition only]".

#pragma no_stack_protector [(]function-name[)]