Skip to content

performing pointer subtraction with a null pointer has undefined behavior #3

Description

@nouraellm

I am actually trying to run this on macOS M1 (to use Rune) clang 14 => but the make throws a bunch of warnings like:

./utdatabase.h:157:70: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
utInlineC uint32 utSym2ValidIndex(utSym Sym) {return utValidSym(Sym) - (utSym)0;}

It is an undefined behavior because when a null pointer is involved in pointer subtraction we are violating C standards, so it is crucial to refrain from conducting pointer arithmetic with null pointers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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