Delen via


Compilerfout C2479

'identificator' : 'allocate( )' is alleen geldig voor gegevensitems van statische omvang

Opmerkingen

De __declspec( allocate()) syntaxis kan alleen worden gebruikt voor statische gegevens.

Example

In het volgende voorbeeld wordt C2479 gegenereerd:

// C2479.cpp
// compile with: /c
#pragma section("mycode", read)
static __declspec(allocate("mycode")) void DoNothing() {}   // C2479
__declspec(allocate("mycode"))  int i = 0;   // OK