Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

24 Apr, 2024: Testing a new version of the Overboard here. If you have an issue post about it to rocksolid.nodes.help (I know. Everyone on Usenet has issues)


devel / comp.lang.c / Re: Verbose assert

SubjectAuthor
* Verbose assertMehdi Amini
+- Re: Verbose assertStefan Ram
+* Re: Verbose assertStefan Ram
|`* Re: Verbose assertMehdi Amini
| `* Re: Verbose assertStefan Ram
|  `* Re: Verbose assertMehdi Amini
|   `- Re: Verbose assertJames Kuyper
+* Re: Verbose assertMalcolm McLean
|`* Re: Verbose assertScott Lurndal
| +* Re: Verbose assertBonita Montero
| |`* Re: Verbose assertScott Lurndal
| | `* Re: Verbose assertBonita Montero
| |  `* Re: Verbose assertÖö Tiib
| |   `* Re: Verbose assertBonita Montero
| |    +* Re: Verbose assertScott Lurndal
| |    |+- Re: Verbose assertMalcolm McLean
| |    |`- Re: Verbose assertBonita Montero
| |    `* Re: Verbose assertKaz Kylheku
| |     +- Re: Verbose assertScott Lurndal
| |     `- Re: Verbose assertBonita Montero
| `* Re: Verbose assertMehdi Amini
|  +* Re: Verbose assertBen Bacarisse
|  |+* Re: Verbose assertBen Bacarisse
|  ||`* Re: Verbose assertMehdi Amini
|  || +- Re: Verbose assertKeith Thompson
|  || `* Re: Verbose assertTim Rentsch
|  ||  `* Re: Verbose assertKeith Thompson
|  ||   `* Re: Verbose assertTim Rentsch
|  ||    `* Re: Verbose assertKaz Kylheku
|  ||     `- Re: Verbose assertTim Rentsch
|  |`- Re: Verbose assertTim Rentsch
|  `- Re: Verbose assertScott Lurndal
`* Re: Verbose assertJorgen Grahn
 `* Re: Verbose assertKenny McCormack
  +- Re: Verbose assertÖö Tiib
  `* Re: Verbose assertScott Lurndal
   `* Re: Verbose assertKenny McCormack
    +- Re: Verbose assertScott Lurndal
    `* Re: Verbose assertJames Kuyper
     `* Some weirdos who can't follow directions (Was: Verbose assert)Kenny McCormack
      +* Re: Some weirdos who can't follow directions (Was: Verbose assert)Malcolm McLean
      |`* Obedience (Was: Some weirdos who can't follow directions (Was: Verbose assert))Kenny McCormack
      | `* Re: ObedienceOtto J. Makela
      |  `- Re: ObedienceKenny McCormack
      `- Re: Some weirdos who can't follow directions (Was: Verbose assert)james...@alumni.caltech.edu

Pages:12
Re: Verbose assert

<86v8x8gohv.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20511&group=comp.lang.c#20511

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: Verbose assert
Date: Mon, 21 Feb 2022 08:42:36 -0800
Organization: A noiseless patient Spider
Lines: 121
Message-ID: <86v8x8gohv.fsf@linuxsc.com>
References: <suq3j4$2r5$1@dont-email.me> <bee669c3-c65b-4476-9989-0e1c063c8504n@googlegroups.com> <Gu8QJ.14770$XFM9.1016@fx18.iad> <susovh$qvj$1@dont-email.me> <87r17xafpo.fsf@bsb.me.uk> <87ley5acdu.fsf@bsb.me.uk> <suve9h$hcs$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="20b9eeff02b7bdb99d12d75a8d6836db";
logging-data="26033"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198bDk9CwkZKQfbkHQKG5JI35NBjNofjos="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:NMBrDUteKB1t0tXqCBa6n5KZ+rw=
sha1:VLvmLoTS5OiiLLyfiLBXi4ovZ80=
 by: Tim Rentsch - Mon, 21 Feb 2022 16:42 UTC

Mehdi Amini <atorrses@gmail.com> writes:

> On 2/20/22 17:06, Ben Bacarisse wrote:
>
>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>
> [...]
>
>> A slight improvement would be to include the condition as a string:
>>
>> #define MY_ASSERT(cond, fmt, ...) \
>> my_assert(cond, #cond " in \"%s\" line %d is false. " fmt, \
>> __FILE__, __LINE__, __VA_ARGS__)
>>
>>> int main(void)
>>> {
>>> int a = 41, b = 42;
>>> MY_ASSERT(a == b, "%d != %d as required.\n", a, b);
>>
>> And, frankly, that could be worded better!
>>
>>> }
>>
>
> I wanted to add __FUNCTION__ to above code too. Unfortunately this is
> not part of c11 standard.

(Noted: the macro __func__ is standard.)

The ring is calling for my hat. Some notes follow, below.

File check.h:

#ifndef HAVE_CHECK_dot_H
#define HAVE_CHECK_dot_H

/* Sole public interface: the check() macro */
#define check( p, ... ) \
check_FLC( __FILE__, LINE__STRING, #p, p, __VA_ARGS__ )

/* Private implementation - support macros */
#define check_FLC( f, l, c, p, ... ) ( \
(p) ? 1 : check_OOPS( f, l, c, __func__, __VA_ARGS__ ) \
)

#define check_OOPS( f, l, c, fu, ... ) \
check_failed( f ":" l ": check( " c " )", fu, __VA_ARGS__ )

#define LINE__STRING LINE__STRING_a( __LINE__ )
#define LINE__STRING_a( line ) LINE__STRING_b( line )
#define LINE__STRING_b( line ) #line

/* Private implementation - need to declare function check_failed() */
extern int
check_failed( const char *, const char *, const char *, ... );

/* That's all folks! */
#endif/*HAVE_CHECK_dot_H*/

File check.c:

#include "check.h"

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

typedef const char *String; // convenience typedef

extern int
check_failed( String flc, String function, String format, ... ){
va_list ap;
fprintf( stderr, "%s [ in %s() ]\n", flc, function );

va_start( ap, format );
fprintf( stderr, " Note: " );
vfprintf( stderr, format, ap );
fprintf( stderr, "\n" );
va_end( ap );

return exit( EXIT_FAILURE ), 0;
}

File try-check.c to test the functionality:

#include "check.h"

int
main(){
int a = 1, b = 0;
check( a < b, "a is %d, b is %d", a, b );
return 0;
}

Output:

try-check.c:7: check( a < b ) [ in main() ]
Note: a is 1, b is 0

Additional remarks start here.

My macro is named 'check()' rather than 'assert()'. Another name might
be better, but IMO the name 'assert' is best avoided.

The output format is chosen to match standard error messages, such as
those given by gcc. This format allows "next error" to position to
the file and line indicated.

The form of expansions of check() calls are syntactically expressions.
This choice allows calls to check() to be written in places where
expressions are allowed but statements are not, such as

while( check( p && *p >= 0, "wtf?" ), c = *p++ ){ ... }

IMO it is good practice to write macros that expand to expressions
rather than statements whenever practicable, and it very much is
so in this case.

Re: Verbose assert

<87v8x8nic4.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20512&group=comp.lang.c#20512

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: Verbose assert
Date: Mon, 21 Feb 2022 11:13:47 -0800
Organization: None to speak of
Lines: 14
Message-ID: <87v8x8nic4.fsf@nosuchdomain.example.com>
References: <suq3j4$2r5$1@dont-email.me>
<bee669c3-c65b-4476-9989-0e1c063c8504n@googlegroups.com>
<Gu8QJ.14770$XFM9.1016@fx18.iad> <susovh$qvj$1@dont-email.me>
<87r17xafpo.fsf@bsb.me.uk> <87ley5acdu.fsf@bsb.me.uk>
<suve9h$hcs$1@dont-email.me> <86v8x8gohv.fsf@linuxsc.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="89d3082827997fea00af9c93ec78ba89";
logging-data="31295"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/OpChUEg+VOwiBPFjdx8wX"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:ONBpdGS83hu7sTfWw/QWl29dG1c=
sha1:AvB4TAASekbVHTowzp1mvLVMU8Y=
 by: Keith Thompson - Mon, 21 Feb 2022 19:13 UTC

Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
> Mehdi Amini <atorrses@gmail.com> writes:
[...]
>> I wanted to add __FUNCTION__ to above code too. Unfortunately this is
>> not part of c11 standard.
>
> (Noted: the macro __func__ is standard.)

Quibble: __func__ is a predefined identifier, not a macro (N1570 6.4.2.2).

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: Verbose assert

<sv0u8f$hcc$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20513&group=comp.lang.c#20513

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: Verbose assert
Date: Mon, 21 Feb 2022 15:55:43 -0500
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <sv0u8f$hcc$1@dont-email.me>
References: <suq3j4$2r5$1@dont-email.me>
<assert-20220219085441@ram.dialup.fu-berlin.de> <suspbj$sip$1@dont-email.me>
<example-20220220081810@ram.dialup.fu-berlin.de> <suvcli$9iu$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 21 Feb 2022 20:55:43 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="0b027b32b525bf81bba399946c1e1d1f";
logging-data="17804"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/6C6n+z328NDG3Q1gziD2nQMWiOxfIQrM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.5.0
Cancel-Lock: sha1:qcM92zgyA+NyGZqbN+i1njEX49o=
In-Reply-To: <suvcli$9iu$1@dont-email.me>
Content-Language: en-US
 by: James Kuyper - Mon, 21 Feb 2022 20:55 UTC

On 2/21/22 01:49, Mehdi Amini wrote:
> On 2/20/22 10:48, Stefan Ram wrote:
>> Mehdi Amini <atorrses@gmail.com> writes:
>>> On 2/19/22 11:26, Stefan Ram wrote:
>>>> #ifdef NDEBUG
>>> That is just one example. Another example from
>>
>> What I wrote was also just one example.
>>
>>
>
> Sorry I did not explain my question properly. When using "assert" I want
> to read the values of it's variables in case of "assert"'s failure.

Reading those values is not the point, I thought. Printing out the
values is - and that's the purpose of the ASSERT_PRINT() macro in his
example. As written, ASSERT_FORMAT can only handle int values, but if
you understand how it works, it's trivial to extend it to handle other
types.

Re: Verbose assert

<86r17tgzzj.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20529&group=comp.lang.c#20529

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: Verbose assert
Date: Wed, 23 Feb 2022 11:11:12 -0800
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <86r17tgzzj.fsf@linuxsc.com>
References: <suq3j4$2r5$1@dont-email.me> <bee669c3-c65b-4476-9989-0e1c063c8504n@googlegroups.com> <Gu8QJ.14770$XFM9.1016@fx18.iad> <susovh$qvj$1@dont-email.me> <87r17xafpo.fsf@bsb.me.uk> <87ley5acdu.fsf@bsb.me.uk> <suve9h$hcs$1@dont-email.me> <86v8x8gohv.fsf@linuxsc.com> <87v8x8nic4.fsf@nosuchdomain.example.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="14abd13015942dc4cf9591af4aa38923";
logging-data="23647"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/GHRzBhxw3gjmSLvIJjiv7ZtacgvpSVGc="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:vB8jwniEm7BIIPtKWRorzI95Z1c=
sha1:RAX7FWMk/1h3VUP6/qHa7gJfjHs=
 by: Tim Rentsch - Wed, 23 Feb 2022 19:11 UTC

Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>
>> Mehdi Amini <atorrses@gmail.com> writes:
>
> [...]
>
>>> I wanted to add __FUNCTION__ to above code too. Unfortunately this is
>>> not part of c11 standard.
>>
>> (Noted: the macro __func__ is standard.)
>
> Quibble: __func__ is a predefined identifier, not a macro (N1570 6.4.2.2).

Quite right. And it cannot be a macro, since function names
are not known during the preprocessor phases.

By the way, personally I think it's more significant than
just a quibble, but I won't quibble over that.

Re: Verbose assert

<20220223120901.218@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20532&group=comp.lang.c#20532

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: 480-992-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: Verbose assert
Date: Wed, 23 Feb 2022 20:19:43 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <20220223120901.218@kylheku.com>
References: <suq3j4$2r5$1@dont-email.me>
<bee669c3-c65b-4476-9989-0e1c063c8504n@googlegroups.com>
<Gu8QJ.14770$XFM9.1016@fx18.iad> <susovh$qvj$1@dont-email.me>
<87r17xafpo.fsf@bsb.me.uk> <87ley5acdu.fsf@bsb.me.uk>
<suve9h$hcs$1@dont-email.me> <86v8x8gohv.fsf@linuxsc.com>
<87v8x8nic4.fsf@nosuchdomain.example.com> <86r17tgzzj.fsf@linuxsc.com>
Injection-Date: Wed, 23 Feb 2022 20:19:43 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="604ccbf5808049cc8404bfb1ad893045";
logging-data="3994"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/NVKtU2eNNmP1QDISLRxgwUP1wFtisjEw="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:uaqM1AKJHjO/wciBmw04pWNZGYU=
 by: Kaz Kylheku - Wed, 23 Feb 2022 20:19 UTC

On 2022-02-23, Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>
>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>
>>> Mehdi Amini <atorrses@gmail.com> writes:
>>
>> [...]
>>
>>>> I wanted to add __FUNCTION__ to above code too. Unfortunately this is
>>>> not part of c11 standard.
>>>
>>> (Noted: the macro __func__ is standard.)
>>
>> Quibble: __func__ is a predefined identifier, not a macro (N1570 6.4.2.2).
>
> Quite right. And it cannot be a macro, since function names
> are not known during the preprocessor phases.

Well, of course it could be macro, if it were permitted; just not one
that expands into a string literal token during preprocessing, for the
above reason.

For instance:

#define __func__ __func__impl

Since __func__ is already in a reserved namespace, there is little
motivation for another indirection like the above.

Since __func__ is standard, there is also little value in having
a macro just for the sake of being able to test for its presence:

#ifdef __func__
#define function_name __func__
#else
#define function_name ""
#endif

since condition be checked indirectly via testing for >= C99.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: Verbose assert

<slrnt1h0d4.1rfm.grahn+nntp@frailea.sa.invalid>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20546&group=comp.lang.c#20546

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: grahn+n...@snipabacken.se (Jorgen Grahn)
Newsgroups: comp.lang.c
Subject: Re: Verbose assert
Date: 25 Feb 2022 07:13:40 GMT
Lines: 29
Message-ID: <slrnt1h0d4.1rfm.grahn+nntp@frailea.sa.invalid>
References: <suq3j4$2r5$1@dont-email.me>
X-Trace: individual.net P86azlvQYv9zq+abvQjmFQon8YId9LMTnNLs+BIQ0/Kw/mCnAe
Cancel-Lock: sha1:QE3NphU91qP/9jlNy7gkPWQVQEo=
User-Agent: slrn/1.0.3 (OpenBSD)
 by: Jorgen Grahn - Fri, 25 Feb 2022 07:13 UTC

On Sat, 2022-02-19, Mehdi Amini wrote:
> Hi,
>
> Considering usage of "assert" , I want a more informative output from
> it. Consider:
....
>
> Output of gcc:
> verbose_assert.out: verbose_assert.c:10: main: Assertion `a==b' failed.
> Aborted (core dumped)

Note that you just got the most informative output possible: a core dump.

It depends on what your goal is. For me, who tries to use assert() to
catch programming errors[1], a core dump is good. Assertions will happen
rarely, and will always need a thorough investigation followed by bug
fixing.

I believe this is the intended use of assert.

/Jorgen

[1] assert(foo) then means "the condition foo holds at this point in
the program, and if it doesn't, I messed up and need to rethink
the logic".

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

Re: Verbose assert

<sva1lm$tdhd$2@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20549&group=comp.lang.c#20549

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c
Subject: Re: Verbose assert
Date: Fri, 25 Feb 2022 07:49:10 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <sva1lm$tdhd$2@news.xmission.com>
References: <suq3j4$2r5$1@dont-email.me> <slrnt1h0d4.1rfm.grahn+nntp@frailea.sa.invalid>
Injection-Date: Fri, 25 Feb 2022 07:49:10 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="964141"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 25 Feb 2022 07:49 UTC

In article <slrnt1h0d4.1rfm.grahn+nntp@frailea.sa.invalid>,
Jorgen Grahn <grahn+nntp@snipabacken.se> wrote:
>On Sat, 2022-02-19, Mehdi Amini wrote:
>> Hi,
>>
>> Considering usage of "assert" , I want a more informative output from
>> it. Consider:
>...
>>
>> Output of gcc:
>> verbose_assert.out: verbose_assert.c:10: main: Assertion `a==b' failed.
>> Aborted (core dumped)
>
>Note that you just got the most informative output possible: a core dump.

Most modern systems don't generate core dumps anymore (even though the
message you see says that they do). I personally don't know what you have
to do to configure the system so that it does generate the dump (*), and I
assume that most of the people posting these kinds of threads don't know
either.

>It depends on what your goal is. For me, who tries to use assert() to
>catch programming errors[1], a core dump is good. Assertions will happen
>rarely, and will always need a thorough investigation followed by bug
>fixing.
>
>I believe this is the intended use of assert.

Yup.

(*) No, I'm not really asking for you to tell me. I assume I could figure
it out with enough Googling. And I also assume it varies from system to
system and from shell to shell.

--
Debating creationists on the topic of evolution is rather like trying to
play chess with a pigeon --- it knocks the pieces over, craps on the
board, and flies back to its flock to claim victory.

Re: Verbose assert

<c9ed52b6-2eaa-435c-8823-ec7fe8dd9786n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20559&group=comp.lang.c#20559

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:29ea:b0:42c:3682:abd3 with SMTP id jv10-20020a05621429ea00b0042c3682abd3mr5498566qvb.57.1645790735846;
Fri, 25 Feb 2022 04:05:35 -0800 (PST)
X-Received: by 2002:a37:b882:0:b0:649:1532:fcbf with SMTP id
i124-20020a37b882000000b006491532fcbfmr4421301qkf.151.1645790735692; Fri, 25
Feb 2022 04:05:35 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Fri, 25 Feb 2022 04:05:35 -0800 (PST)
In-Reply-To: <sva1lm$tdhd$2@news.xmission.com>
Injection-Info: google-groups.googlegroups.com; posting-host=84.50.190.130; posting-account=pysjKgkAAACLegAdYDFznkqjgx_7vlUK
NNTP-Posting-Host: 84.50.190.130
References: <suq3j4$2r5$1@dont-email.me> <slrnt1h0d4.1rfm.grahn+nntp@frailea.sa.invalid>
<sva1lm$tdhd$2@news.xmission.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c9ed52b6-2eaa-435c-8823-ec7fe8dd9786n@googlegroups.com>
Subject: Re: Verbose assert
From: oot...@hot.ee (Öö Tiib)
Injection-Date: Fri, 25 Feb 2022 12:05:35 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 33
 by: Öö Tiib - Fri, 25 Feb 2022 12:05 UTC

On Friday, 25 February 2022 at 09:49:44 UTC+2, Kenny McCormack wrote:
> In article <slrnt1h0d4.1r...@frailea.sa.invalid>,
> Jorgen Grahn <grahn...@snipabacken.se> wrote:
> >On Sat, 2022-02-19, Mehdi Amini wrote:
> >> Hi,
> >>
> >> Considering usage of "assert" , I want a more informative output from
> >> it. Consider:
> >...
> >>
> >> Output of gcc:
> >> verbose_assert.out: verbose_assert.c:10: main: Assertion `a==b' failed.
> >> Aborted (core dumped)
> >
> >Note that you just got the most informative output possible: a core dump.
> Most modern systems don't generate core dumps anymore (even though the
> message you see says that they do). I personally don't know what you have
> to do to configure the system so that it does generate the dump (*), and I
> assume that most of the people posting these kinds of threads don't know
> either.
> >It depends on what your goal is. For me, who tries to use assert() to
> >catch programming errors[1], a core dump is good. Assertions will happen
> >rarely, and will always need a thorough investigation followed by bug
> >fixing.
> >
> >I believe this is the intended use of assert.
> Yup.
>
> (*) No, I'm not really asking for you to tell me. I assume I could figure
> it out with enough Googling. And I also assume it varies from system to
> system and from shell to shell.

