GNU Attributes

From Appmethod Topics
Jump to: navigation, search

Go Up to C++ Specifics Index

Appmethod C++ supports the following GNU attributes:

  • aligned (ALIGNMENT) [documented below]
  • cdecl
  • stdcall
  • dllimport
  • dllexport
  • alias ("name")
  • const
  • constructor
  • destructor
  • eightbit_data
  • exception (EXCEPT-FUNC [, EXCEPT-ARG])
  • format (ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK)
  • format_arg (STRING-INDEX)
  • function_vector
  • interrupt
  • interrupt_handler
  • longcall
  • model (MODEL-NAME)
  • noreturn
  • regparm (NUMBER)
  • section ("section-name")
  • tiny_data
  • unused
  • weak

Note: To use the GNU attributes, compile the C++ code with the -AG flag. See Project > Options > C++ Compiler (language compliance).

aligned (ALIGNMENT)

Use this attribute to force the minimum alignment of a specific data block.

Example:

// flags: -AG
struct Coordinate
{
	int x, y, z;
};
Coordinate c __attribute__((aligned (8)));

Note: To set the general data alignment, see Project > Options > C++ Compiler..

See Also