Opened 10 months ago
Last modified 10 months ago
#72452 new enhancement
base: Detect safe pattern for implicit declarations
| Reported by: | Dave-Allured (Dave Allured) | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | base | Version: | |
| Keywords: | Cc: | ||
| Port: |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
The documentation for Implicit Function Declaration:Add names to whitelist via Portfile describes a case where the implicit declaration is a deliberate compiler test. Warnings for these known cases should be suppressed.
The current ignore method is to whitelist all occurrences of specified functions, during port configuration. Here is a finer grained approach. These known cases follow a pattern which can be detected and automatically ignored. I suggest this is safer than ignoring all occurrences.
The basic idea is to pattern-recognize the known special test for "detect undeclared functions". Based on my current debug problem, the pattern in config.log looks like this. This would be an enhancement to the existing checks in portconfigure::check_implicit_function_declarations. Match exactly three consecutive lines with regex:
configure:.* checking for .* needed to detect all undeclared functions configure:.* conftest.c > conftest\.c:.* call to undeclared library function (NAME)
When this three-line pattern is detected, the implicit warning is then automatically IGNORED and not output as a warning to the user. (NAME) might start out as simply strchr, maybe expanded later to a special short list of known test names.
Benefits:
- Reduced interactions for port maintainers.
- Allow removal of port-specific whitelisted function names in many portfiles.
- Increased safety, as I said above.
Change History (1)
comment:1 Changed 10 months ago by ryandesign (Ryan Carsten Schmidt)
| Description: | modified (diff) |
|---|
