Ticket #281 (closed defect: fixed)
implicit declaration of function `strdup'
| Reported by: | songcw@… | Owned by: | buglog@… |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | openmoko-applicationmanager | Version: | current svn head |
| Severity: | normal | Keywords: | |
| Cc: | buglog@… | Blocked By: | |
| Blocking: | Estimated Completion (week): | ||
| HasPatchForReview: | PatchReviewResult: | ||
| Reproducible: |
Description
In the openmoko-appmanager, in the file ipkgapi.c, it includes the strings.h,
but it still report as that:
ipkgapi.c:415: warning: implicit declaration of function `strdup'
How to resolve it?
Change History
Note: See
TracTickets for help on using
tickets.

the include string.h has the following definition:
/* Duplicate S, returning an identical malloc'd string. */
extern char *strdup (const char *s)
#endif
For some reason none of those defines is used, AFAIK USE_XOPEN_EXTENDED should
be. Maybe someone can clear up that issue for us?
So if you do the following instead of just including <string.h> it works:
#define USE_XOPEN_EXTENDED
#include <string.h>
Anyway IMHO that is a temporary workaround.