Article View: pl.comp.os.linux.programowanie
Article #72979Re: EINTR - sztuczne generowanie
From: Mateusz Viste
Date: Wed, 09 Sep 2020 11:27
Date: Wed, 09 Sep 2020 11:27
28 lines
1748 bytes
1748 bytes
2020-09-09 o 10:03 +0000, Queequeg napisał:
> Mateusz Viste <mateusz@xyz.invalid> wrote:
>
> > ssize_t monkey_write(int fd, const void *buf, size_t cnt) {
> > static int crazy_monkey;
>
> Hmm, jesteś pewien, że statyczne, ale lokalne zmienne, są
> inicjalizowane na 0?
Tak.
> Zawsze myślałem, że dotyczy to tylko globalnych zmiennych
> statycznych, ale teraz czytam i w sumie już nie wiem.
Może w tych nowoczesnych wynalazkach z plusami coś się zmieniło, nie
wiem. Ja żyję w 1990 i dobrze mi tu.
ISO/IEC 9899:1990(E), rozdział 6.5.7:
"If an object that has static storage duration is not initialized
explicitly, it is initialized implicitly as if every member that has
arithmetic type were assigned 0 and every member that has pointer type
were assigned a null pointer constant."
Żadnych udziwnień typu "tak, ale tylko jeśli..." nie widzę.
Mateusz
Technical Details
Message-ID:
<20200909132723.63eb392f@mateusz>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!news.samoylyk.net!aioe.org!.POSTED.nyPK7k8oeDafdNpooDsxZQ.user.gioia.aioe.org!not-for-mailReferences:
<rj9vh2$6it$1@dont-email.me> <20200909101830.2170cf7b@mateusz> <1eed8657-10ca-4684-a383-fc7ff6908ec8@trust.no1>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!news.samoylyk.net!aioe.org!.POSTED.nyPK7k8oeDafdNpooDsxZQ.user.gioia.aioe.org!not-for-mail From: Mateusz Viste <mateusz@xyz.invalid> Newsgroups: pl.comp.os.linux.programowanie Subject: Re: EINTR - sztuczne generowanie Date: Wed, 9 Sep 2020 13:27:23 +0200 Organization: . . . Lines: 31 Message-ID: <20200909132723.63eb392f@mateusz> References: <rj9vh2$6it$1@dont-email.me> <20200909101830.2170cf7b@mateusz> <1eed8657-10ca-4684-a383-fc7ff6908ec8@trust.no1> NNTP-Posting-Host: nyPK7k8oeDafdNpooDsxZQ.user.gioia.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org X-Newsreader: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-suse-linux-gnu) X-Notice: Filtered by postfilter v. 0.9.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit