MISRA Rule 14.3

PC-lint Plus User Discussion
Post Reply
AlainI

MISRA Rule 14.3

Post by AlainI »

PC Lint 1.2 gives me the following message:

info 774: boolean condition for 'while' always evaluates to 'true' [MISRA 2012 Rule 14.3, required]
while (true) {
^
This is a false positive since MISRA 2012 Rule 14.3 explicitly have an exception for while(true).
Gimpel
Site Admin
Posts: 1
Joined: Mon Sep 17, 2018 2:21 pm

Re: MISRA Rule 14.3

Post by Gimpel »

Hello,

Thank you for your report. Are you sure you're using 1.2 and not 1.1? This is issue ID PCLP-2180 which was corrected in version 1.2.

In version 1.1 PC-lint Plus emitted:

Code: Select all

info 774: boolean condition for 'while' always evaluates to 'true'
void f() { while (true) { } }
           ^
PC-lint Plus 1.2 was updated to instead emit:

Code: Select all

info 716: infinite loop via while
void f() { while (true) { } }
           ^
Post Reply