Shall Rule 21.1 apply to the both paths of conditional preprocessing

Moderators: misra-c, david ward

Post Reply
chenzhuowansui
Posts: 8
Joined: Wed Feb 20, 2019 5:59 am
Company: Synopsys

Shall Rule 21.1 apply to the both paths of conditional preprocessing

Post by chenzhuowansui » Wed Mar 04, 2020 2:28 am

Hi there,
Rule 21.1 doesn't mention anything about preprocessing, so given the following code

Code: Select all

#define ABC 345

#ifdef ABC
#define _XYZ 0xFFFFFFFF    //defect1
#else
#define _XYZ 0xF0000000  //defect2
#endif
shall we report both the above defects or only the one(defec1) in the true path?

thanks

Post Reply

Return to “8.21 Standard libraries”