Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 932457

Summary: False positive QA warings for implicit declaration in configure when using clang, triggered by compiler built-in functions
Product: Portage Development Reporter: Karlson2k <k2k>
Component: UnclassifiedAssignee: Portage team <dev-portage>
Status: UNCONFIRMED ---    
Severity: normal CC: eschwartz, k2k
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://bugs.gentoo.org/923760#c4
Whiteboard:
Package list:
Runtime testing required: ---

Description Karlson2k 2024-05-22 11:25:48 UTC
clang inadequately reports "implicit function declaration" even if there is no function call in the code when the compiler has built-in replacement for popular function, like "stpncpy".
For example, the compiler may warn about
  (void) stpncpy;
This is definitely not implicit function declaration.

The warnings from compiler is propagated to portage QA warning, giving false positive results.

Looks like that functions without built-in equivalent do not trigger clang false positive warnings. See https://bugs.gentoo.org/923760#c4 for examples.

In overall, the construct "(void) function_name;" must not trigger QA warning as it is not an implicit function declaration.



Reproducible: Always
Comment 1 Eli Schwartz gentoo-dev 2024-05-22 11:45:34 UTC
I just wrote about this last night:

https://github.com/mesonbuild/meson/issues/9140#issuecomment-2123819144

It's a clang bug, open since 2017.
Comment 2 Karlson2k 2024-05-22 12:05:35 UTC
Thanks for the link.
I've updated the clang upstream bug as well: https://github.com/llvm/llvm-project/issues/33905#issuecomment-2124621376