[RTEMS Project] #4815: Function defined in header file

RTEMS trac trac at rtems.org
Mon Jan 23 11:37:56 UTC 2023


#4815: Function defined in header file
----------------------------+--------------------
  Reporter:  Daniel Páscoa  |      Owner:  (none)
      Type:  defect         |     Status:  new
  Priority:  normal         |  Milestone:
 Component:  admin          |    Version:
  Severity:  normal         |   Keywords:
Blocked By:                 |   Blocking:
----------------------------+--------------------
 **Description:**
 The functions found in the file bsps\shared\cache\cacheimpl.h should not
 be defined in this location. These functions have already been declared in
 cpukit/include/rtems/rtems/cache.h, so their definition should not be
 placed in a header file. Even though it is an *impl.h file, this type of
 file is intended for the definition of inline functions only, not for
 static functions, as per page 163 of RTEMS Software Engineering. To comply
 with the guidelines, please consider declaring the functions in a header
 file and defining them in a source file, as outlined in section 6.3.1.4 of
 the RTEMS Software Engineering.

 It is recommended to declare and define the static function
 Clock_driver_timecounter_tick, located in the file
 bsps\shared\dev\clock\clockimpl.h, at the start of a source file rather
 than a header file. This is in accordance with the guidelines outlined on
 page 163 of RTEMS Software Engineering. To comply with these guidelines,
 consider moving the declaration and definition of the function to the
 start of a source file instead of keeping it in the header file.

 It has also been noticed that the global functions present in the file
 cpukit\include\rtems\confdefs\newlib.h and the global functions void
 Clock_isr, rtems_isre Clock_isr and _Clock_Initialize from file
 bsps\shared\dev\clock\clockimpl.h are declared and defined in a header
 file. It is recommended to consider separating the declaration and
 definition of these functions by declaring them in a header file and
 defining them in a source file. Alternatively, if appropriate, they can be
 set as inline functions.

 The attached excel lists in a systematic way the sources where this issue
 applies.

 **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-026.

 **File list (please check the attached excel for more information):**
 bsps\shared\cache\cacheimpl.h
 bsps\shared\dev\clock\clockimpl.h
 cpukit\include\rtems\confdefs\newlib.h

--
Ticket URL: <http://devel.rtems.org/ticket/4815>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list