Skip to content

Q_UNREACHABLE_RETURN Macro not available on Ubuntu 24.04 QT6 #157

@Simsys

Description

@Simsys

Qt Documentation says "Tells the compiler that the current point cannot be reached by any execution, so it may optimize any code paths leading here as dead code, as well as code continuing from here..." "...The advantage of inserting Q_UNREACHABLE() at that point is that the compiler is told not to generate code for a shape variable containing that value. If the macro is missing, the compiler will still generate the necessary comparisons for that value. If the case label were removed, some compilers could produce a warning that some enum values were not checked."

I could not compile QHexEdit under Ubuntu QT6. Obviously the criterion “QT_VERSION >= QT_VERSION_CHECK(6,0,0)” does not work reliably.

This optimization does not bring any significant benefit other than that described above. I am happy to forego the benefit in favor of secure compilation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions