#4809 assigned defect

Incorrect Formatting of "!" Statements

Reported by: Daniel Páscoa Owned by: Needs Funding
Priority: normal Milestone: 7.1
Component: unspecified Version: 6
Severity: normal Keywords: qualification
Cc: Blocked By:
Blocking:

Description

Description:
The usage of the "!" operator in statements may deviate from the recommended check format of " if (ptr != NULL)" instead of "if (!ptr)". For reference, please consult the "Coding Conventions" section of the RTEMS Software Engineering. Kindly review the statement format to ensure compliance.
The attached excel lists in a systematic way the sources where this issue applies.

Additional Notes:
Although there might not be a functional problem/impact regarding expressions like "if (!ptr)" (explained in the excel attached) as this is not always obvious to everyone at first glance. So, correct these cases as in the related recommendation of the RTEMS Software Engineering document.

This ticket was raised as an outcome of the Independent SW Verification and Validation (ISVV) for ESA-promoted RTEMS SMP Qualification Data Packs (https://rtems-qual.io.esa.int). Original ISVV reference for this issue is RTEMS-SMP-CODE-VER-009.

File list (please check the attached excel for more information):
cpukit\include\rtems\score\chainimpl.h
cpukit\include\rtems\score\coremuteximpl.h
cpukit\include\rtems\score\coresemimpl.h
cpukit\include\rtems\score\heapimpl.h
cpukit\include\rtems\score\mrspimpl.h
cpukit\include\rtems\score\objectimpl.h
cpukit\include\rtems\score\schedulerimpl.h
cpukit\include\rtems\score\schedulersmpimpl.h
cpukit\include\rtems\score\threadimpl.h
cpukit\include\rtems\score\watchdogimpl.h
cpukit\libc\string\memcmp.c
cpukit\libc\string\memcpy.c
cpukit\libc\string\memset.c
cpukit\libc\string\strchr.c
cpukit\libc\string\strcmp.c
cpukit\libc\string\strlen.c
cpukit\libtest\t-test.c
cpukit\rtems\src\barriercreate.c
cpukit\rtems\src\clockgettod.c
cpukit\rtems\src\clockgetuptime.c
cpukit\rtems\src\eventreceive.c
cpukit\rtems\src\eventseize.c
cpukit\rtems\src\msgqconstruct.c
cpukit\rtems\src\partcreate.c
cpukit\rtems\src\partreturnbuffer.c
cpukit\rtems\src\ratemoncreate.c
cpukit\rtems\src\ratemonperiod.c
cpukit\rtems\src\scheduleraddprocessor.c
cpukit\rtems\src\semcreate.c
cpukit\rtems\src\signalcatch.c
cpukit\rtems\src\signalsend.c
cpukit\rtems\src\systemeventreceive.c
cpukit\rtems\src\taskconstruct.c
cpukit\rtems\src\taskmode.c
cpukit\rtems\src\tasksetpriority.c
cpukit\rtems\src\tasksetscheduler.c
cpukit\rtems\src\taskwakewhen.c
cpukit\rtems\src\timercreate.c
cpukit\rtems\src\timerserverfireafter.c
cpukit\rtems\src\timerserverfirewhen.c
cpukit\sapi\src\extensioncreate.c
cpukit\score\src\coremsgseize.c
cpukit\score\src\coremsgsubmit.c
cpukit\score\src\iovprintf.c
cpukit\score\src\kern_tc.c
cpukit\score\src\objectgetinfo.c
cpukit\score\src\scheduleredfsmp.c
cpukit\score\src\schedulerprioritychangepriority.c
cpukit\score\src\schedulerpriorityyield.c
cpukit\score\src\schedulersetaffinity.c
cpukit\score\src\smp.c
cpukit\score\src\threadchangepriority.c
cpukit\score\src\threaddispatch.c
cpukit\score\src\threadinitialize.c
cpukit\score\src\threadqenqueue.c
cpukit\score\src\threadqops.c
cpukit\score\src\threadresettimeslice.c
cpukit\score\src\threadstart.c
cpukit\score\src\threadtimeout.c
bsps\shared\dev\clock\clockimpl.h
bsps\shared\irq\irq-affinity.c
bsps\shared\irq\irq-enable-disable.c
bsps\shared\irq\irq-generic.c
bsps\shared\irq\irq-raise-clear.c
bsps\sparc\leon3\start\bspsmp.c
cpukit\score\src\rbtreeiterate.c

Attachments (1)

RTEMS-SMP-CODE-VER-009.xlsx (12.8 KB) - added by Daniel Páscoa on 01/23/23 at 10:00:55.

Download all attachments as: .zip

Change History (3)

Changed on 01/23/23 at 10:00:55 by Daniel Páscoa

Attachment: RTEMS-SMP-CODE-VER-009.xlsx added

comment:1 Changed on 01/23/23 at 10:15:49 by Sebastian Huber

Keywords: qualification added

comment:2 Changed on 01/24/23 at 10:30:12 by Sebastian Huber

Component: adminunspecified
Milestone: 7.1
Owner: set to Needs Funding
Status: newassigned
Version: 6
Note: See TracTickets for help on using tickets.