Skip to content

Build error: implicit declaration of function #1

Description

@l2dy

Build fails on macOS, where implicit declaration is not allowed. See also https://trac.macports.org/ticket/61663.

/usr/bin/clang -arch x86_64 -c -O   _autotst.c
In file included from _autotst.c:2:
./../config.h:3:43: warning: '/*' within block comment [-Wcomment]
/*#define sMAILBOX_SEPARATOR    "\1\1\1\1\n"    /* sTART- and eNDing separ.  */
                                                ^
./../config.h:4:43: warning: '/*' within block comment [-Wcomment]
/*#define eMAILBOX_SEPARATOR    "\1\1\1\1\n"    /* uncomment (one or both)
                                                ^
./../config.h:49:28: warning: '/*' within block comment [-Wcomment]
/*#define GROUP_PER_USER                        /* uncomment this if each
                                                ^
./../config.h:55:20: warning: '/*' within block comment [-Wcomment]
/*#define LMTP                                  /* uncomment this if you
                                                ^
./../config.h:80:26: warning: '/*' within block comment [-Wcomment]
/*#define NO_fcntl_LOCK         /* uncomment any of these three if you       */
                                ^
./../config.h:81:26: warning: '/*' within block comment [-Wcomment]
/*#define NO_lockf_LOCK         /* definitely do not want procmail to make   */
                                ^
./../config.h:82:26: warning: '/*' within block comment [-Wcomment]
/*#define NO_flock_LOCK         /* use of those kernel-locking methods       */
                                ^
./../config.h:88:29: warning: '/*' within block comment [-Wcomment]
/*#define RESTRICT_EXEC 100     /* uncomment to prevent users with uids equal
                                ^
./../config.h:94:29: warning: '/*' within block comment [-Wcomment]
/*#define NO_NFS_ATIME_HACK     /* uncomment if you're definitely not using
                                ^
./../config.h:101:44: warning: '/*' within block comment [-Wcomment]
/*#define DEFsendmail   "/usr/sbin/sendmail"    /* uncomment and/or change if
                                                ^
./../config.h:134:34: warning: '/*' within block comment [-Wcomment]
/*#define console       "/dev/console"  /* uncomment if you want procmail to
                                        ^
_autotst.c:62:30: error: implicit declaration of function 'killchildren' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
{ timeout=1;close(fdcollect);killchildren();
                             ^
_autotst.c:66:14: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
{ stimeout();exit(1);
             ^
_autotst.c:66:14: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
_autotst.c:126:8: error: implicit declaration of function 'fdlock' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
              fdlock(goodlock);
              ^
_autotst.c:126:8: note: did you mean 'flock'?
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/fcntl.h:544:9: note: 'flock' declared here
int     flock(int, int);
        ^
_autotst.c:145:11: error: implicit declaration of function 'sfdlock' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
              if(sfdlock(fd))
                 ^
_autotst.c:145:11: note: did you mean 'flock'?
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/fcntl.h:544:9: note: 'flock' declared here
int     flock(int, int);
        ^
_autotst.c:152:11: error: implicit declaration of function 'fdunlock' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
              if(fdunlock()||close(fd))
                 ^
_autotst.c:167:13: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
              if(fp=fopen("_locktst.pid","w"))
                 ~~^~~~~~~~~~~~~~~~~~~~~~~~~~
_autotst.c:167:13: note: place parentheses around the assignment to silence this warning
              if(fp=fopen("_locktst.pid","w"))
                   ^
                 (                           )
_autotst.c:167:13: note: use '==' to turn this assignment into an equality comparison
              if(fp=fopen("_locktst.pid","w"))
                   ^
                   ==
_autotst.c:184:31: error: implicit declaration of function 'killchildren' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           alarm(0);close(fdcollect);killchildren();
                                     ^
_autotst.c:233:10: error: implicit declaration of function 'fdlock' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return fdlock(fd);
         ^
_autotst.c:236:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static oldfdlock;
~~~~~~ ^
13 warnings and 7 errors generated.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions