clang warning on master

Lists: pgsql-hackers
From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: clang warning on master
Date: 2014-08-29 17:50:45
Message-ID: CAFj8pRAxB4tdjQCdu-72GqrvVkVC_buUAwAGWrUedBRouG1Mxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi

I see a lot of warnings

[pavel(at)localhost postgresql]$ make all | grep warning
exec.c:280:2: warning: implicitly declaring library function 'strlcpy' with
type 'unsigned long (char *, const char *, unsigned long)'
strlcpy(link_buf, fname, sizeof(link_buf));
^
exec.c:280:2: note: please include the header <string.h> or explicitly
provide a declaration for 'strlcpy'
1 warning generated.
exec.c:280:2: warning: implicitly declaring library function 'strlcpy' with
type 'unsigned long (char *, const char *, unsigned long)'
strlcpy(link_buf, fname, sizeof(link_buf));
^
exec.c:280:2: note: please include the header <string.h> or explicitly
provide a declaration for 'strlcpy'
1 warning generated.
path.c:188:3: warning: implicitly declaring library function 'strlcpy' with
type 'unsigned long (char *, const char *, unsigned long)'
strlcpy(ret_path, head, MAXPGPATH);
^
path.c:188:3: note: please include the header <string.h> or explicitly
provide a declaration for 'strlcpy'
1 warning generated.
path.c:188:3: warning: implicitly declaring library function 'strlcpy' with
type 'unsigned long (char *, const char *, unsigned long)'
strlcpy(ret_path, head, MAXPGPATH);
^
path.c:188:3: note: please include the header <string.h> or explicitly
provide a declaration for 'strlcpy'
1 warning generated.
thread.c:77:2: warning: implicitly declaring library function 'strlcpy'
with type 'unsigned long (char *, const char *, unsigned long)'
strlcpy(strerrbuf, strerror(errnum), buflen);
^
thread.c:77:2: note: please include the header <string.h> or explicitly
provide a declaration for 'strlcpy'
1 warning generated.
pgtz.c:53:2: warning: implicitly declaring library function 'strlcpy' with
type 'unsigned long (char *, const char *, unsigned long)'
strlcpy(tzdir + strlen(tzdir), "/timezone", MAXPGPATH -
strlen(tzdir));
^
pgtz.c:53:2: note: please include the header <string.h> or explicitly
provide a declaration for 'strlcpy'
1 warning generated.
xlog.c:5627:4: warning: implicitly declaring library function 'strlcpy'
with type 'unsigned long (char *, const char *, unsigned long)'
strlcpy(recoveryStopName,
recordRestorePointData->rp_name, MAXFNAMELEN);

Regards

Pavel


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: clang warning on master
Date: 2014-08-29 18:03:03
Message-ID: 23050.1409335383@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> I see a lot of warnings

> [pavel(at)localhost postgresql]$ make all | grep warning
> exec.c:280:2: warning: implicitly declaring library function 'strlcpy' with
> type 'unsigned long (char *, const char *, unsigned long)'
> strlcpy(link_buf, fname, sizeof(link_buf));
> ^
> exec.c:280:2: note: please include the header <string.h> or explicitly
> provide a declaration for 'strlcpy'
> 1 warning generated.

[ raised eyebrow... ] exec.c certainly includes <string.h> already
(via c.h). I think you should complain to your compiler vendor.

regards, tom lane