Skip to content

OSAL does not build cleanly with conversion warnings enabled #660

@jphickey

Description

@jphickey

Is your feature request related to a problem? Please describe.
OSAL does not build cleanly if -Wconversion warnings are enabled. In the CFE builds this warning is neither enabled nor disabled so it is left with the compiler default. Most gcc cross toolchains currently used disable it by default, but with the toolchain provided in VxWorks 7 this is enabled by default, so this difference becomes apparent.

Describe the solution you'd like
First needs CCB discussion as to whether we want to be "conversion clean".

Downside is that it requires a bunch of extra type casting for things that would normally work implicitly without issue - which makes code ugly - and the casts can become outtdated/stale if the underlying type changes and that doesn't always generate a compiler message but can cause problems due to multiple conversions and/or changing for equality of wrong types. So unnecessary extra type casts can be a real risk to behavior, not just readability.

Upside is that every now and then it will identify a truncation or sign conversion issue that might be a real problem.

Once decided one way or the other, we should explicitly set the -Wconversion or -Wno-conversion setting in CFE so that it is consistent and not dependent on compiler default.

Additional context
Originally identified in #599 - split to separate issue (not limited to just VxWorks 7 - that's just what brought it up)

Requester Info
Joseph Hickey, Vantage Systems, Inc.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions