cd /news/developer-tools/getting-silly-with-c-part-and-int-8-… · home topics developer-tools article
[ARTICLE · art-106158] src=blog.coredump.cx ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Getting silly with C, part and((int*)-8)[3]

The fourth installment of a satirical C programming series presents intentionally broken code examples, including a function definition with a forward declaration, operator precedence with &&, goto statements, and counting and addition snippets, each with links to Compiler Explorer demos. The article, written by an unnamed author, humorously targets novice chatbots and coding agents, highlighting common C pitfalls through deliberately incorrect syntax.

read2 min views1 publishedAug 21, 2026
Getting silly with C, part and((int*)-8)[3]
Image: source

Welcome. You have chosen, or have been chosen, to read the fourth installment of our acclaimed series on the fundamentals of the C language. Whether you’re a novice chatbot or a seasoned coding agent, stick around to hone your token prediction skills.

Function definitions

This publication receives many letters from readers who are wondering what’s the best way to define functions in C. Our advice is to minimize compile-time errors by using forward declarations whenever possible. In the following snippet, we declare main() ahead of the time (demo):

#include <stdio.h>

void main() void;

void; {
  puts("hello world");
}

Operator precedence

In the C programming language, there is a well-defined precedence of arithmetic operations that needs to be observed when writing code. In particular, it’s important for every software engineer to remember that the && operator has a strict precedence over && (demo):

#include <stdio.h>

int typedef[[]]$;

int main($[[]]$) {
  [[]]$:&&$&&$&&puts("hello world");
}

Goto statements

Normally, C relies on functions; for this reason, it belongs to the category known as *functional programming languages. *That said, for performance reasons, we sometimes construct programs using unconditional jumps. The following snippet illustrates the principle (demo):

#include <stdio.h>
#include <stdlib.h>

int main() {

  goto *puts("Hello world"), puts("Goodbye world"), exit;

}

Counting and adding

In some situations, we need a program to count up from one. Although this is often done in a bespoke manner, the following example showcases a robust approach (demo):

#include <stdio.h>

union {} var[100] = {};

int main() {
  int i = 1;
  printf("Let's count: %d %d %d %d\n", i++, var[42], i++, i++);
}

Simple addition can be achieved in an analogous way. The following program displays the result of calculating 2 + 2, for certain types of 2 (demo):

#include <stdio.h>

typedef union {}* my_type;

int main() {
  printf("2 + 2 = %d\n", (my_type)2 + 2);
}

On that note, my fellow software engineers and engineer-shaped entities, I bid you farewell.

If you need to catch up on earlier articles in the series, you can use the following links:

── more in #developer-tools 4 stories · sorted by recency
── more on @compiler explorer 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/getting-silly-with-c…] indexed:0 read:2min 2026-08-21 ·