Skip to content

missing return statement warning #231

@bd4

Description

@bd4

The zero length sarray implementation has an operator[] which cannot return - it's implementation is a gtGpuAssert false which throws an exception on host and aborts on device. The compiler is not able to determine this cannot return, and building tests spams the warning over and over, making it hard to see other warnings.

Using __builtin_unreachable() appears to work in most cases. In cuda-10.2, it results in a new warning, that unreacheable is a host fn and can't be called from host device function. This is at least an improvement, but it would be nice to silence this completely.

It's tempting to just declare a length 1 data member and return it, adding 4 bytes to each gscalar is not likely to cause a complex expression that fits in device args to not fit.

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