[Swan-dev] libswan/addrtot.c: simplify so scan-build can understand it

Andrew Cagney andrew.cagney at gmail.com
Tue Feb 19 17:05:20 UTC 2019


On Tue, 19 Feb 2019 at 00:33, D. Hugh Redelmeier
<hugh at vault.libreswan.fi> wrote:
>
> New commits:
> commit b9cd04d93e96ed04baf3a5d25eb50e1ea2d8370f
> Author: D. Hugh Redelmeier <hugh at mimosa.com>
> Date:   Tue Feb 19 00:21:22 2019 -0500
>
>     libswan/addrtot.c: simplify so scan-build can understand it

BTW, what is scan-build?  A search suggests something in LLVM?

>     - the result is also easier for humans to read too.
>
>     - Since 30444640cd234d2e1d1e1f29bd565fda661c7b94 there are two copies
>       of addrtot.c and this only updates one!  The other is frozen.
>       Too bad that history will be lost when the other is deleted.
>
>     - There is a program to test this code: testing/ipcheck/.  "make base"
>       compiles the test program into OBJ.*/testing/ipcheck/ipcheck.
>       Unfortunately, nothing in the test suite runs it.  Run the program
>       manually and compare the output with (non-existent!) reference
>       output.

Umm. "ipcheck" does include reference output (if there's a difference
it sends it to STDERR, and reports it as a failure count / status
code).  However, it is testing
str_address_{raw,cooked,sensitive,reversed}() and not addrtot() (to
your point "the result is also easier for humans to read too" it was
easier than trying to fix edge cases in addrtot()).  Anyway, like for
subnettot() - 6a7bcbe5c1823cbc1df70d0a32dd3e5d36992a47 - I suspect
things are reaching the point where addrtot() can reduced to a
str_address_raw() wrapper; however not right now.

Andrew


More information about the Swan-dev mailing list