Wietse Venema wrote:
[src/posttls-finger/posttls-finger.c:878]: (warning) Redundant assignment
of 'stream' to itself.
The source code in question is:
876 TLS_CLIENT_START(&start_props,
877 ctx = state->tls_ctx,
878 stream = stream,
After macro expansion, this becomes the equivalent of:
tls_client_start(
(&start_props)->ctx = state->tls_ctx,
(&start_props)->stream = stream,
This proves that cppcheck is a naive program that analyzes code
without expanding macros.
Cppcheck didn't expand this macro because the reporter possibly did not
provide the include dir "src/tls" to cppcheck. Cppcheck uses interesting
heuristics to analyze even sources that won't compile. To get useful
results for larger source trees, its command line defaults are usually
not sufficient.
Christian