MISRA C:2023 Rule 20.12
A macro parameter used as an operand to the # or ## operators, which is itself subject to further macro replacement, shall only be used as an operand to these operators
R2024a 以降
説明
ルール定義
A macro parameter used as an operand to the # or ## operators, which is itself subject to further macro replacement, shall only be used as an operand to these operators 1 .
根拠
# または ## へのパラメーターは使用前に展開されていません。置換テキスト内で別の場所に表示される同じパラメーターは展開されています。マクロ パラメーター自身がマクロ置換の影響を受ける場合、マクロ置換内の混在したコンテキストで使用されるのは開発者の意図に沿わない可能性があります。
トラブルシューティング
ルール違反を想定していてもその違反が表示されない場合、コーディング規約違反が想定どおりに表示されない理由の診断を参照します。
チェック情報
| グループ: プリプロセッサ命令 |
| カテゴリ: 必要 |
| AGC カテゴリ: 必要 |
バージョン履歴
R2024a で導入
1 All MISRA coding rules and directives are © Copyright The MISRA Consortium Limited 2021.
The MISRA coding standards referenced in the Polyspace® Bug Finder™ documentation are from the following MISRA standards:
MISRA C:2004
MISRA C:2012
MISRA C:2023
MISRA C++:2008
MISRA C++:2023
MISRA and MISRA C are registered trademarks of The MISRA Consortium Limited 2021.