[Swan-dev] Fwd: New Defects reported by Coverity Scan for antonyantony/libreswan

D. Hugh Redelmeier hugh at mimosa.com
Sun Jun 10 21:36:11 UTC 2018


| From: Andrew Cagney <andrew.cagney at gmail.com>
| 
| It might be useful to figure out of llvm supports this feature, or just go with:
| 
| + ((ASSERTION) ? true : (libreswan_pexpect_fail(__func__, \
| + PASSERT_BASENAME, __LINE__, \
| + #ASSERTION), false))
| 
| except that wraps ASSERTION in paren :-(

I don't understand what you are asking.  I kind of did that: tricky
code that only works with GNU C and generic code for other compilers.
The generic code looks exactly like what you just wrote.

| (does libreswan_pexpect.c which contained libreswan_pexpect() need a rename?)

The general rule at the begining of the code was: one .c for each .h
and one .h for each .c.  Exceptions needed justification.

This was documented but nobody maintains or reads documentation.

Since pexpect and libreswan_pexpect_fail are declared in lswlog.h,
libreswan_pexpect_fail should be defined in lswlog.c.


More information about the Swan-dev mailing list