Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Werror=implicit-function-declaration breaks compilation of perl5184-5.18.4-4 #1075

Open
cooljeanius opened this issue Oct 5, 2023 · 3 comments

Comments

@cooljeanius
Copy link

Entire failure is too long to paste comfortably here, so I'll just paste the last part of it:

reentr.c:513:16: error: implicit declaration of function 'getservbyport_r' [-Werror,-Wimplicit-function-declaration]
                    retptr = getservbyport(anint, (char *)p0); break;
                             ^
./reentr.h:1286:60: note: expanded from macro 'getservbyport'
#       define getservbyport(a, b) ((PL_reentrant_retint = getservbyport_r(a, b, &PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size, &PL_reentrant_buffer->_servent_ptr)) == 0 ? PL_reentrant_buffer->_servent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservbyport", a, b) : 0))
                                                           ^
reentr.c:513:16: note: did you mean 'getservbyport'?
./reentr.h:1286:60: note: expanded from macro 'getservbyport'
#       define getservbyport(a, b) ((PL_reentrant_retint = getservbyport_r(a, b, &PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size, &PL_reentrant_buffer->_servent_ptr)) == 0 ? PL_reentrant_buffer->_servent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservbyport", a, b) : 0))
                                                           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/netdb.h:287:17: note: 'getservbyport' declared here
struct servent  *getservbyport(int, const char *);
                 ^
reentr.c:515:16: error: implicit declaration of function 'getservent_r' [-Werror,-Wimplicit-function-declaration]
                    retptr = getservent(); break;
                             ^
./reentr.h:1301:53: note: expanded from macro 'getservent'
#       define getservent() ((PL_reentrant_retint = getservent_r(&PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size, &PL_reentrant_buffer->_servent_ptr)) == 0 ? PL_reentrant_buffer->_servent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservent") : 0))
                                                    ^
reentr.c:515:16: note: did you mean 'getservent'?
./reentr.h:1301:53: note: expanded from macro 'getservent'
#       define getservent() ((PL_reentrant_retint = getservent_r(&PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size, &PL_reentrant_buffer->_servent_ptr)) == 0 ? PL_reentrant_buffer->_servent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservent") : 0))
                                                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/netdb.h:288:17: note: 'getservent' declared here
struct servent  *getservent(void);
                 ^
16 warnings and 12 errors generated.
make: *** [GNUmakefile:262: reentr.o] Error 1
make: *** Waiting for unfinished jobs....
16 warnings generated.
98 warnings generated.
59 warnings generated.
25 warnings generated.
148 warnings generated.
599 warnings generated.
152 warnings generated.
### execution of /tmp/fink.3bu2R failed, exit code 2
### execution of /tmp/fink.N0gr4 failed, exit code 2
Removing runtime build-lock...
Removing build-lock package...
/opt/sw/bin/dpkg-lockwait -r fink-buildlock-perl5184-5.18.4-4
(Reading database ... 
dpkg: serious warning: files list file for package `fink-buildlock-ccp4-6.5-1' missing, assuming package has no files currently installed.
1030938 files and directories currently installed.)
Removing fink-buildlock-perl5184-5.18.4-4 ...

Note that this blocks the upgrading of all the "*-pm5184" packages that I had installed from previous installations. I'm on Big Sur with Xcode 13.

@nieder
Copy link
Member

nieder commented Oct 6, 2023

Just built for me on 13.5. I also don't see the implicit-function-declaration flag anywhere in the build process. Can you search for the compiler command for reentr.c and post that?

man getservbyport in Xcode 14.3 says that the function is available with #include <netdb.h>. Do you get the same man output? reentr.h does #include the netdb.h header:

#ifdef I_NETDB
#   include <netdb.h>
#endif

In config.log, I do have I_NETDB defined:

/* I_NETDB:
 *	This symbol, if defined, indicates that <netdb.h> exists and
 *	should be included.
 */
#define I_NETDB		/**/

(and configure output):

endgrent_r() NOT found.
endhostent() found.
<netdb.h> found.
endhostent_r() NOT found.

@cooljeanius
Copy link
Author

Just built for me on 13.5. I also don't see the implicit-function-declaration flag anywhere in the build process.

It's on by default, so you wouldn't necessarily see it.

Can you search for the compiler command for reentr.c and post that?

man getservbyport in Xcode 14.3 says that the function is available with #include <netdb.h>. Do you get the same man output?

Yes.

reentr.h does #include the netdb.h header:

#ifdef I_NETDB
#   include <netdb.h>
#endif

In config.log, I do have I_NETDB defined:

/* I_NETDB:
 *	This symbol, if defined, indicates that <netdb.h> exists and
 *	should be included.
 */
#define I_NETDB		/**/

er, you mean config.h? It's the same in mine, too:

/* I_NETDB:
 *	This symbol, if defined, indicates that <netdb.h> exists and
 *	should be included.
 */
#define I_NETDB		/**/

(and configure output):

endgrent_r() NOT found.
endhostent() found.
<netdb.h> found.
endhostent_r() NOT found.

For me, that part was:

endgrent_r() NOT found.
endhostent() found.
<netdb.h> found.
endhostent_r() found.
Hmm.  Based on the hints in hints/darwin.sh, 
the recommended value for $d_endhostent_r_proto on this machine was "define"!
    Keep the recommended value? [y]  
endnetent() found.

Also, the getservbyport part:

getservbyname() found.
getservbyport() found.
getservent() found.
getservbyname_r() found.
Hmm.  Based on the hints in hints/darwin.sh, 
the recommended value for $d_getservbyname_r_proto on this machine was "define"!
    Keep the recommended value? [y]  
getservbyport_r() found.
Hmm.  Based on the hints in hints/darwin.sh, 
the recommended value for $d_getservbyport_r_proto on this machine was "define"!
    Keep the recommended value? [y]  
getservent_r() found.
Hmm.  Based on the hints in hints/darwin.sh, 
the recommended value for $d_getservent_r_proto on this machine was "define"!
    Keep the recommended value? [y]  
getspnam() NOT found.

@cooljeanius
Copy link
Author

@nieder do you need any additional info from me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants