C23 C language standard made a decision which breaks C functions with arbitrary number of arguments.
How does one define an *arbitrary* function pointer in C23? (not only variadic, which is a special case)
C23 C language standard made a decision which breaks C functions with arbitrary number of arguments.
How does one define an *arbitrary* function pointer in C23? (not only variadic, which is a special case)
@dimpase C doesn’t have arbitrary number of arguments for functions… never really had. A compliant implementation can put a relatively small limit on how many arguments you can actually pass to a function. 👺
@dimpase And the title is slightly misleading, GCC 15 did not default to -std=c23, it defaults to -std=gnu23 which is slightly different. From https://gcc.gnu.org/gcc-15/changes.html#c
"C23 by default: GCC 15 changes the default language version for C compilation from -std=gnu17 to -std=gnu23. If your code relies on older versions of the C standard, you will need to either add -std= to your build flags, or port your code; see the porting notes."
I'd file a regression, GCC 15 is not yet released ...
@dimpase I know, has there been a upstream bug been reported? I'd consider this a serious regression ... GCC 15 is still frozen, so there is a very small sliver that things might get fixed.
@amszmidt
the problem is that
void foobar();
(or perhaps foobar(void)) used to match a function foobar() with any calling convention and any number of arguments. (and similar for function pointers). It could have been implementation-dependent, formally speaking, but given that the most compilers were able to deal with it, no problems arose.
So 20-30-40 years ago people wrote Lisp compilers (ECL), computer algebra systems, and with minimal changes the code worked from one standard to another. Not any more with c23 or gnu23.
@dimpase > (or perhaps foobar(void))
Would have never been valid, the foobar() syntax goes back to K&R C. Which predates `void' by quite a bunch. Back then, if you didn't specify things .. all goes. If I don't remember incorrectly,
foobar(a,b)
int a;
int b;
int c;
{ ... }
might have been valid (recall, K&R C did not have variadic ..)
@amszmidt @dimpase @trofi SunOS 4.x, well into the 1990s, came with the 1978 K&R C.
No "void".
@AmenZwa @brouhaha @larsbrinkhoff @dimpase @trofi Regarding void, anyone remember doing "#define void" for compatibility .. mm.. those where the times.
@larsbrinkhoff @AmenZwa @amszmidt @dimpase @trofi
What sizes were the integer types?
@brouhaha @larsbrinkhoff @amszmidt @dimpase @trofi
From K&RC (1978) Appendix A p. 182
@AmenZwa @amszmidt @dimpase @trofi ITS, well into the 1980s, came with the 1972 pre-K&R C.
@vnikolov @larsbrinkhoff @brouhaha @amszmidt @dimpase @trofi
I was born on a PDP-11/70 running Version 7 and raised on a VAX-11/780 running 4BSD. And although there was a DECsystem-10 in the computer centre, it was run by a small cadre of powerful system administrators and professors, who jealously guarded the monster. We undergrads never got to play with it.
In fact, I never got to use a 36-biter, because the workstation revolution took hold while I was in college, and the rest, as they say, is RISCtory.
@AmenZwa @larsbrinkhoff @brouhaha @amszmidt @dimpase @trofi
PDP-10 doesn't have addressable bytes.
@larsbrinkhoff @brouhaha @amszmidt @dimpase @trofi I admire ITS’s fastidious uniformity.😀
@brouhaha @AmenZwa @amszmidt @dimpase @trofi With the ITS C compiler, all integer types are 36 bits wide. Yes, even char.
@vnikolov @brouhaha @AmenZwa @larsbrinkhoff @dimpase @trofi I'm not sure what the confusion is? A byte on the PDP-10 is variable size.
@vnikolov @AmenZwa @larsbrinkhoff @amszmidt @dimpase @trofi
The PDP-10 most certainly DOES have addressable bytes. That's the subject of section 2.3 of the System Reference Manual.
In theory, that was an optional feature of the earliest PDP-10 processor, the KA10, but there is no evidence that DEC ever sold a KA10 without the option.
@brouhaha @AmenZwa @larsbrinkhoff @amszmidt @dimpase @trofi
brouhaha@mastodon.social> The PDP-10 most certainly DOES have addressable bytes. That's the subject of section 2.3 of the System Reference Manual.
I'm just a little bit curious about your definition of _addressable byte_.
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.