9.22 __declspec attributes

The __declspec keyword enables you to specify special attributes of objects and functions.

For example, you can use the __declspec keyword to declare imported or exported functions and variables, or to declare Thread Local Storage (TLS) objects.
The __declspec keyword must prefix the declaration specification. For example:
__declspec(noreturn) void overflow(void);
__declspec(thread) int i;
The following table summarizes the available __declspec attributes. __declspec attributes are storage class modifiers. They do not affect the type of a function or variable.

Table 9-2 __declspec attributes that the compiler supports, and their equivalents

__declspec attribute non __declspec equivalent
__declspec(dllexport) -
__declspec(dllimport) -
__declspec(noinline) __attribute__((noinline))
__declspec(noreturn) __attribute__((noreturn))a
__declspec(nothrow) -
__declspec(notshared) -
__declspec(thread) -
a 
A GNU compiler extension that the ARM compiler supports.
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.