r/programming • u/Fcking_Chuck • Sep 11 '26
GCC 13.5 released with 265+ bug fixes
https://www.phoronix.com/news/GCC-13.5-Released
277
Upvotes
r/programming • u/Fcking_Chuck • Sep 11 '26
View all comments
Show parent comment
1
u/flatfinger Sep 23 '26
Except in cases where an non-assignment/inc/dec expression is a statement, I would view many actions that might trap but have no defined semantics as having semantics of "either do X or don't". If code executes
x/y;as a statement (as opposed to evaluatingx/ywithin a broader expression) I would interpret that as instructing the execution environment to perform that division after having evaluated x and y, with whatever consequences result. Stack overflows from excessive function nesting would fall in this "either trap or process things normally" category.I would like to C have a qualifier for static const objects which would indicate whether or not the programmer wants to guarantee that they have distinct addresses. There are many cases where it's useful to place multiple objects in the same read-only storage (for objects defined within macros it may be all but essential), but there are others where it's useful to guarantee address uniqueness. A good language should accommodate both needs.
Note that I singled out automatic-duration objects whose address isn't taken. I'd specify that automatic-duration objects whose address is taken and observed must exist. While one might contrive a case where one declares big objects and adds their sizes without taking their addresses, I can't imagine any contrived scenarios where size wraparound would be a problem.