Conversation

Using the existing intrinsic, a call like malloc(sizeof(T)) can have checks inserted based on it, but a call like malloc(N) where N is not a compile-time constant known to the compiler cannot, even though the checks would be functionally the same just based on the expression N.
1
2
A _FORTIFY_SOURCE implementation can use it just by dropping in the new intrinsic to where they perform runtime checks. They could leave the existing intrinsic for compile-time checks or use __builtin_constant_p. Manual compile-time errors don't work with Clang anyway right now.
1
1
Show replies