Skip to main content

IAR Embedded Workbench for RISC-V 3.40

MISRAC++2023-7.11.1 (C++ only)

In this section:
Synopsis

(Required) nullptr shall be the only form of the null-pointer-constant

Enabled by default

Yes

Severity/Certainty

Medium/Medium

mediummedium.png
Full description

NULL or 0 used instead of nullptr

Coding standards

This check does not correspond to any coding standard rules.

Code examples

The following code example fails the check and will give a warning:

void* example() {
  return 0;
}

The following code example passes the check and will not give a warning about this issue:

void* example() {
  return nullptr;
}