This rule is part of MISRA C++:2023.
Usage of this content is governed by Sonar’s terms and conditions. Redistribution is
prohibited.
Rule 19.6.1 - The #pragma directive and the _Pragma operator should not be used
[cpp.pragma] Implementation 1
[cpp.pragma.op] 1
Category: Advisory
Analysis: Decidable, Single Translation Unit
Rationale
The effects of the #pragma directive and the _Pragma operator are implementation-defined.
Example
#pragma once // Non-compliant
#define P( x ) _Pragma( #x ) // Non-compliant
_Pragma( "once" ) // Non-compliant
Copyright The MISRA Consortium Limited © 2023