#4831 assigned defect

#pragmas to ignore warnings

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

Description

Description:
There are #pragmas to ignore warnings but comments do not explain why it is safe for one to explicitly ignore those. Comments shall be updated as to explain why one can ignore the warnings rather than just listing what #pragmas do.

Additional Notes:
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-052.

File list:
cpukit\include\rtems\confdefs\inittask.h (lines 100 - 112)

Change History (2)

comment:1 Changed on 01/27/23 at 19:13:02 by Sebastian Huber

The comment and pragma list is

/*
 * Ignore the following warnings from g++ and clang in the uses of
 * _CONFIGURE_ASSERT_NOT_NULL() below:
 *
 * warning: the address of 'void Init()' will never be NULL [-Waddress]
 *
 * warning: comparison of function 'Init' not equal to a null pointer is always
 * true [-Wtautological-pointer-compare]
 */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waddress"
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wtautological-pointer-compare"

The name of the macro _CONFIGURE_ASSERT_NOT_NULL suggests that it asserts that the parameter is not NULL. So, if you have a non-NULL parameter, everything is fine. However, in this case you get the warnings. So, these warnings are disabled by the pragmas. What is the problem?

comment:2 Changed on 01/28/23 at 17:24:25 by Sebastian Huber

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