2

I am reading the MSDN article about __declspec.

It starts with:

The extended attribute syntax for specifying storage-class information uses the __declspec keyword, which specifies that an instance of a given type is to be stored with a Microsoft-specific storage-class attribute listed below. ...

What exactly does storage-class information mean? And how does it affect the compiler?

ADD 1

Someone posted a link as comment but deleted it soon after. I found the link useful. So I add it here.

http://en.cppreference.com/w/cpp/language/storage_duration

smwikipedia
  • 61,609
  • 92
  • 309
  • 482
  • 1
    While the link to "storage duration" describes some loosely common concepts with what is described in MSDN article, this is still purely coincidental. Storage duration is a formal language-level concept. The MSDN article is about completely unrelated non-standard compiler extension. The only common point I see is `thread_local` storage duration and `__declspec(thread)` in MSDN article. – AnT stands with Russia Dec 05 '14 at 07:45

1 Answers1

2

It appears that the article uses the terms "extended attribute" and "storage-class attribute" interchangeably. These terms simply refer to the attributes that you can specify inside __declspec(...).

Each attribute has its own meaning and they are mostly unrelated to each other. You can follow the links from the article to read about what each attribute does.

AnT stands with Russia
  • 312,472
  • 42
  • 525
  • 765