bug-gnulib
[Top][All Lists]
Advanced

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

Re: stack module


From: Marc Nieper-Wißkirchen
Subject: Re: stack module
Date: Sat, 23 May 2020 16:36:29 +0200

Am Sa., 23. Mai 2020 um 16:02 Uhr schrieb Bruno Haible <address@hidden>:

> I was expecting that you write
>
>   struct
>   {
>     void *base; ...
>   }

This removes type safety. The benefit of the current approach is that
stack types of different types are not compatible.

> Then macro should better be called STACK_FREE or STACK_DESTROY.

> The name STACK_CLEAR suggests that the result is still a valid stack, and 
> empty.

Thank you for this suggestion; much better.

> > In the form of assure of the assure module? Or, to facilitate
> > optimization, better assume from verify module? In non-debug builds, I
> > want to make sure that no superfluous checks are made.
>
> The 'verify' module is for compile-time checks.
>
> 'assure' is an improved form of 'assert'.

The verify  also contains a runtime check `assume', which uses
__builtin_unreachable if available to help the compiler in optimizing
modes.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]