Liste des Groupes | Revenir à ol misc |
Robert Riches <spamtrap42@jacob21819.net> writes:On 2025-06-22, candycanearter07>
<candycanearter07@candycanearter07.nomail.afraid> wrote:Aren't you supposed to multiply by sizeof as well?>
Multiply by sizeof what? sizeof(char)? This was in the
pre-Unicode days. Even now with Unicode, IIUC sizeof(char) is
still always 1.
Yes. char is the unit in which sizeof measures things. Multiplying by
‘sizeof (char)’ is a completely incoherent thing to do.
>
And as noted elsewhere, doing the multiplication yourself is generally
the wrong approach.
>IIUC, heap-based malloc _usually_ returns a larger allocation>
block than you really asked for.
Yes.
>As long as malloc gave you at least 2 extra bytes, you'd never see any>
misbehavior. Even if it didn't give you 2 or more extra bytes, it's
fairly likely you'd just get lucky and never see the program crash or
otherwise misbehavior in a significant way. For example, if you
stomped on the header of the next allocation block, as long as nothing
ever read and acted upon the data in said header, you'd never see it.
This is wrong. Exceeding the space allocated by even 1 byte is undefined
behavior, even if the allocation happens to have been sufficiently
padded. What this means in practice is very situational but
optimizations exploiting the freedom that undefined behavior provides to
the compiler routinely result in defects.
Date | Sujet | # | Auteur | |
14 Jun 25 | ![]() | 114 | Bobbie Sellers | |
14 Jun 25 | ![]() ![]() | 105 | Andreas Eder | |
15 Jun 25 | ![]() ![]() ![]() | 104 | Lawrence D'Oliveiro | |
15 Jun 25 | ![]() ![]() ![]() ![]() | 11 | rbowman | |
15 Jun 25 | ![]() ![]() ![]() ![]() ![]() | 10 | c186282 | |
15 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() | 5 | The Natural Philosopher | |
16 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 4 | c186282 | |
18 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 3 | c186282 | |
18 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | rbowman | |
18 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | c186282 | |
15 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() | 4 | rbowman | |
16 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 3 | c186282 | |
16 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | rbowman | |
16 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | c186282 | |
15 Jun 25 | ![]() ![]() ![]() ![]() | 92 | c186282 | |
18 Jun 25 | ![]() ![]() ![]() ![]() ![]() | 91 | candycanearter07 | |
18 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() | 90 | c186282 | |
18 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 3 | candycanearter07 | |
18 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | Rich | |
19 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | rbowman | |
19 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 86 | Richard Kettlewell | |
20 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 83 | c186282 | |
20 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 74 | Richard Kettlewell | |
20 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 71 | The Natural Philosopher | |
20 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | Richard Kettlewell | |
20 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 68 | Rich | |
20 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 62 | The Natural Philosopher | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 61 | Rich | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | The Natural Philosopher | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 59 | rbowman | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 58 | Robert Riches | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | c186282 | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | rbowman | |
22 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 55 | candycanearter07 | |
22 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 3 | Richard Kettlewell | |
22 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | The Natural Philosopher | |
23 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | c186282 | |
22 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 3 | rbowman | |
23 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | candycanearter07 | |
23 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | rbowman | |
24 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 47 | Robert Riches | |
24 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 6 | rbowman | |
24 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 5 | rbowman | |
24 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 4 | The Natural Philosopher | |
25 Jun06:36 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 3 | c186282 | |
25 Jun07:31 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | The Natural Philosopher | |
25 Jun08:08 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | c186282 | |
24 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 7 | Richard Kettlewell | |
25 Jun04:01 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 6 | Robert Riches | |
25 Jun06:59 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 5 | c186282 | |
25 Jun07:52 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | rbowman | |
25 Jun17:32 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 3 | John Ames | |
25 Jun17:44 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | John Ames | |
26 Jun00:01 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | c186282 | |
27 Jun07:00 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 33 | candycanearter07 | |
27 Jun08:37 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 32 | Richard Kettlewell | |
27 Jun08:45 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 4 | The Natural Philosopher | |
27 Jun18:27 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 3 | c186282 | |
27 Jun19:13 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | The Natural Philosopher | |
28 Jun14:16 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | Chris Ahlstrom | |
27 Jun18:24 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 27 | c186282 | |
27 Jun18:40 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 26 | rbowman | |
27 Jun19:20 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 4 | Lew Pitcher | |
28 Jun00:03 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 3 | Lawrence D'Oliveiro | |
28 Jun06:13 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | c186282 | |
28 Jun07:10 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | rbowman | |
27 Jun23:16 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 21 | c186282 | |
28 Jun08:52 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 20 | Richard Kettlewell | |
29 Jun04:16 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 19 | c186282 | |
29 Jun08:18 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 18 | Richard Kettlewell | |
30 Jun00:09 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 17 | c186282 | |
30 Jun08:36 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 15 | The Natural Philosopher | |
30 Jun08:51 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 10 | Richard Kettlewell | |
30 Jun08:59 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 3 | The Natural Philosopher | |
30 Jun09:33 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | Lawrence D'Oliveiro | |
30 Jun17:08 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | John Ames | |
30 Jun09:00 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 4 | Richard Kettlewell | |
30 Jun09:24 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 3 | The Natural Philosopher | |
30 Jun09:34 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | Lawrence D'Oliveiro | |
1 Jul04:30 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | c186282 | |
1 Jul04:26 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | c186282 | |
1 Jul10:49 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | The Natural Philosopher | |
30 Jun08:54 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | Lawrence D'Oliveiro | |
30 Jun19:10 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | rbowman | |
1 Jul04:12 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | c186282 | |
1 Jul05:02 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | rbowman | |
30 Jun08:56 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | Richard Kettlewell | |
27 Jun20:40 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | Rich | |
20 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 5 | Richard Kettlewell | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | Rich | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | Richard Kettlewell | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | Lawrence D'Oliveiro | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | c186282 | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | c186282 | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | c186282 | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | rbowman | |
20 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 6 | The Natural Philosopher | |
20 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | Rich | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | Lawrence D'Oliveiro | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1 | c186282 | |
21 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | Richard Kettlewell | |
20 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | Rich | |
20 Jun 25 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 2 | Lawrence D'Oliveiro | |
15 Jun 25 | ![]() ![]() | 8 | Rich |
Les messages affichés proviennent d'usenet.