Search⌘ K
AI Features

Before C++11

Explore how compiler annotations and attributes were handled before C++11. Understand the various syntax styles used by GCC, MSVC, and Clang, including __attribute__, __declspec, and pragmas. This lesson prepares you to grasp the evolution of attributes leading into modern C++.

In the era of C++98/03, each compiler introduced its own set of annotations, usually with a different keyword.

Often, you could see code with #pragma, __declspec, __attribute spread throughout the code.

Here’s the list of the common syntax from GCC/Clang and MSVC:

GCC Specific Attributes

GCC uses ...