Thread: BUG #15280: Clang 6.0.1 compiler warning - strlcpy

BUG #15280: Clang 6.0.1 compiler warning - strlcpy

From
PG Bug reporting form
Date:
The following bug has been logged on the website:

Bug reference:      15280
Logged by:          Steven Winfield
Email address:      steven.winfield@cantabcapital.com
PostgreSQL version: 11beta2
Operating system:   RHEL 7.4
Description:

Hi,

While compiling 11beta2 using clang 6.0.1 this warning crops up quite a lot
in an otherwise quiet build process - so I thought it might be of
interest:

pg_rewind.c:724:4: warning: implicitly declaring library function 'strlcpy'
with type 'unsigned long (char *, const char *, unsigned long)'
[-Wimplicit-function-declaration]
                        strlcpy(full_path, progname, sizeof(full_path));
                        ^
pg_rewind.c:724:4: note: include the header <string.h> or explicitly provide
a declaration for 'strlcpy'
1 warning generated.

In my pg_config.h I have:
#define HAVE_DECL_STRLCPY 1

...and HAVE_STRLCPY is left undefined:
/* #undef HAVE_STRLCPY */

Best wishes,
Steven.


Re: BUG #15280: Clang 6.0.1 compiler warning - strlcpy

From
Tom Lane
Date:
=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> While compiling 11beta2 using clang 6.0.1 this warning crops up quite a lot
> in an otherwise quiet build process - so I thought it might be of
> interest:
> pg_rewind.c:724:4: warning: implicitly declaring library function 'strlcpy'
> with type 'unsigned long (char *, const char *, unsigned long)'
> [-Wimplicit-function-declaration]

Yeah, this is a known problem caused by autoconf doing its "is this
function declared" test in a way that clang doesn't play nice with.

There's a fix for this upstream:

http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=82ef7805faffa151e724aa76c245ec590d174580

and we've been patiently waiting for an autoconf release that
incorporates it ...

            regards, tom lane


RE: BUG #15280: Clang 6.0.1 compiler warning - strlcpy

From
Steven Winfield
Date:


From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: 16 July 2018 16:27
To: Steven Winfield
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15280: Clang 6.0.1 compiler warning - strlcpy

 

PG Bug reporting form <noreply@postgresql.org> writes:
> While compiling 11beta2 using clang 6.0.1 this warning crops up quite a lot
> in an otherwise quiet build process - so I thought it might be of
> interest:
> pg_rewind.c:724:4: warning: implicitly declaring library function 'strlcpy'
> with type 'unsigned long (char *, const char *, unsigned long)'
> [-Wimplicit-function-declaration]

Yeah, this is a known problem caused by autoconf doing its "is this
function declared" test in a way that clang doesn't play nice with.

There's a fix for this upstream:

http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=82ef7805faffa151e724aa76c245ec590d174580

and we've been patiently waiting for an autoconf release that
incorporates it ...


Thanks - I’ll add my voice to the release requests.

 

Steve



This email is confidential. If you are not the intended recipient, please advise us immediately and delete this message. The registered name of Cantab- part of GAM Systematic is Cantab Capital Partners LLP. See - http://www.gam.com/en/Legal/Email+disclosures+EU for further information on confidentiality, the risks of non-secure electronic communication, and certain disclosures which we are required to make in accordance with applicable legislation and regulations. If you cannot access this link, please notify us by reply message and we will send the contents to you.

GAM Holding AG and its subsidiaries (Cantab – GAM Systematic) will collect and use information about you in the course of your interactions with us. Full details about the data types we collect and what we use this for and your related rights is set out in our online privacy policy at https://www.gam.com/en/legal/privacy-policy. Please familiarise yourself with this policy and check it from time to time for updates as it supplements this notice