ident
- Date:
01-09-2012
NAME
ident, ID - Stores the indicated string into the object file
SYNOPSIS
#pragma _CRI ident text
- text
Desired string to be stored in object file.
!DIR$ ID "character_string"
- character_ string
The character string to be inserted into file.o. The syntax box shows quotation marks as the character_string delimiter, but you can use either apostrophes (’ ‘) or quotation marks (” “).
DESCRIPTION: C/C++
The ident pragma directs the compiler to store the string indicated by text into the object (.o) file. This can be used to place a source identification string into an object file.
DESCRIPTION: Fortran
The ID directive inserts a character string into the file.o produced for a Fortran source file.
This directive supports one argument:
The character_string can be obtained from file.o in one of the following ways by using the what command, the strings command, or theod command.
EXAMPLES
Example 1: ID directive with what command
The following example in Fortran demonstrates the use of the ID directive, followed by the what command to retrieve the string. To use the what command to retrieve the character string, begin the character string with the characters @(#). Assume that id.f contains the following source code:
!DIR$ ID '@(#)file.f 03 February 2009'
PRINT *, 'Hello, world'
END
The next step is to use file id.o as the argument to the what command, as follows:
% what id.o
% id.o:
% file.f 03 February 2009
Note that what does not include the special sentinel characters in the output
Note: The what command will not recognize the string unless the string begins with the characters @(#).
Example 2: ID directive with strings or od commands
The following example shows how to obtain output using the strings command. Input file id.f contains the following:
!DIR$ ID "File: id.f Date: 03 February 2009"
PRINT *, 'Hello, world'
END
The strings command generates the following output:
% strings id.o
02/03/0913:55:52f90
3.3cn
$MAIN
@CODE
@DATA
@WHAT
$MAIN
$STKOFEN
f$init
_FWF
$END
*?$F(6(
Hello, world
$MAIN
File: id.f Date: 03 February 2009
% od -tc id.o
... portion of dump deleted
0000000001600 \0 \0 \0 \0 \0 \0 \0 \n F i l e : i d
0000000001620 . f D a t e : 0 3 F e b
0000000001640 r u a r y 1 9 9 9 \0 \0 \0 \0 \0 \0
... portion of dump deleted
SEE ALSO
intro_directives(1)