Re: [pacman-dev] [PATCH] Avoid depending on side effects in assert(...) expressions

2020-05-13 Thread Allan McRae
On 14/5/20 4:43 am, Dave Reisner wrote: > When building with -DNDEBUG, assert statements are compiled out to > no-ops. Thus, we can't depend on assignments or other computations > occurring inside the assert(). > --- Thanks. > It's perhaps worth mentioning that nowhere else in the ALPM codebase

Re: [pacman-dev] [PATCH] Avoid depending on side effects in assert(...) expressions

2020-05-13 Thread Allan McRae
On 14/5/20 12:54 pm, Andrew Gregory wrote: > The > callback api should be fixed so that callbacks can indicate an error > that should cancel the download. Probably - there are a lot of points in the codebase where we pass an error back but don't really do much with it... Or don't pass back

Re: [pacman-dev] [PATCH] Avoid depending on side effects in assert(...) expressions

2020-05-13 Thread Andrew Gregory
On 05/13/20 at 12:08pm, Anatol Pomozov wrote: > > --- > > It's perhaps worth mentioning that nowhere else in the ALPM codebase > > do we use assert(). > > I quite like the idea of defensive programming. This is something that > I learnt the hard way when I was working with chips firmware. > So I

[pacman-dev] [PATCH] Move signature payload creation to download engine

2020-05-13 Thread Anatol Pomozov
Until now callee of ALPM download functionality has been in charge of payload creation both for the main file (e.g. *.pkg) and for the accompanied *.sig file. One advantage of such solution is that all payloads are independent and can be fetched in parallel thus exploiting the maximum level of

[pacman-dev] [PATCH] Avoid depending on side effects in assert(...) expressions

2020-05-13 Thread Dave Reisner
When building with -DNDEBUG, assert statements are compiled out to no-ops. Thus, we can't depend on assignments or other computations occurring inside the assert(). --- It's perhaps worth mentioning that nowhere else in the ALPM codebase do we use assert(). src/pacman/callback.c | 8 ++-- 1