[llvm-dev] GEP with a null pointer base

Florian Weimer via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 6 14:49:37 PDT 2017


* James Y. Knight via llvm-dev:

> To the first, asking people who do crazy stuff like this to compile with
> -fno-strict-overflow is reasonable...they're invoking C-level undefined
> behavior by doing arbitrary pointer-math, so they should use the flag that
> tells the compiler to make arbitrary pointer-math not be UB.

Bit this comes from a glibc header, so ideally, it should be fixed to
work with all compiler modes (with the caveat that some things that
obstack does may never be valid C code).


More information about the llvm-dev mailing list