Rule A16-7-1 (required, implementation, automated)

The #pragma directive shall not be used.

Rationale

The #pragma directive is implementation-defined and causes the implementation to behave in implementation-defined manner.

Example

// $Id: A16-7-1.hpp 270497 2017-03-14 14:58:50Z piotr.tanski $
// #pragma once // Non-compliant - implementation-defined manner
#ifndef A16_7_1_HPP // Compliant - equivalent to #pragma once directive
#define A16_7_1_HPP

// ...

#endif

See also

MISRA C++ 2008 [7]: Rule 16-6-1 All uses of the #pragma directive shall be documented.