I was looking into SslSplit code. And I faced some unfamiliar, strange function declarations in opts.h
file. Definition of those functions are quite straightforward but I could use some help about declarations. Here it is:
opts.h:
char *proxyspec_str(proxyspec_t *) NONNULL(1) MALLOC;
void opts_set_crl(opts_t *, const char *) NONNULL(1,2);
opts.c:
void
opts_set_crl(opts_t *opts, const char *optarg)
{
if (opts->crlurl)
free(opts->crlurl);
opts->crlurl = strdup(optarg);
log_dbg_printf("CRL: %s\n", opts->crlurl);
}
char *
proxyspec_str(proxyspec_t *spec)
{
char *s;
char *lhbuf, *lpbuf;
char *cbuf = NULL;
// Some code..
return s;
}
attrib.h:
#define WUNRES __attribute__((warn_unused_result))
#define MALLOC __attribute__((malloc)) WUNRES
#define NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
My question is, what are the meanings of NONNULL and MALLOC at the end of the function declarations?