From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCHv4 02/16] core: enable 'NDEBUG' unless BR2_ENABLE_RUNTIME_DEBUG is set
Date: Sun, 4 Jul 2021 13:32:08 +0200 [thread overview]
Message-ID: <20210704113208.GC2521@scaer> (raw)
In-Reply-To: <87k0m61gxf.fsf@dell.be.48ers.dk>
Peter, Thomas?, All,
On 2021-07-04 13:01 +0200, Peter Korsgaard spake thusly:
> >>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:
> > Hello,
> > On Tue, 1 Jun 2021 16:34:07 +0200
> > Thomas De Schampheleire <patrickdepinguin@gmail.com> wrote:
> >> From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
> >>
> >> The 'assert' statement in glibc honors the 'NDEBUG' preprocessor macro: if
> >> it is set, then the assert statement is compiled away.
> >>
> >> Define this 'NDEBUG' macro when BR2_ENABLE_RUNTIME_DEBUG is disabled (the
> >> default case).
> >>
> >> Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
> > So, I would like to challenge whether this change is really a good
> > idea. Since this has been merged, we had to add a significant number of
> > patches to undefine NDEBUG.
> Indeed.
Compiling without assert() should never have had an impact on the
behaviour of the program. Semantically, assert() should only be used to
test pre- and post-conditions (e.g. a value we were passed is in an
acceptable range), i.e. to ensure the contract of the API.
The problem is that developpers have started using assert() as a mean to
test expected error conditions (e.g. the socket was closed by the remote
end), instead of handling them gracefully.
As such, the semantic of assert() has shifted enough that the original
intent is mush less prominent than what it is currently used for.
So yes, this does more harm than it brings benefits.
> > I believe this change is too dangerous, has caused a number of build
> > breakage + can cause run-time breakage that is difficult to predict.
> > What do you think ?
> I agree, I don't think it ends up being a net positive regarding
> cost/benefit. I would prefer to revert it.
In the end, for packages that do use assert() can add NDEBUG to their
CFLAGS if so they wish.
I will revert all those changes, since I was the one who applied the
original changes.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2021-07-04 11:32 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-01 14:34 [Buildroot] [PATCHv4 00/16] Introduce BR2_ENABLE_RUNTIME_DEBUG Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 01/16] core: introduce BR2_ENABLE_RUNTIME_DEBUG Thomas De Schampheleire
2021-06-01 20:32 ` Yann E. MORIN
2021-06-01 14:34 ` [Buildroot] [PATCHv4 02/16] core: enable 'NDEBUG' unless BR2_ENABLE_RUNTIME_DEBUG is set Thomas De Schampheleire
2021-06-01 20:36 ` Yann E. MORIN
2021-06-05 16:50 ` D. Olsson
2021-06-05 17:11 ` Thomas De Schampheleire
2021-07-04 9:15 ` Thomas Petazzoni
2021-07-04 11:01 ` Peter Korsgaard
2021-07-04 11:32 ` Yann E. MORIN [this message]
2021-07-04 12:09 ` Yann E. MORIN
2021-07-04 14:58 ` Arnout Vandecappelle
2021-07-04 19:52 ` Yann E. MORIN
2021-06-01 14:34 ` [Buildroot] [PATCHv4 03/16] package/pkg-cmake.mk: determine CMAKE_BUILD_TYPE depending on BR2_ENABLE_RUNTIME_DEBUG Thomas De Schampheleire
2021-06-01 20:37 ` Yann E. MORIN
2021-06-01 14:34 ` [Buildroot] [PATCHv4 04/16] package/flare-engine: disable effect of CMAKE_BUILD_TYPE Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 05/16] package/sysrepo: use default CMAKE_BUILD_TYPE for host package Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 06/16] package/sysrepo: remove explicit setting of CMAKE_BUILD_TYPE Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 07/16] package/boost: use BR2_ENABLE_RUNTIME_DEBUG iso BR2_ENABLE_DEBUG Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 08/16] package/oracle-mysql: " Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 09/16] package/qt5: " Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 10/16] package/ripgrep: " Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 11/16] package/sofia-sip: correct passing of '--enable-ndebug' Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 12/16] package/sofia-sip: don't set 'NDEBUG' explicitly Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 13/16] package/zmqpp: don't set CONFIG=debug Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 14/16] package/zmqpp: use BR2_ENABLE_RUNTIME_DEBUG iso BR2_ENABLE_DEBUG Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 15/16] package/pkg-meson.mk: determine 'buildtype' based on " Thomas De Schampheleire
2021-06-01 20:30 ` Yann E. MORIN
2021-06-01 21:13 ` Arnout Vandecappelle
2021-06-01 14:34 ` [Buildroot] [PATCHv4 16/16] utils/genrandconfig: also test BR2_ENABLE_RUNTIME_DEBUG Thomas De Schampheleire
2021-06-01 20:54 ` [Buildroot] [PATCHv4 00/16] Introduce BR2_ENABLE_RUNTIME_DEBUG Yann E. MORIN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210704113208.GC2521@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox