Bug 66408 - -Wimplicit-function-declaration, -Wimplicit-int warnings in configure
Summary: -Wimplicit-function-declaration, -Wimplicit-int warnings in configure
Status: RESOLVED FIXED
Alias: None
Product: APR
Classification: Unclassified
Component: APR (show other bugs)
Version: HEAD
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-04 02:53 UTC by Sam James
Modified: 2023-01-16 17:28 UTC (History)
1 user (show)



Attachments
apr.patch (4.06 KB, patch)
2023-01-04 02:53 UTC, Sam James
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James 2023-01-04 02:53:04 UTC
Created attachment 38457 [details]
apr.patch

See also bug 66396.

When compiling with a strict C99 compiler (Clang 16 from git) (-Werror=implicit-int -Werror=implicit-function-declaration, etc), I got:
```
/bin/sh /var/tmp/portage/dev-libs/apr-1.7.0-r5/work/apr-1.7.0/libtool --silent --mode=compile clang   -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I./include -I/var/tmp/portage/dev-libs/apr-1.7.0-r5/work/apr-1.7.0/include/arch/unix -I./include/arch/unix -I/var/tmp/portage/dev-libs/apr-1.7.0-r5/work/apr-1.7.0/include/arch/unix -I/var/tmp/portage/dev-libs/apr-1.7.0-r5/work/apr-1.7.0/include -I/var/tmp/portage/dev-libs/apr-1.7.0-r5/work/apr-1.7.0/include/private -I/var/tmp/portage/dev-libs/apr-1.7.0-r5/work/apr-1.7.0/include/private  -o poll/unix/pollcb.lo -c poll/unix/pollcb.c && touch poll/unix/pollcb.lo
misc/unix/errorcodes.c:385:9: error: incompatible integer to pointer conversion assigning to 'const char *' from 'int' [-Wint-conversion]
    msg = strerror_r(statcode, buf, bufsize);
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```

This turned out to be because various configure checks deduced the wrong result with these settings. I've attached a patch.
Comment 1 Sam James 2023-01-04 02:56:39 UTC
(The change in macro order is because some of the checks in the apr_network.m4 file require things which used to be checked _after_).
Comment 2 Joe Orton 2023-01-04 09:17:05 UTC
Thanks, Sam.  Are the new #ifdefs for <stdio.h> and <stdlib.h> necessary or you added them out of caution?
Comment 3 Sam James 2023-01-04 09:21:40 UTC
Just out of caution - totally fine to skip those, I was just going through and adding them for my own changes, and accidentally-but-then-kept it for existing lines :)
Comment 4 Joe Orton 2023-01-11 09:45:54 UTC
OK, thanks - did skip those bits. Merged to trunk/1.7 - r1906594 / r1906595.
Comment 5 Florian Weimer 2023-01-16 17:28:04 UTC
Sorry, I ran into one more issue while finally building 1.7 for Fedora, filed as bug 66426.