# Pointer type checking on buffer var breaks buffer type casting

**URL:** <https://discuss.tvm.apache.org/t/pointer-type-checking-on-buffer-var-breaks-buffer-type-casting/8252>\
**Category:** Development\
**Created:** [October 22, 2020, 6:21pm UTC](https://discuss.tvm.apache.org/t/pointer-type-checking-on-buffer-var-breaks-buffer-type-casting/8252 "2020-10-22T18:21:32Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![kparzysz](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/kparzysz/32/252_2.png) [@kparzysz](https://discuss.tvm.apache.org/u/kparzysz)\
**Post date:** [October 22, 2020, 6:21pm UTC](https://discuss.tvm.apache.org/t/pointer-type-checking-on-buffer-var-breaks-buffer-type-casting/8252/1 "2020-10-22T18:21:32Z")

</div>

We are catching up on upstream development in our local repo, and we ran into an issue: pointer annotation on buffer variables blocks buffer type casting. See [Type casting a buffer](https://discuss.tvm.apache.org/t/type-casting-a-buffer/4035) for more details. In short, given a buffer of one data type, we want to be able to access it using different data types. What we do is that we create a new buffer (via `decl_buffer`), and use the same buffer variable, but with different data type.

How can we get this to work with the annotations in place?

---

_[View the full topic](https://discuss.tvm.apache.org/t/pointer-type-checking-on-buffer-var-breaks-buffer-type-casting/8252)._
