https://bugs.llvm.org/show_bug.cgi?id=49708

Roman Lebedev <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]

--- Comment #1 from Roman Lebedev <[email protected]> ---
Why is that not correct?

A pointer to an integer is 4-byte aligned:
https://clang.godbolt.org/z/zda9M15K1
All accesses to it are 4-byte aligned.
If it is not, that's UB already.

So when `g()` casts a char* to an int*,
iff the target pointer has larger alignment
than the actual alignment of the pointer,
that's UB.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to