Skip to content

Instantly share code, notes, and snippets.

View wingerse's full-sized avatar

wingerse wingerse

  • Imperial Galaxy
View GitHub Profile
@Earnestly
Earnestly / c99_ub_list.rst
Last active March 29, 2024 03:52
C99 List of Undefined Behavior (193 Cases)

C99 List of Undefined Behavior

From N1256: (See http://port70.net/~nsz/c/c99/n1256.html#J.2)

  • A "shall" or "shall not" requirement that appears outside of a constraint is violated (clause 4).
  • A nonempty source file does not end in a new-line character which is not immediately preceded by a backslash character or ends in a partial preprocessing token or comment (5.1.1.2).
  • Token concatenation produces a character sequence matching the syntax of a universal character name (5.1.1.2).
  • A program in a hosted environment does not define a function named main using one of the specified forms (5.1.2.2.1).
  • A character not in the basic source character set is encountered in a source file, except in an identifier, a character constant, a string literal, a header name, a comment, or a preprocessing token that is never converted to a token (5.2.1).
  • An identifier, comment, string literal, character constant, or header name contains an invalid multibyte character or does not
@JCThePants
JCThePants / Minecraft 1.8.1Chunk Packet Data FormatNotes
Last active April 18, 2018 16:05
Minecraft 1.8.1 chunk packet data format notes from looking at Minecraft 1.8 source. (net.minecraft.server.PacketPlayOutMapChunk)
16 chunk sections in a chunk. A chunk is 16x256x16 (x y z) blocks. A chunk section is 16x16x16 blocks.
--------------------------------------------------
Chunk:
Section:
Block Data: 2 bytes per block. 8192 bytes. format: blockId << 4 | meta
Emitted Light: 4 bits per block (1/2 byte). 2048 bytes
Skylight: 4 bits per block (1/2 byte). 2048 bytes (only included in overworld)
Biome: 1 byte per block column. 256 bytes. (only included if all sections are in chunk)
--------------------------------------------------