TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

GCC undefined behaviors are getting wild

9 pointsby uxover 2 years ago

3 comments

suprjamiover 2 years ago
I really like the idea of decompiling ones' own code with Ghidra to see different ways the logic can be represented. Using `-Wextra` adds a warning about the signed\unsigned comparison, but Ghidra's `(ulong)(uint)` casts make that a bit clearer.
llimosover 2 years ago
This is a great writeup on what&#x27;s possible with undefined behavior <a href="https:&#x2F;&#x2F;devblogs.microsoft.com&#x2F;oldnewthing&#x2F;20140627-00&#x2F;?p=633" rel="nofollow">https:&#x2F;&#x2F;devblogs.microsoft.com&#x2F;oldnewthing&#x2F;20140627-00&#x2F;?p=63...</a>
xeeeeeeeeeeenuover 2 years ago
If you want signed integer overflow to be defined, use the &quot;-fwrapv&quot; flag.