dateutils icon indicating copy to clipboard operation
dateutils copied to clipboard

Implicit-declaration (missing #include) warnings

Open dmacks opened this issue 5 years ago • 1 comments

Building dateutils-0.4.6 on OS X 10.13...

yuck.c:1175:6: warning: implicit declaration of function '_NSGetExecutablePath' is invalid in C99 [-Wimplicit-function-declaration]
        if (_NSGetExecutablePath(buf, &z) != 0) {
            ^
time-core.c:124:13: warning: implicitly declaring library function 'strcasecmp' with type 'int (const char *, const char *)' [-Wimplicit-function-declaration]
        } else if (strcasecmp(*fmt, "hms") == 0) {
                   ^
time-core.c:124:13: note: include the header <strings.h> or explicitly provide a declaration for 'strcasecmp'
clitosis.c:382:7: warning: implicit declaration of function '_NSGetExecutablePath' is invalid in C99 [-Wimplicit-function-declaration]
                if (_NSGetExecutablePath(buf, &bsz) < 0) {
                    ^

dmacks avatar Jan 29 '20 17:01 dmacks

Hey Daniel, thanks for reporting this. I pushed a fix (00c8383db) to master.

hroptatyr avatar Jan 31 '20 11:01 hroptatyr

Looks like this can be closed now.

thesamesam avatar Mar 19 '23 03:03 thesamesam

Building 0.4.10 , time-core.c looks clean in this regard. But clitosis.c is still:

clitosis.c:383:7: warning: implicit declaration of function '_NSGetExecutablePath' is invalid in C99 [-Wimplicit-function-declaration]
                if (_NSGetExecutablePath(buf, &bsz) < 0) {
                    ^

Needs the same fix that yuck.c got in a10d39c1a6114cbd152e04f072ce580918fa90a4:

#if defined __APPLE__
# include <mach-o/dyld.h>
#endif  /* __APPLE__ */

dmacks avatar Mar 19 '23 06:03 dmacks