# Type Punning Functions in C

DevFeed: [Type Punning Functions in C](<https://devfeed.tech/articles/type-punning-functions-in-c-37904.md>)

Original publisher: [Read original article](<https://www.evanmiller.org/type-punning-functions-in-c.html>)

Author: Evan Miller

Published: 2016-08-10T15:20:00Z

Content type: article

Language: en

Sources: [Evan Miller](<https://devfeed.tech/sources/evan-miller.md>)

Topics: [C](<https://devfeed.tech/topics/c.md>), [functions](<https://devfeed.tech/topics/functions.md>), [x86](<https://devfeed.tech/topics/x86.md>), [Assembly](<https://devfeed.tech/topics/assembly.md>), [cpu](<https://devfeed.tech/topics/cpu.md>)

Tags: [assembly](<https://devfeed.tech/tags/assembly.md>), [c](<https://devfeed.tech/tags/c.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [functions](<https://devfeed.tech/tags/functions.md>), [standard](<https://devfeed.tech/tags/standard.md>), [unix](<https://devfeed.tech/tags/unix.md>), [windows](<https://devfeed.tech/tags/windows.md>), [x86-64](<https://devfeed.tech/tags/x86-64.md>)

## AI overview

This article demonstrates how C function pointers can be used with incompatible argument orders, producing type-punning behavior that depends on x86 calling conventions rather than the C standard. It explains how register-based argument passing contributes to the observed results and warns that the technique is architecture-dependent and unsafe.

## Source excerpt

Making C more flexible, with the help of x86_64 calling conventions: Type Punning Functions in C