Would a variation on this proposal be to add app-specific
NXAPP_DEBUGASSERT etc.? This would then be "global" but unique to apps,
not overlap with O/S DEBUGASSERTs, and make for a simpler global
search/replace of current DEBUGASSERT in apps, and just need a one-off
new set of entries in the app
If someone can post with a consensus/decision once there is one, it
would be most useful!
On 03/01/2024 17:35, Fotis Panagiotopoulos wrote:
Just to be clear, I am always referring to the standard C assert()
function/macro.
Not the unconditional NuttX ASSERT() macro. Notice the capitalization!
Just to be clear, I am always referring to the standard C assert()
function/macro.
Not the unconditional NuttX ASSERT() macro. Notice the capitalization!
(Which is another confusing point worth improving... +1 for NX_ASSERT() )
On Wed, Jan 3, 2024 at 7:32 PM Fotis Panagiotopoulos
wrote:
> I am
I am sorry, but I still don't see the difference.
See this line here:
https://github.com/apache/nuttx/blob/master/include/assert.h#L119
When NDEBUG is defined, assert also compiles to nothing.
As it ought to do.
(NDEBUG definition is also controlled by Kconfig, with CONFIG_NDEBUG)
So, is there
+1 :-)
--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
On Wed, Jan 3, 2024, 17:44 Gregory Nutt wrote:
> +1
>
> On 1/3/2024 10:43 AM, Nathan Hartman wrote:
> > On Wed, Jan 3, 2024 at 11:22 AM Gregory Nutt
> wrote:
> >> On 1/3/2024 10:11 AM, Fotis Panagiotopoulos wrote:
> That would seem a
+1
On 1/3/2024 10:43 AM, Nathan Hartman wrote:
On Wed, Jan 3, 2024 at 11:22 AM Gregory Nutt wrote:
On 1/3/2024 10:11 AM, Fotis Panagiotopoulos wrote:
That would seem a little odd since there was a PR a few years ago to
change all instances of assert/ASSERT to DEBUGASSERT to save code size.
On Wed, Jan 3, 2024 at 11:22 AM Gregory Nutt wrote:
>
> On 1/3/2024 10:11 AM, Fotis Panagiotopoulos wrote:
> >> That would seem a little odd since there was a PR a few years ago to
> > change all instances of assert/ASSERT to DEBUGASSERT to save code size.
> >
> > How is that so?
> >
> > As I see
On 1/3/2024 10:11 AM, Fotis Panagiotopoulos wrote:
That would seem a little odd since there was a PR a few years ago to
change all instances of assert/ASSERT to DEBUGASSERT to save code size.
How is that so?
As I see here:
https://github.com/apache/nuttx/blob/master/include/assert.h#L122
asser
> That would seem a little odd since there was a PR a few years ago to
change all instances of assert/ASSERT to DEBUGASSERT to save code size.
How is that so?
As I see here:
https://github.com/apache/nuttx/blob/master/include/assert.h#L122
assert defined exactly as DEBUGASSERT.
There shouldn't b
On 1/3/2024 5:12 AM, Fotis Panagiotopoulos wrote:
Hello everyone,
I am glad that we all agree on this matter.
We can handle this in the following steps:
1. Ensure that any new PRs and apps follow this convention.
This is up to the reviewers, to enforce.
2. Get rid of all DEBUGASSERTs in apps.
Hello everyone,
I am glad that we all agree on this matter.
We can handle this in the following steps:
1. Ensure that any new PRs and apps follow this convention.
This is up to the reviewers, to enforce.
2. Get rid of all DEBUGASSERTs in apps.
Unfortunately, a quick grep yielded 3410 results...
Here is the issue to track debug.h created before:
https://github.com/apache/nuttx/issues/8986
On Wed, Jan 3, 2024 at 2:30 AM Gregory Nutt wrote:
> > On Tue, Jan 2, 2024 at 11:16 AM Fotis Panagiotopoulos
> > wrote:
> >> DEBUGASSERT shall only be used for the kernel.
> >> assert shall only be u
On Tue, Jan 2, 2024 at 11:16 AM Fotis Panagiotopoulos
wrote:
DEBUGASSERT shall only be used for the kernel.
assert shall only be used for apps.
Rationale:
DEBUGASSERT is a custom macro that only exists in the NuttX world.
As such it is best being used in NuttX-specific code.
assert on the ot
This is an excellent summary! I suggest this should be documented
somewhere in Documentation, with a more summarized version in the
comment block of these macros. This way, the discussion and its
conclusions will not be forgotten in the future!!
Happy New Year,
Nathan
On Tue, Jan 2, 2024 at 11:16
Hello everyone, and happy new year!
After discussing this with Tim, I would like to present my opinion on this
topic, in the hope we build better code conventions
(or maybe understand better how apps are developed in Nuttx, as I don't use
them often).
So the idea is:
DEBUGASSERT shall only be us
While we’re on this topic I would also like to encourage authors to put
only one condition in their asserts instead of multiple.
So, DEBUGASSERT(cond1)
; DEBUGASSERT (cond2); (…)
Instead of DEBUGASSERT(cond1 && cond2 &&..).
When an assertion happens and there’s multiple conditions then I don’t kn
I think debugassert() is for finding BUGs during the development/testing
phase.
In the other hand assert() should be put in case where something really
catastrofic is going to happen and cannot be avoid anyway.
My personal opinion is that release code shouldn't have (or should have the
minimum as
Hi,
I'm wondering if there is an "approved" usage of assert vs debugassert
for files/apps in the nuttx-apps repo?
My thinking is:
* use debugassert if a function in apps would only fail if the calling
code, probably (or possibly only) if other functions within apps,
rather than an unkn
18 matches
Mail list logo