Skip to content

strict aliasing warning in EsifApplicationInterface.cpp #5

Open
@vapier

Description

@vapier

building the project for CrOS yields this warning:

 * /build/x86-alex/tmp/portage/sys-power/dptf-8.0.5-r1/work/dptf-8.0.5/Products/DPTF/Sources/Manager/Manager/EsifApplicationInterface.cpp:86:65:
    warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

indeed the line in question is broken:

UInt32 getUInt32FromEsifDataGuidEvent(const esif::EsifDataPtr esifDataPtr) {
    ...
    UInt32 value = *((UInt32*)(esifDataGuidEvent->event_context));

probably want to use a union to avoid the issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions