gcc bounds checking

Orion Poplawski orion at cora.nwra.com
Thu Jul 22 21:12:46 UTC 2010


Looks, looks like gcc can do certain compile time bounds checking (probably 
for ages but I'm slow) and emits warnings like:

In function 'strcpy',
     inlined from 'New_psimage_Ctrl' at psimage.c:357:9:
/usr/include/bits/string3.h:107:3: warning: call to __builtin___strcpy_chk 
will always overflow destination buffer

Unfortunately, it's only a warning and as a typically lazy packager who 
packages software with lots of compiler warnings, I missed this until it 
caused a runtime fortify error check.

So, perhaps the gcc folks can say why this isn't an error?

And perhaps would could grep though all of the build logs for this one?

-- 
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA/CoRA Division                    FAX: 303-415-9702
3380 Mitchell Lane                  orion at cora.nwra.com
Boulder, CO 80301              http://www.cora.nwra.com


More information about the devel mailing list