https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120979
--- Comment #4 from Richard Biener ---
I guess we miss a memdup, using strndup instead of strdup might be a small
improvement.
I don't think inlining it is a good thing to do, this should be addressed
at the library level.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120979
--- Comment #3 from Andrew Pinski ---
Also as I mentioned xstrdup is not linked at all to the normal strdup (it is a
wrapper around strdup which will error out [and exit] if strdup returns NULL).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120979
--- Comment #2 from Andrew Pinski ---
(In reply to Andrew Pinski from comment #1)
> Note xstrdup is not the same as strdup ...
>
> ```
> char *a()
> {
> return __builtin_strdump ("");
Sorry typo, __builtin_strdup.
> }
> ```
>
> Would
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120979
--- Comment #1 from Andrew Pinski ---
Note xstrdup is not the same as strdup ...
```
char *a()
{
return __builtin_strdump ("");
}
```
Would need to be changed into:
```
char *a()
{
const char tt[] = "";
char *t = __builtin_mallo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120979
Andrew Pinski changed:
What|Removed |Added
Severity|normal |enhancement
Keywords|