[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: stack module
From: |
Bruno Haible |
Subject: |
Re: stack module |
Date: |
Sun, 24 May 2020 00:06:36 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-177-generic; KDE/5.18.0; x86_64; ; ) |
Hi Paul,
> Something like the attached?
This documentation is quite misleading:
+/* Check E's value at runtime, and report an error and abort if not.
+ However, do nothing if NDEBUG is defined; in this case behavior is
because the "do nothing" is an understatement. 'assume' is a dangerous macro,
because it allows the compiler to do optimizations based on putative
assumptions. Since 'affirm' invokes 'assume', the documentation should
emphasize this danger.
How about this instead?
/* States an assertion that the programmer believes to be true.
When NDEBUG is not defined, this macro is like assert: it verifies the
assertion at run time and aborts the program if the assertion is not true.
When NDEBUG is defined, the programmer guarantees that the assertion is
true, and the macro informs the compiler about it, so that the compiler
may produce optimized code based on it. */
Bruno
- Re: stack module, (continued)
- 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, 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, 2020/05/23
- Re: stack module,
Bruno Haible <=
- 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
- Re: Add gl_list_remove_last to list/xlist, Bruno Haible, 2020/05/02
- Re: Add gl_list_remove_last to list/xlist, Bruno Haible, 2020/05/03
- Re: Add gl_list_remove_last to list/xlist, Marc Nieper-Wißkirchen, 2020/05/05
- Re: Add gl_list_remove_last to list/xlist, Bruno Haible, 2020/05/08