pragma ident

#pragma ident is a non-standard pragma, supported by most Unix compilers, which adds an identification string to the compiled object. #pragma ident is typically used to include version information for source files (e.g. a version control identifier).

When combined with @(#), these strings can be extracted from an object or executable with the what command.

Example: #pragma ident "%W% %E% %U%" /* typical SCCS id string; %W% expands to @(#) followed by filename */

Some operating systems (such as 4BSD-derived Unixes) support the __RCSID macro, defined in , with a similar purpose (typically implemented as a static const char*).

Compilers supporting #pragma ident:
 * Intel C/C++ compiler
 * DEC C
 * HP cc
 * Sun Studio