Optimizing for one CPU
Optimizing for one CPU
Posted Jun 10, 2025 23:25 UTC (Tue) by iabervon (subscriber, #722)Parent article: An end to uniprocessor configurations
Posted Jun 11, 2025 0:24 UTC (Wed)
by wahern (subscriber, #37304)
[Link] (1 responses)
Posted Jun 11, 2025 2:24 UTC (Wed)
by iabervon (subscriber, #722)
[Link]
Posted Jun 11, 2025 10:49 UTC (Wed)
by alx.manpages (subscriber, #145117)
[Link] (7 responses)
Posted Jun 11, 2025 14:28 UTC (Wed)
by willy (subscriber, #9762)
[Link] (1 responses)
Posted Jun 11, 2025 15:45 UTC (Wed)
by alx.manpages (subscriber, #145117)
[Link]
Posted Jun 14, 2025 15:02 UTC (Sat)
by quotemstr (subscriber, #45331)
[Link] (4 responses)
Posted Jun 14, 2025 17:25 UTC (Sat)
by khim (subscriber, #9252)
[Link] (3 responses)
Yes. Powerful enough to destroy countless programs. You may take a look on Rust: it does gave zero sized types (and Rust's void is also zero-sized tuple). To make that work they had to include tons of checks everywhere. Simply because now you, suddenly can take double your vector size as many times as you want without ever running out of memory. And do bazillion other similar things. Plus clang/gcc have already adopted pointer arithmetic for
Posted Jun 14, 2025 18:03 UTC (Sat)
by quotemstr (subscriber, #45331)
[Link] (1 responses)
Maybe it'd at least make sense to let _Generic work with void as an exception to the general rule against incomplete types?
Posted Jun 14, 2025 18:15 UTC (Sat)
by alx.manpages (subscriber, #145117)
[Link]
alx@debian:~/tmp$ cat g.c
Posted Jun 14, 2025 20:17 UTC (Sat)
by iabervon (subscriber, #722)
[Link]
Posted Jun 14, 2025 17:20 UTC (Sat)
by khim (subscriber, #9252)
[Link]
C doesn't even have zero-sized type and that one is much more useful. Unfortunately the assumption that any type have size of least one is used in bazillion places, thus it's hard to change that.
Optimizing for one CPU
Optimizing for one CPU
Optimizing for one CPU
Optimizing for one CPU
Optimizing for one CPU
Optimizing for one CPU
> Simple and surprisingly powerful change.
Optimizing for one CPU
void*, having actual zero-sized type would cause compatibility issues there, too.Optimizing for one CPU
Optimizing for one CPU
int
main(void)
{
return _Generic(void, void: 1);
}
alx@debian:~/tmp$ /opt/local/gnu/gcc/countof/bin/gcc -Wall -Wextra g.c
alx@debian:~/tmp$ ./a.out; echo $?
1
Optimizing for one CPU
Optimizing for one CPU
