this post was submitted on 25 Mar 2024
538 points (98.6% liked)

Programmer Humor

19149 readers
1234 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
(page 2) 13 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 5 months ago
volatile int blackhole;
blackhole = 1;
const int X = blackhole;
const int Y = blackhole;

Compiler is forbidden to assume that X == 1 would be true. It's also forbidden to assume that X == Y. const just means the address and/or the data at the address is read only. const volatile int* const hwreg; -> "read only volatile value at read only address hwreg". Compiler can assume the hwreg address won't magically change, but can't assume the value read from that address won't.

load more comments
view more: ‹ prev next ›