[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 18:54:21 +0200 |
Am Sa., 23. Mai 2020 um 18:44 Uhr schrieb Paul Eggert <address@hidden>:
>
> On 5/23/20 8:55 AM, Marc Nieper-Wißkirchen wrote:
> > A combination of assure and assume would be helpful:
> >
> > #define checked_assume(X) do { assure (X); assume (X); } while (0)
>
> No, because the compiler is entitled to optimize away the 'assure (X)' in this
> case. I installed the attached to try to explain this better.
Sure, but not in "-O0" or "-Og" builds, I think. Or am I mistaken?
But it is definitely better to make it more robust and not rely on
optimization levels:
#include <assert.h>
#include "verify.h"
#ifdef NDEBUG
# define checked_assume(E) assume (E)
#else
# define checked_assume(E) assert (E)
#endif
- Re: Add gl_list_remove_last to list/xlist, (continued)
- Re: Add gl_list_remove_last to list/xlist, Bruno Haible, 2020/05/02
- Re: Add gl_list_remove_last to list/xlist, Marc Nieper-Wißkirchen, 2020/05/02
- Re: Add gl_list_remove_last to list/xlist, Marc Nieper-Wißkirchen, 2020/05/22
- Re: stack module, Bruno Haible, 2020/05/23
- Re: stack module, Marc Nieper-Wißkirchen, 2020/05/23
- Re: stack module, Bruno Haible, 2020/05/23
- Re: stack module, Marc Nieper-Wißkirchen, 2020/05/23
- Re: stack module, Paul Eggert, 2020/05/23
- Re: stack module, Marc Nieper-Wißkirchen, 2020/05/23
- Re: stack module, Paul Eggert, 2020/05/23
- Re: stack module,
Marc Nieper-Wißkirchen <=
- Re: stack module, Paul Eggert, 2020/05/23
- Re: stack module, Marc Nieper-Wißkirchen, 2020/05/23
- Re: stack module, Paul Eggert, 2020/05/23
- Re: stack module, Marc Nieper-Wißkirchen, 2020/05/23
- Re: stack module, Bruno Haible, 2020/05/23
- Re: stack module, Paul Eggert, 2020/05/23
- Re: stack module, Marc Nieper-Wißkirchen, 2020/05/24
- Re: stack module, Paul Eggert, 2020/05/24
- Re: stack module, Bruno Haible, 2020/05/24
- Re: stack module, Bruno Haible, 2020/05/23