This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fortification of STL


Hi Jakub,

The following patch of course is not meant to be directly used,
this should only be enabled if
1) _FORTIFY_SOURCE is defined
2) __OPTIMIZE__ > 0
3) we know the C library provides the checking functions (__memcpy_chk,
__memmove_chk, __memset_chk in this case)
and having conditionals everywhere is jus too ugly to live with.
Guess some __gnu_* namespace could have an __attribute__((always_inline))
memcpy, memmove and memset routine that would either return
__builtin_* or __builtin___*_chk depending on preprocessor macros...


Maybe it would be just matter of adding a few forwarding macros to bits/c++config, similarly to what we have in ext/atomicity.h. Likewise, we should probably add a bit of configury to enable the *_chk versions in the exported library facilities.

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]