Files
2025-10-25 03:02:53 +03:00

38 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[cpp.pragma.op]
# 15 Preprocessing directives [[cpp]](./#cpp)
## 15.13 Pragma operator [cpp.pragma.op]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/preprocessor.tex#L2469)
A unary operator expression of the form:
_Pragma ( [*string-literal*](lex.string#nt:string-literal "5.13.5String literals[lex.string]") )
is processed as follows: The [*string-literal*](lex.string#nt:string-literal "5.13.5String literals[lex.string]") is [*destringized*](#def:destringization "15.13Pragma operator[cpp.pragma.op]") by deleting the L prefix, if present, deleting the leading and trailing
double-quotes, replacing each escape sequence \" by a double-quote, and
replacing each escape sequence \\ by a single
backslash[.](#1.sentence-1)
The resulting sequence of characters is processed through translation phase 3
to produce preprocessing tokens that are executed as if they were the[*pp-tokens*](cpp.pre#nt:pp-tokens "15.1Preamble[cpp.pre]") in a pragma directive[.](#1.sentence-2)
The original four preprocessing
tokens in the unary operator expression are removed[.](#1.sentence-3)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/preprocessor.tex#L2483)
[*Example [1](#example-1)*:
#pragma listing on "..\listing.dir" can also be expressed as:_Pragma ( "listing on \"..\\listing.dir\"" )
The latter form is processed in the same way whether it appears literally
as shown, or results from macro replacement, as in:#define LISTING(x) PRAGMA(listing on #x)#define PRAGMA(x) _Pragma(#x) LISTING( ..\listing.dir )
— *end example*]