🔪 Joel May-Kill 🔪 on Nostr: … why do I keep seeing this C code pattern everywhere lately? do { something(); } ...
… why do I keep seeing this C code pattern everywhere lately?
do { something(); } while(0);
Is it something to do with fighting with GCC’s optimiser?
Published at
2024-09-06 00:13:21 UTCEvent JSON
{
"id": "c20a10d030d71d268f0b5265224c169afd63234a636a01582cdd43cefddbb3ec",
"pubkey": "dc6381215e656a56d81495cef020a0a291cdcb0195398bdded551ee3938dd9a0",
"created_at": 1725581601,
"kind": 1,
"tags": [
[
"proxy",
"https://aus.social/@jpm/113087715807458188",
"web"
],
[
"proxy",
"https://aus.social/users/jpm/statuses/113087715807458188",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://aus.social/users/jpm/statuses/113087715807458188",
"pink.momostr"
],
[
"-"
]
],
"content": "… why do I keep seeing this C code pattern everywhere lately?\n\ndo { something(); } while(0);\n\nIs it something to do with fighting with GCC’s optimiser?",
"sig": "6596e936d18d648c38f6722619683e4e341d173c932793f623f29d7cf305603fbc94623df2d1b4beab7c7a8d6b7133862888f36b0760241a68daeca69df2b676"
}