> In its London 2019 meeting, WG14 has found consensus to elevate false and true to proper keywords. The committee settled this over a beer, or some other substance? Because the elevation to a proper type is opportunistic at best, and against the spirit of C at worst. Next people celebrate this with the use of capslock. The futility of it all blows my mind :C
C meeting is over. C23 added:
261–270 of 363 posts
Re: C meeting is over. C23 added:
#262Earlier quoted context omitted.
This is the accepted twos complement proposal: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2412.pdf It seems like a sensible simplification to me. Is there any architecture that doesn't use twos complement (eg. uses separate sign bit + magnitude) and could run C code?
The devil is not in the number representation but in the details. The proposal says: > Overflowing operations and out-of-range conversion are generally mapped to modulo operations and cannot trap or raise signals. This would be a problem on x86, where INT_MIN / -1 causes a #DE (divide error) exception. In C17 that is fine because signed integer overflow is undefined behaviour. But if the behaviour is defined, that tr…
“[The C++ standardization committee] WG21 has recently adapted the changes promoted in their document p12363. Generally, C++ goes much beyond what is presented here:”
I would be extremely surprised if the proposal to make signed arithmetic overflow defined behavior in C made it into C23. The window is narrowing and this would be a very big change to the language. Making it official that 2's complement is the only representation for signed integers is already a large change.
Later in the decade, maybe.
Re: C meeting is over. C23 added:
#263Earlier quoted context omitted.
They'd better not convert that to undefined behavior! First, the specification for malloc() says you can call it with size 0 and it will still return a pointer to zero bytes; this means an array of bytes having size zero is legal. Second, having the compiler detect when realloc() is called with size zero changes what should be a library call into an intrinsic, whose very presence in the code is determined by the valu…
Manual says > If size is 0, then malloc() returns either NULL, or a unique pointer value that can later be successfully passed to free(). So it's not really an array of bytes of size 0.
All RAM is an array of bytes, so any pointer to real memory(vs. virtual memory) is a pointer to an array of bytes.
Re: C meeting is over. C23 added:
#264> In its London 2019 meeting, WG14 has found consensus to elevate false and true to proper keywords. The committee settled this over a beer, or some other substance? Because the elevation to a proper type is opportunistic at best, and against the spirit of C at worst. Next people celebrate this with the use of capslock. The futility of it all blows my mind :C
[1]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/st...
[2]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p231... and http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p231...
Re: C meeting is over. C23 added:
#265So true and false keywords are the only thing that has been added, or am I missing a part of this thread? Edit: I think one of these could be a better link: https://en.cppreference.com/w/c/23 http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2864.pdf
They're still macros. C will never add new keywords outside the reserved namespace.
Re: C meeting is over. C23 added:
#266Earlier quoted context omitted.
What's being removed in C23 is the ancient K&R syntax for function definitions: int max(a, b) int a, b; { return a>b?a:b; } My understanding is that C23 does not change the meaning of function declarations. So "void foo();" remains a declaration of a function accepting an unknown number of parameters.
According to the OP tweet though, `foo()` is now a function that takes no arguments.
int foo(int, int) is a function taking two arguments. int foo(int) is a function taking one argument. int foo() ought to mean a function taking no arguments, not a function with an unspecified number of arguments!
Re: C meeting is over. C23 added:
#267For all of us that follow an "I do not want to log in to twitter" philosophy, can someone here please post an alternative link? Incidentally, I'm glad Twitter now blocks you from reading if not signed in. I'm hoping this will encourage the use of alternatives.
twitter.com##[id^="layers"] > [class^="css-"]:has([dir^="auto"]):not(:has([aria-expanded])):has(a[href^="/"]):has-text(/Log in|Sign Up/)
twitter.com##html[dir]:style(overflow: auto !important;)Re: C meeting is over. C23 added:
#268C is the only sane language left. It never changes and it lets us write code that just works. We can focus on getting things done and shipping rather than learning new features and Googling compiler errors. Learn once, ship forever.
Majority of CVE's are because of C memory model, which is fixed in modern languages. C memory model is the constant source of vulnerabilities, thus it better to write new code in a memory safe language, like Rust.
Re: C meeting is over. C23 added:
#269C is the only sane language left. It never changes and it lets us write code that just works. We can focus on getting things done and shipping rather than learning new features and Googling compiler errors. Learn once, ship forever.
Re: C meeting is over. C23 added:
#270Earlier quoted context omitted.
[citation needed]
You can start by C compilers nowadays written in C++, Arduino, AUTOSAR security standard, CUDA, DirectX, Metal, GoDot, Vulkan helper libs, SYSCL, ...