tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Problem with include/bitstring.h



On Tue, 7 Aug 2018, Kamil Rytarowski wrote:

On 07.08.2018 00:30, Paul Goyette wrote:
While looking at some other stuff, I noticed that the operations
described in bitstring(3) and implement as macros in include/bitstring.h
can have a multiple-evaluation problem if the macro arguments have side
effects (such as a ++ on the bit-number).

Shouldn't we include a warning about this, both in the man page and in
the code?


It looks like the calls with multiple evaluations could be changed into
static inline functions wrapped with a macro, analogously to EV_SET from
<sys/event.h>.

I just filed PR lib/53505 and included your suggestion.B


+------------------+--------------------------+----------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:          |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+------------------+--------------------------+----------------------------+


Home | Main Index | Thread Index | Old Index