Skip to content

New buffer size warning in UT assert #534

@jphickey

Description

@jphickey

Describe the bug
After moving the UtAssert_DoTestSegmentReport() function, it has triggered a new warning when building with optimization enabled (BUILDTYPE=release).

/home/joe/code/cfecfs/github-cfs-bundle/osal/ut_assert/src/utassert.c:82:20: error: ‘%-20s’ directive output may be truncated writing between 20 and 127 bytes into a region of size between 117 and 125 [-Werror=format-truncation=]
   82 |              "%02u %-20s TOTAL::%-4u  PASS::%-4u  FAIL::%-4u   MIR::%-4u   TSF::%-4u   N/A::%-4u\n",

To Reproduce
Build with GCC9+ and BUILDTYPE=release flag.

Expected behavior
Should build cleanly.

System observed on:
Ubuntu 20.04

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

Metadata

Metadata

Assignees

Labels

bugunit-testTickets related to the OSAL unit testing (functional and/or coverage)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions