Commit 7e7ecef9 authored by Guillaume Chatelet's avatar Guillaume Chatelet
Browse files

[libc] Replace type punning with bit_cast

Although type punning is defined for union in C, it is UB in C++.
This patch introduces a bit_cast function to convert between types in a safe way.

This is necessary to get llvm-libc compile with GCC.
This patch is extracted from D119002.

Differential Revision: https://reviews.llvm.org/D119145
parent 9be6e40d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment