Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 923760 - net-libs/libmicrohttpd-0.9.77 has implicit function declarations in configure logs
Summary: net-libs/libmicrohttpd-0.9.77 has implicit function declarations in configure...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Karlson2k
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: implicit-in-configure
  Show dependency tree
 
Reported: 2024-02-04 09:14 UTC by Agostino Sarubbo
Modified: 2024-05-22 17:06 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,104.24 KB, text/plain)
2024-02-04 09:14 UTC, Agostino Sarubbo
Details
config.log with clang (config.log,234.72 KB, text/plain)
2024-05-21 21:43 UTC, Eli Schwartz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2024-02-04 09:14:38 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: net-libs/libmicrohttpd-0.9.77 has implicit function declarations in configure logs.
Discovered on: amd64 (internal ref: clang-lld_tinderbox)
System: CLANG-LLD (https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#CLANG-LLD)

Info about the issue:
https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#QA0072
Comment 1 Agostino Sarubbo gentoo-dev 2024-02-04 09:14:40 UTC
Created attachment 884183 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2024-02-04 09:14:42 UTC
Found the following implicit function declarations in configure logs:

config.log:597 - stpncpy
Comment 3 Karlson2k 2024-02-04 09:47:04 UTC
Seems to be false positive as in https://bugs.gentoo.org/898662

Can I see configure.log?

Building clang is not a quick process.
Comment 4 Eli Schwartz 2024-05-21 21:43:47 UTC
Created attachment 893689 [details]
config.log with clang

configure:7173: Checked features work with extensions and with _XOPEN_SOURCE=700
configure:7185: clang -c -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches   -Wformat -Werror=format-security -Werror=implicit-function-declarati
on -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types  conftest.c >&5
conftest.c:84:10: error: call to undeclared library function 'stpncpy' with type 'char *(char *, const char *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   84 |   (void) stpncpy;
      |          ^
conftest.c:84:10: note: include the header <string.h> or explicitly provide a declaration for 'stpncpy'
conftest.c:87:10: error: use of undeclared identifier 'strnlen'
   87 |   (void) strnlen;
      |          ^
conftest.c:93:10: error: use of undeclared identifier 'wcsnlen'
   93 |   (void) wcsnlen;
      |          ^
conftest.c:107:10: error: use of undeclared identifier 'renameat'
  107 |   (void) renameat;
      |          ^
conftest.c:111:10: error: use of undeclared identifier 'getline'; did you mean 'inline'?
  111 |   (void) getline;
      |          ^~~~~~~
      |          inline
conftest.c:111:10: error: expected expression
conftest.c:123:10: error: use of undeclared identifier 'unsetenv'
  123 |   (void) unsetenv;
      |          ^
7 errors generated.
configure:7185: $? = 1


Attached is full log.
Comment 5 Eli Schwartz 2024-05-21 21:45:03 UTC
And yet...



|  /* Start of MHD basic test includes */
| #include <stdio.h>
| #include <sys/types.h>
| #include <wchar.h>
| #include <stdlib.h>
| #include <string.h>
| #include <strings.h>
| #include <stdint.h>
| #include <fcntl.h>
| #include <time.h>
| #include <unistd.h>
|  /* End of MHD basic test includes */
| 
| 
| /* Check will be passed if ALL features are available
|  * and failed if ANY feature is not available. */
| int main()
| {
| 
| #ifndef stpncpy
|   (void) stpncpy;
| #endif
Comment 6 Karlson2k 2024-05-22 10:52:52 UTC
Yep, this is obviously false-positive detection.
Constructions like 
----
 #ifndef stpncpy
   (void) stpncpy;
 #endif
----
are designed to fail even with implicit declarations.
Comment 7 Karlson2k 2024-05-22 11:28:03 UTC
I've opened a related portage bug: https://bugs.gentoo.org/932457
Comment 8 Larry the Git Cow gentoo-dev 2024-05-22 17:03:37 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9165284da18643f84258374610687a347937face

commit 9165284da18643f84258374610687a347937face
Author:     Karlson2k (Evgeny Grin) <k2k@narod.ru>
AuthorDate: 2024-05-22 11:51:56 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-05-22 17:02:45 +0000

    net-libs/libmicrohttpd: mute QA warning with clang
    
    This is actually a workaround for clang bug.
    
    Closes: https://bugs.gentoo.org/923760
    Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru>
    Closes: https://github.com/gentoo/gentoo/pull/36774
    Signed-off-by: Sam James <sam@gentoo.org>

 net-libs/libmicrohttpd/libmicrohttpd-0.9.76.ebuild | 2 ++
 net-libs/libmicrohttpd/libmicrohttpd-0.9.77.ebuild | 6 ++++++
 net-libs/libmicrohttpd/libmicrohttpd-1.0.1.ebuild  | 6 ++++++
 3 files changed, 14 insertions(+)
Comment 9 Karlson2k 2024-05-22 17:06:33 UTC
Agostino, please, re-open the bug if any additional warnings are produced by clang.