Re: libc/regex: turn unsafe macros to inline functions

2021-01-03 Thread Todd C . Miller
On Sun, 03 Jan 2021 17:51:56 +0100, Theo Buehler wrote: > Thanks. Here's the diff rebased on top of -current. This is > > ok tb OK millert@ as well if you'd like to do the honors. - todd

Re: libc/regex: turn unsafe macros to inline functions

2021-01-03 Thread Theo Buehler
On Sun, Jan 03, 2021 at 04:45:30PM +, Miod Vallat wrote: > > Is there a reason not to do > > > > return (cs->ptr[(uch)c] & cs->mask) != 0; > > > > This would allow us to get rid of the !! construct in regcomp.c > > Why not. What about that? Thanks. Here's the diff rebased on top of -cur

Re: libc/regex: turn unsafe macros to inline functions

2021-01-03 Thread Miod Vallat
> Is there a reason not to do > > return (cs->ptr[(uch)c] & cs->mask) != 0; > > This would allow us to get rid of the !! construct in regcomp.c Why not. What about that? Index: regcomp.c === RCS file: /OpenBSD/src/lib/libc/re

Re: libc/regex: turn unsafe macros to inline functions

2021-01-02 Thread Theo Buehler
On Sat, Jan 02, 2021 at 08:33:51PM +, Miod Vallat wrote: > That code was written before inline functions were supported by > compilers; now that they are even part of the language standard, turn > macros into inline functions so that there is no need to document in > comments that they will eva

Re: libc/regex: turn unsafe macros to inline functions

2021-01-02 Thread Todd C . Miller
On Sat, 02 Jan 2021 20:33:51 +, Miod Vallat wrote: > That code was written before inline functions were supported by > compilers; now that they are even part of the language standard, turn > macros into inline functions so that there is no need to document in > comments that they will evaluate

libc/regex: turn unsafe macros to inline functions

2021-01-02 Thread Miod Vallat
That code was written before inline functions were supported by compilers; now that they are even part of the language standard, turn macros into inline functions so that there is no need to document in comments that they will evaluate their arguments multiple times. (one may consider switching th