This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)
This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Type punning" – news · newspapers · books · scholar · JSTOR(October 2011) (Learn how and when to remove this message)
This article is written like a manual or guide. Please help rewrite this article and remove advice or instruction.(October 2011)
(Learn how and when to remove this message)
In computer science, a type punning is any programming technique that subverts or circumvents the type system of a programming language in order to achieve an effect that would be difficult or impossible to achieve within the bounds of the formal language.
In C and C++, constructs such as pointer type conversion and union — C++ adds reference type conversion and reinterpret_cast to this list — are provided in order to permit many kinds of type punning, although some kinds are not actually supported by the standard language.
In the Pascal programming language, the use of records with variants may be used to treat a particular data type in more than one manner, or in a manner not normally permitted.
In computer science, a typepunning is any programming technique that subverts or circumvents the type system of a programming language in order to achieve...
creates a brand-new object of the appropriate type." As another example, GCC describes this as type-punning and warns that it will break strict aliasing...
ways to each of the items listed, creating a series of linked puns. This type of punning can often be seen in literature, particularly in works that play...
in which I/O is possible, circumvents the type system and so can be used to break type safety.) Typepunning is another example of such an "escape" feature...
that specific operation. Downcasting Run-time type information § C++ – dynamic cast and Java cast Typepunning Mehrotra, Dheeraj (2008). S. Chand's Computer...
common location by different data types, for example hardware input/output access, bitfield and word sharing, or typepunning. Unions can also provide low-level...
as by assembly language programmers. While not allowed by C++, such typepunning code is allowed as "implementation-defined" by the C11 standard and commonly...
value, 100, sizeof records[0]); return 0; } This idiom is a form of typepunning. Some languages like PL/I or Fortran allow what is known as an array...
programming tricks may be needed to distinguish the two values: Typepunning the number to an integer type, so as to look at the sign bit in the bit pattern; using...
bit level view of the contents of the floating point value. However, typepunning through a union is also undefined behavior in C++. # include <stdint...
integer reinterpretation of x {\displaystyle x} ). In languages that allow typepunning and always use IEEE 754–1985, we can exploit this to compute a machine...
(called "typepunning") is common, and explicitly allowed even if strict aliasing is in force, provided the memory is accessed through the union type directly...
175–178. Binsted, Kim; Ritchie, Graeme (1994). "A symbolic description of punning riddles and its computer implementation". arXiv:cmp-lg/9406021. Bibcode:1994cmp...
contains relevant quotations from IEEE 754-2008 and -2019. Contains a type-pun implementation and explanation. Herf, Michael (December 2001). "radix tricks"...
relational algebra and tuple relational calculus, SQL consists of many types of statements, which may be informally classed as sublanguages, commonly:...
contains the technique of canting arms, which can be considered punning. Visual puns on the bearer's name are used extensively as forms of heraldic expression...
vector maths library. In a math library, it is frequently useful to use typepunning to interpret a floating-point number as an unsigned integer of the same...
phrase), where the story contains sufficient context to recognize the punning humor. The term for this storytelling model originated in a long-running...
Sai Ying Pun is a station on the MTR network. The station is located between HKU and Sheung Wan on the Island line. It serves the neighbourhood of Sai...
PunBB (PunBulletinBoard) is a discussion forum software written in PHP, released under the GNU General Public License. This software places a strong emphasis...
but in two different senses. Antanaclasis is a common type of pun, and like other kinds of pun, it is often found in slogans. I'm not a businessman, I'm...
This is an index of joke types. Anti-humor Bar joke Bellman joke Black comedy Blonde joke British humour Callback Conditional joke Cringe comedy Cruel...