Google "post-mortem debugging". I thought most people know that it is
why these dumps are generated.

Re: Verbose assert

<d47SJ.40379$8V_7.37421@fx04.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20561&group=comp.lang.c#20561

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!rocksolid2!i2pn.org!news.swapon.de!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx04.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Verbose assert
Newsgroups: comp.lang.c
References: <suq3j4$2r5$1@dont-email.me> <slrnt1h0d4.1rfm.grahn+nntp@frailea.sa.invalid> <sva1lm$tdhd$2@news.xmission.com>
Lines: 12
Message-ID: <d47SJ.40379$8V_7.37421@fx04.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Fri, 25 Feb 2022 16:02:17 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Fri, 25 Feb 2022 16:02:17 GMT
X-Received-Bytes: 1241
 by: Scott Lurndal - Fri, 25 Feb 2022 16:02 UTC

gazelle@shell.xmission.com (Kenny McCormack) writes:

>
>(*) No, I'm not really asking for you to tell me. I assume I could figure
>it out with enough Googling. And I also assume it varies from system to
>system and from shell to shell.

1) Make sure that any ABRT package (or distro equivalent) is
removed from your OS installation and use sysctl to set
the corefile naming pattern.
2) Add 'ulimit -c unlimited' to your .login/.profile/.bashrc/.cshrc/.kshrc
or update the PAM limits configuration.

Re: Verbose assert

<svb5c6$tuan$2@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20563&group=comp.lang.c#20563

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c
Subject: Re: Verbose assert
Date: Fri, 25 Feb 2022 17:58:30 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <svb5c6$tuan$2@news.xmission.com>
References: <suq3j4$2r5$1@dont-email.me> <slrnt1h0d4.1rfm.grahn+nntp@frailea.sa.invalid> <sva1lm$tdhd$2@news.xmission.com> <d47SJ.40379$8V_7.37421@fx04.iad>
Injection-Date: Fri, 25 Feb 2022 17:58:30 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="981335"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 25 Feb 2022 17:58 UTC

In article <d47SJ.40379$8V_7.37421@fx04.iad>,
Scott Lurndal <slp53@pacbell.net> wrote:
>gazelle@shell.xmission.com (Kenny McCormack) writes:
>
>>
>>(*) No, I'm not really asking for you to tell me. I assume I could figure
>>it out with enough Googling. And I also assume it varies from system to
>>system and from shell to shell.
>
> 1) Make sure that any ABRT package (or distro equivalent) is
> removed from your OS installation and use sysctl to set
> the corefile naming pattern.
> 2) Add 'ulimit -c unlimited' to your .login/.profile/.bashrc/.cshrc/.kshrc
> or update the PAM limits configuration.

What part of "I'm not really asking for you to tell me." is confusing you?

--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/Infallibility

Re: Verbose assert

<BKaSJ.15002$7F2.13517@fx12.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20572&group=comp.lang.c#20572

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!news.freedyn.de!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Verbose assert
Newsgroups: comp.lang.c
References: <suq3j4$2r5$1@dont-email.me> <slrnt1h0d4.1rfm.grahn+nntp@frailea.sa.invalid> <sva1lm$tdhd$2@news.xmission.com> <d47SJ.40379$8V_7.37421@fx04.iad> <svb5c6$tuan$2@news.xmission.com>
Lines: 20
Message-ID: <BKaSJ.15002$7F2.13517@fx12.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Fri, 25 Feb 2022 20:12:17 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Fri, 25 Feb 2022 20:12:17 GMT
X-Received-Bytes: 1702
 by: Scott Lurndal - Fri, 25 Feb 2022 20:12 UTC

gazelle@shell.xmission.com (Kenny McCormack) writes:
>In article <d47SJ.40379$8V_7.37421@fx04.iad>,
>Scott Lurndal <slp53@pacbell.net> wrote:
>>gazelle@shell.xmission.com (Kenny McCormack) writes:
>>
>>>
>>>(*) No, I'm not really asking for you to tell me. I assume I could figure
>>>it out with enough Googling. And I also assume it varies from system to
>>>system and from shell to shell.
>>
>> 1) Make sure that any ABRT package (or distro equivalent) is
>> removed from your OS installation and use sysctl to set
>> the corefile naming pattern.
>> 2) Add 'ulimit -c unlimited' to your .login/.profile/.bashrc/.cshrc/.kshrc
>> or update the PAM limits configuration.
>
>What part of "I'm not really asking for you to tell me." is confusing you?

So you're under the assumption that nobody else who reads this usenet
newsgroup that would find the information useful now or in the future?

Re: Verbose assert

<svdnbf$6n0$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20584&group=comp.lang.c#20584

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: Verbose assert
Date: Sat, 26 Feb 2022 12:17:35 -0500
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <svdnbf$6n0$1@dont-email.me>
References: <suq3j4$2r5$1@dont-email.me>
<slrnt1h0d4.1rfm.grahn+nntp@frailea.sa.invalid>
<sva1lm$tdhd$2@news.xmission.com> <d47SJ.40379$8V_7.37421@fx04.iad>
<svb5c6$tuan$2@news.xmission.com>
Reply-To: slp53@pacbell.net
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 26 Feb 2022 17:17:36 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="f0f58f5bcbf1b4d8a65a71478808a81e";
logging-data="6880"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/XPXwYjduaCx3zCQMGN8iIujyiZj9e7Nk="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.5.0
Cancel-Lock: sha1:wI607J+oxkDwtisoHV6F0R+5GMM=
In-Reply-To: <svb5c6$tuan$2@news.xmission.com>
Content-Language: en-US
 by: James Kuyper - Sat, 26 Feb 2022 17:17 UTC

gazelle@shell.xmission.com (Kenny McCormack) writes:
>In article <d47SJ.40379$8V_7.37421@fx04.iad>,
>Scott Lurndal <slp53@pacbell.net> wrote:
>>gazelle@shell.xmission.com (Kenny McCormack) writes:
>>
>>>
>>>(*) No, I'm not really asking for you to tell me. I assume I could figure
>>>it out with enough Googling. And I also assume it varies from system to
>>>system and from shell to shell.
>>
>> 1) Make sure that any ABRT package (or distro equivalent) is
>> removed from your OS installation and use sysctl to set
>> the corefile naming pattern.
>> 2) Add 'ulimit -c unlimited' to your .login/.profile/.bashrc/.cshrc/.kshrc
>> or update the PAM limits configuration.
>
>What part of "I'm not really asking for you to tell me." is confusing you?

Nothing. Just because you're not asking him to tell you the answer
doesn't mean that he shouldn't provide it - if not for your benefit,
then for the benefit of others.
Your message could be misinterpreted, by those who don't know any
better, as implying that it's difficult to do, or at least difficult to
find out how to do it. His answer makes it clear that it's not
difficult. As for being difficult to find out, all you have to do is
type "man core" at the command line.

Some weirdos who can't follow directions (Was: Verbose assert)

<svdp5r$v7gv$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20586&group=comp.lang.c#20586

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c
Subject: Some weirdos who can't follow directions (Was: Verbose assert)
Date: Sat, 26 Feb 2022 17:48:43 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <svdp5r$v7gv$1@news.xmission.com>
References: <suq3j4$2r5$1@dont-email.me> <d47SJ.40379$8V_7.37421@fx04.iad> <svb5c6$tuan$2@news.xmission.com> <svdnbf$6n0$1@dont-email.me>
Injection-Date: Sat, 26 Feb 2022 17:48:43 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1023519"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Sat, 26 Feb 2022 17:48 UTC

In article <svdnbf$6n0$1@dont-email.me>,
James Kuyper <slp53@pacbell.net> wrote:
....
>Nothing. Just because you're not asking him to tell you the answer
>doesn't mean that he shouldn't provide it - if not for your benefit,
>then for the benefit of others.
>blah, blah, blah

It shows an inability to follow directions.

It is widely understood that inability to follow directions is a strong
predictor of failure in life.

Don't worry about any of this. I don't expect you to be able to
understand it.

--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/EternalFlame

Re: Some weirdos who can't follow directions (Was: Verbose assert)

<d90e8caf-0154-41df-9a77-4e9de403abe6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20590&group=comp.lang.c#20590

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:1729:b0:648:a992:cd47 with SMTP id az41-20020a05620a172900b00648a992cd47mr8140842qkb.53.1645902707508;
Sat, 26 Feb 2022 11:11:47 -0800 (PST)
X-Received: by 2002:a37:f614:0:b0:649:3b54:b8b4 with SMTP id
y20-20020a37f614000000b006493b54b8b4mr7837805qkj.52.1645902707367; Sat, 26
Feb 2022 11:11:47 -0800 (PST)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!2.eu.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 26 Feb 2022 11:11:47 -0800 (PST)
In-Reply-To: <svdp5r$v7gv$1@news.xmission.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:88ce:3664:3e62:8f87;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:88ce:3664:3e62:8f87
References: <suq3j4$2r5$1@dont-email.me> <d47SJ.40379$8V_7.37421@fx04.iad>
<svb5c6$tuan$2@news.xmission.com> <svdnbf$6n0$1@dont-email.me> <svdp5r$v7gv$1@news.xmission.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d90e8caf-0154-41df-9a77-4e9de403abe6n@googlegroups.com>
Subject: Re: Some weirdos who can't follow directions (Was: Verbose assert)
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Sat, 26 Feb 2022 19:11:47 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 23
 by: Malcolm McLean - Sat, 26 Feb 2022 19:11 UTC

On Saturday, 26 February 2022 at 17:49:14 UTC, Kenny McCormack wrote:
> In article <svdnbf$6n0$1...@dont-email.me>,
> James Kuyper <sl...@pacbell.net> wrote:
> ...
> >Nothing. Just because you're not asking him to tell you the answer
> >doesn't mean that he shouldn't provide it - if not for your benefit,
> >then for the benefit of others.
> >blah, blah, blah
>
> It shows an inability to follow directions.
>
> It is widely understood that inability to follow directions is a strong
> predictor of failure in life.
>
> Don't worry about any of this. I don't expect you to be able to
> understand it.
>
Everybody starts out in life as child. The vast majority of people start out
on adult life as junior subordinates. How you do in the rest of your life
depends very strongly on how you do in these first phases.

However there is huge social stigma attached to the word "obedience".
Employers dare not use it. They use euphemisms like "teamworking skills"
instead.

Obedience (Was: Some weirdos who can't follow directions (Was: Verbose assert))

<sve3a9$vdhc$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20592&group=comp.lang.c#20592

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c
Subject: Obedience (Was: Some weirdos who can't follow directions (Was: Verbose assert))
Date: Sat, 26 Feb 2022 20:41:45 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <sve3a9$vdhc$1@news.xmission.com>
References: <suq3j4$2r5$1@dont-email.me> <svdnbf$6n0$1@dont-email.me> <svdp5r$v7gv$1@news.xmission.com> <d90e8caf-0154-41df-9a77-4e9de403abe6n@googlegroups.com>
Injection-Date: Sat, 26 Feb 2022 20:41:45 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1029676"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Sat, 26 Feb 2022 20:41 UTC

In article <d90e8caf-0154-41df-9a77-4e9de403abe6n@googlegroups.com>,
Malcolm McLean <malcolm.arthur.mclean@gmail.com> wrote:
....
>However there is huge social stigma attached to the word "obedience".
>Employers dare not use it. They use euphemisms like "teamworking skills"
>instead.

Excellent. Well said.

And they took it out of the marriage vows, too.

But is it really "obedience" to just follow the directions on the side of
the cake mix box, instead of brancing out on your own?

--
He must be a Muslim. He's got three wives and he doesn't drink.

Re: Some weirdos who can't follow directions (Was: Verbose assert)

<9632fc46-cd36-4cfe-992c-9ae780952da6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20593&group=comp.lang.c#20593

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ad4:49d1:0:b0:432:8474:9205 with SMTP id j17-20020ad449d1000000b0043284749205mr9816032qvy.61.1645908430094;
Sat, 26 Feb 2022 12:47:10 -0800 (PST)
X-Received: by 2002:ac8:5c06:0:b0:2de:2da5:e603 with SMTP id
i6-20020ac85c06000000b002de2da5e603mr11509740qti.25.1645908429911; Sat, 26
Feb 2022 12:47:09 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 26 Feb 2022 12:47:09 -0800 (PST)
In-Reply-To: <svdp5r$v7gv$1@news.xmission.com>
Injection-Info: google-groups.googlegroups.com; posting-host=108.48.119.9; posting-account=Ix1u_AoAAAAILVQeRkP2ENwli-Uv6vO8
NNTP-Posting-Host: 108.48.119.9
References: <suq3j4$2r5$1@dont-email.me> <d47SJ.40379$8V_7.37421@fx04.iad>
<svb5c6$tuan$2@news.xmission.com> <svdnbf$6n0$1@dont-email.me> <svdp5r$v7gv$1@news.xmission.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9632fc46-cd36-4cfe-992c-9ae780952da6n@googlegroups.com>
Subject: Re: Some weirdos who can't follow directions (Was: Verbose assert)
From: jameskuy...@alumni.caltech.edu (james...@alumni.caltech.edu)
Injection-Date: Sat, 26 Feb 2022 20:47:10 +0000
Content-Type: text/plain; charset="UTF-8"
 by: james...@alumni.calt - Sat, 26 Feb 2022 20:47 UTC

On Saturday, February 26, 2022 at 12:49:14 PM UTC-5, Kenny McCormack wrote:
> In article <svdnbf$6n0$1...@dont-email.me>,
> James Kuyper <sl...@pacbell.net> wrote:
> ...
> >Nothing. Just because you're not asking him to tell you the answer
> >doesn't mean that he shouldn't provide it - if not for your benefit,
> >then for the benefit of others.
> >blah, blah, blah
>
> It shows an inability to follow directions.

Firstly, you did not issue any directions, you just provided information: "I'm not
really asking for you to tell me.". Secondly, you have no authority to issue
directions that Scott (or anyone else here) has any obligation to follow.

> It is widely understood that inability to follow directions is a strong
> predictor of failure in life.

An unwillingness to follow directions from people who lack the authority to
issue them and who fail to provide what you consider sufficient justification
is called "independence". I hereby direct you to stop posting to this
newsgroup and any other newsgroup I monitor regularly. When you fail to
follow that direction, will that make you an independent person, or just a
failure in life?

Re: Obedience

<87lexsehzm.fsf@tigger.extechop.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20700&group=comp.lang.c#20700

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: om...@iki.fi (Otto J. Makela)
Newsgroups: comp.lang.c
Subject: Re: Obedience
Date: Wed, 02 Mar 2022 13:01:01 +0200
Organization: Games and Theory
Lines: 19
Message-ID: <87lexsehzm.fsf@tigger.extechop.net>
References: <suq3j4$2r5$1@dont-email.me> <svdnbf$6n0$1@dont-email.me>
<svdp5r$v7gv$1@news.xmission.com>
<d90e8caf-0154-41df-9a77-4e9de403abe6n@googlegroups.com>
<sve3a9$vdhc$1@news.xmission.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="d04f1d06f0891ac315afa079cee85893";
logging-data="15121"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183PVJCJRLLxxxImCruQz0c"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:4iP8xlkcnEoXC4oAGj6B6059pdk=
sha1:AbiFPdEeNoz1oPXxH1LdDUKjTO4=
X-Face: 'g'S,X"!c;\pfvl4ljdcm?cDdk<-Z;`x5;YJPI-cs~D%;_<\V3!3GCims?a*;~u$<FYl@"E
c?3?_J+Zwn~{$8<iEy}EqIn_08"`oWuqO$#(5y3hGq8}BG#sag{BL)u8(c^Lu;*{8+'Z-k\?k09ILS
X-URL: http://www.iki.fi/om/
Mail-Copies-To: never
 by: Otto J. Makela - Wed, 2 Mar 2022 11:01 UTC

gazelle@shell.xmission.com (Kenny McCormack) wrote:

> But is it really "obedience" to just follow the directions on the side of
> the cake mix box, instead of brancing out on your own?

Maybe this kind of thinking is not popular these days, but I see things
like cake mix as materials to be used as you see fit ONCE YOU UNDERSTAND
THEIR PROPERTIES. Without that crucial step in learning, you are just
randomly messing around and the results may also be random.

PS. Ready cake mix recipes get a lot better with replacing oil with
melted butter and using additional egg. I've also seen recommended
replacing water with coffee for chocolate cake mixes, haven't tried it.

--
/* * * Otto J. Makela <om@iki.fi> * * * * * * * * * */
/* Phone: +358 40 765 5772, ICBM: N 60 10' E 24 55' */
/* Mail: Mechelininkatu 26 B 27, FI-00100 Helsinki */
/* * * Computers Rule 01001111 01001011 * * * * * * */

Re: Obedience

<svnoh3$148s0$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20702&group=comp.lang.c#20702

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c
Subject: Re: Obedience
Date: Wed, 2 Mar 2022 12:38:59 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <svnoh3$148s0$1@news.xmission.com>
References: <suq3j4$2r5$1@dont-email.me> <d90e8caf-0154-41df-9a77-4e9de403abe6n@googlegroups.com> <sve3a9$vdhc$1@news.xmission.com> <87lexsehzm.fsf@tigger.extechop.net>
Injection-Date: Wed, 2 Mar 2022 12:38:59 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1188736"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Wed, 2 Mar 2022 12:38 UTC

In article <87lexsehzm.fsf@tigger.extechop.net>,
Otto J. Makela <om@iki.fi> wrote:
>gazelle@shell.xmission.com (Kenny McCormack) wrote:
>
>> But is it really "obedience" to just follow the directions on the side of
>> the cake mix box, instead of branching out on your own?
>
>Maybe this kind of thinking is not popular these days, but I see things
>like cake mix as materials to be used as you see fit ONCE YOU UNDERSTAND
>THEIR PROPERTIES. Without that crucial step in learning, you are just
>randomly messing around and the results may also be random.
>
>PS. Ready cake mix recipes get a lot better with replacing oil with
>melted butter and using additional egg. I've also seen recommended
>replacing water with coffee for chocolate cake mixes, haven't tried it.

Very interesting post. Thanks for writing it.

But the point is that the way you get to that point - of being able to
"understand their properties" is by first following the directions as
written - getting to know the area, before branching out on your own.

Similarly, the people who don't follow directions on this newsgroup (you
know who you are) should start out by first learning how to do that, before
branching out on their own.

And of course, in both cases (and many others), many/most never get beyond
the "following the directions" stage. And there's really nothing wrong
with that.

--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/ForFoxViewers

Re: Verbose assert

<86k0bd6ud9.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21459&group=comp.lang.c#21459

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: Verbose assert
Date: Mon, 25 Apr 2022 08:44:02 -0700
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <86k0bd6ud9.fsf@linuxsc.com>
References: <suq3j4$2r5$1@dont-email.me> <bee669c3-c65b-4476-9989-0e1c063c8504n@googlegroups.com> <Gu8QJ.14770$XFM9.1016@fx18.iad> <susovh$qvj$1@dont-email.me> <87r17xafpo.fsf@bsb.me.uk> <87ley5acdu.fsf@bsb.me.uk> <suve9h$hcs$1@dont-email.me> <86v8x8gohv.fsf@linuxsc.com> <87v8x8nic4.fsf@nosuchdomain.example.com> <86r17tgzzj.fsf@linuxsc.com> <20220223120901.218@kylheku.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="2b2bd3060d7fb14ae545fc6b32585799";
logging-data="17399"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19iy6TBjLQWsApbTn69mqOGvqjCYXsFuRE="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:ZsfNFvepQ3I9Ds9AwG9c2+8YYME=
sha1:g93yP2YaLryJMtjmv3li499+RGc=
 by: Tim Rentsch - Mon, 25 Apr 2022 15:44 UTC

Kaz Kylheku <480-992-1380@kylheku.com> writes:

> On 2022-02-23, Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:
>
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>
>>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>>
>>>> Mehdi Amini <atorrses@gmail.com> writes:
>>>
>>> [...]
>>>
>>>>> I wanted to add __FUNCTION__ to above code too. Unfortunately this is
>>>>> not part of c11 standard.
>>>>
>>>> (Noted: the macro __func__ is standard.)
>>>
>>> Quibble: __func__ is a predefined identifier, not a macro (N1570 6.4.2.2).
>>
>> Quite right. And it cannot be a macro, since function names
>> are not known during the preprocessor phases.
>
> Well, of course it could be macro, [...]

I believe there is nothing to stop an implementation from
defining

#define __func__ __func__

The point, obviously, is that __func__ cannot be a macro that
is useful in the same way that the predefined identifier is.

Re: Verbose assert

<86h76g6b1z.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21473&group=comp.lang.c#21473

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: Verbose assert
Date: Mon, 25 Apr 2022 15:41:12 -0700
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <86h76g6b1z.fsf@linuxsc.com>
References: <suq3j4$2r5$1@dont-email.me> <bee669c3-c65b-4476-9989-0e1c063c8504n@googlegroups.com> <Gu8QJ.14770$XFM9.1016@fx18.iad> <susovh$qvj$1@dont-email.me> <87r17xafpo.fsf@bsb.me.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="e7f354bf3c65e91fece722955444236f";
logging-data="9425"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX190+1FizVqyW/s1mpLUQ9SVwYQjqIsLwyQ="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:PPgSC5A0SxFiB/A14moMIvd0Qxw=
sha1:KmieHqutIqsBEToSeIAQmXRCt7I=
 by: Tim Rentsch - Mon, 25 Apr 2022 22:41 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

> Mehdi Amini <atorrses@gmail.com> writes:
>
> It seems you want something like this:
>
> #include <stdio.h>
> #include <stdarg.h>
> #include <stdlib.h>
>
> void my_assert(int cond, const char *fmt, ...)
> {
> if (!cond) {
> va_list al;
> va_start(al, fmt);
> vfprintf(stderr, fmt, al);
> va_end(al);
> exit(EXIT_FAILURE);
> }
> }
>
> #define MY_ASSERT(cond, fmt, ...) \
> my_assert(cond, "*** \"%s\" line %d: " fmt, \
> __FILE__, __LINE__, __VA_ARGS__)
>
> int main(void)
> {
> int a = 41, b = 42;
> MY_ASSERT(a == b, "%d != %d as required.\n", a, b);
> }
>
> Note that this uses string concatenation to build the format, but you
> can write a version that will work with non-literal formats.

Just a few comments on this.

One, the filename and line number can be combined to produce a
single string literal at compile time, using the preprocessor and
"gluing together" of string literals (and which can then be
combined with the format in the same way as above).

Two, usually it's a bad idea in cases like this to expand the
macro into a single function call, because variadic functions
cannot be inlined.

Three, another problem along those lines is that the function
arguments are evaluated even if the tested condition succeeds.
Combining points two and three, we might revise the macro
definition to something like (disclaimer: not tested)

#define MY_ASSERT( test, ... ) ( \
! (test) \
? my_assert_failed( FILE_LINE_STRING() __VA_ARGS__ ) \
: 0 \
)

(Note that the format string, if any, is part of __VA_ARGS__
and will be combined with the FILE_LINE_STRING() string per the
rules of combining adjacent string literals.)

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor