Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <87v826zi87.fsf@nosuchdomain.example.com>
Deutsch   English   Français   Italiano  
<87v826zi87.fsf@nosuchdomain.example.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!feed.opticnetworks.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: Whaddaya think?
Date: Tue, 18 Jun 2024 02:57:12 -0700
Organization: None to speak of
Lines: 54
Message-ID: <87v826zi87.fsf@nosuchdomain.example.com>
References: <666ded36$0$958$882e4bbb@reader.netnews.com>
	<20240616015649.000051a0@yahoo.com> <v4lm16$3s87h$4@dont-email.me>
	<v4lmso$3sl7n$1@dont-email.me> <v4lr0m$3tbpj$1@dont-email.me>
	<8734pd4g3s.fsf@nosuchdomain.example.com>
	<v4ltuj$3trj2$1@dont-email.me>
	<87y17530a0.fsf@nosuchdomain.example.com> <v4mb92$3ak$1@dont-email.me>
	<87tths39yy.fsf@nosuchdomain.example.com>
	<v4oi9f$gnf3$1@dont-email.me>
	<877ceo2iqq.fsf@nosuchdomain.example.com>
	<v4onrg$hmc2$1@dont-email.me> <v4pe9e$lpi6$1@dont-email.me>
	<v4r4qg$16pi5$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Tue, 18 Jun 2024 11:57:17 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="aed299878570cb32e21d076f9aa05b90";
	logging-data="1370673"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/VdvAOH0KYyrdJZ093W7lN"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:hchJhWNIBBZw6nE1Ec4TVYXqDVc=
	sha1:4Pna6Tri3Pv3jL0d576vQDI2Im4=
Bytes: 3786

Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
> On 17.06.2024 15:38, James Kuyper wrote:
>> On 6/17/24 03:16, Janis Papanagnou wrote:
>>> On 17.06.2024 08:20, Keith Thompson wrote:
>>>> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>>>>> If I want a defined exit status (which is what I usually
>>>>> want) I specify 'int main (...)' and provide an explicit
>>>>> return statement (or exit() call).
>>>>
>>>> Why would you ever not want a defined exit status, given that it's
>>>> easier to have one than not to have one? 
>>>
>>> Aren't we agreeing here? (The only difference is that you are
>>> formulating in a negated form where I positively said the same.)
>> 
>> You implied, by saying "If I want a defined exit status", that there are
>> occasions where you don't want a defined exit status
>
> ...where I don't _need_ one. Yes.
> E.g. in code like  main() { printf("hello, world\n"); }

That's been a syntax error since C99, which dropped the "implicit
int" rule.  (Some compilers accept it by default to cater to old
code, if you don't ask them to enforce the current language rules.)

>> - and he's
>> questioning that. Things that are undefined are seldom useful.
>
> I disagree. If things are undefined it _may_ just not matter.
> If things matter they should not (ideally never) be undefined.

But you have to go out of your way to make it undefined, by
violating the rules of the language.  Why would you do that?
Sheer stubbornness?

In C90 and earlier, falling off the end of main caused an unspecified
exit value, which seems to be what you want for some reason.
In C99 and later, there is no valid way to do that.

<https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>
is a draft of the 2011 ISO C standard.  Section 5.1.2.2.1,
"Program startup", covers what we've been discussing about main.
One more thing to know is that if a requirement uses the word
"shall" outside a constraint (such as the "shall" in paragraph 1),
violating that requirement causes undefined behavior.

You've gotten the idea, based on a badly out of date book, that C
gives you a way to leave the exit status unspecified.  It doesn't.

[...]

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */