| |
Log in / Subscribe / Register

GCC and pointer overflows

GCC and pointer overflows

Posted Apr 24, 2008 7:15 UTC (Thu) by eliezert (subscriber, #35757)
In reply to: GCC and pointer overflows by JoeBuck
Parent article: GCC and pointer overflows

Of course it's best if we all stick to the standard, but people do make mistakes.
I think the simplest way to minimize this is to have an attribute marking the check as a
safty/sanity check so the compiler knows that:
1. It should not optimize this check out.
2. If it knows that this check will allways fail it can emit a warning.
3. If this check is assuming something improper it's better to fail the compilation and let
the coder look up the error somewhere, than to silently drop the test.


GCC and pointer overflows

Posted Apr 24, 2008 20:39 UTC (Thu) by nix (subscriber, #2304) [Link]

You can't (yet) attach attributes to arbitrary expressions, though.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds