clang warning on master

Started by Pavel Stehuleover 11 years ago2 messageshackers
Jump to latest
#1Pavel Stehule
pavel.stehule@gmail.com

Hi

I see a lot of warnings

[pavel@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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Pavel Stehule (#1)
Re: clang warning on master

Pavel Stehule <pavel.stehule@gmail.com> writes:

I see a lot of warnings

[pavel@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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers