Am 15/03/2013 15:41, schrieb Pawel Dziepak:
2013/3/14 Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>:Isn't that just a porting issue? Somewhere GCC stores that information, and it's usually right. Just not on Haiku. IMO one should "simply" update GCC to know that strdup(), free(), etc. accept NULL pointers.The problem is that GCC applies the same attributes to both built-in functions and their user defined version even if eventually the built-in version is never used. Changing the attributes of GCC built-in functions is trivial this [1] patch for GCC would do this for strdup() and solve this particular problem. However, if anyone tried to compile anything that uses built-in strdup() GCC would have wrong information about it (and that may result in another problem).
I think a complete patch would indeed also patch the built-ins to follow the same logic.
Do the built-ins only contain the clib built-ins, or would other built-ins also be affected (like byte swapping routines, etc.)? If it would only affect clib built-ins, then I think disabling them by default would certainly be a valid option.
Bye, Axel.