| commit | a44e9afdd16105d6f36319cb538666d9cc78435a | [log] [tgz] |
|---|---|---|
| author | Nick Kralevich <nnk@google.com> | Thu Jan 17 15:41:33 2013 -0800 |
| committer | Nick Kralevich <nnk@google.com> | Thu Jan 17 15:41:33 2013 -0800 |
| tree | 8606530bcdef438dc305894c805f0713edad5306 | |
| parent | f3fe19459fd9263e8cc8a413a5313b1ec3cf3975 [diff] |
FORTIFY_SOURCE: optimize
Don't do the fortify_source checks if we can determine, at
compile time, that the provided operation is safe.
This avoids silliness like calling fortify source on things like:
size_t len = strlen("asdf");
printf("%d\n", len);
and allows the compiler to optimize this code to:
printf("%d\n", 4);
Defer to gcc's builtin functions instead of pointing our code
to the libc implementation.
Change-Id: I5e1dcb61946461c4afaaaa983e39f07c7a0df0ae