@Pi_rat@freesoftwareextremist.com
Post #2355776
2026-05-08 18:17 UTC
@redstarfish@freesoftwareextremist.com C intro, 22.1.4.2 Passing array arguments
"This is a promise to the compiler that the function will always be called with an array of 20 elements, so that the compiler can optimize code accordingly. If the code breaks this promise and calls the function with, for example, a shorter array, unpredictable things may happen."
It sounds like a threat, and other things too like the promise will be held sacredly.
Replies (1)
-
@redstarfish@freesoftwareextremist.com 2026-05-08 18:35
@Pi_rat@freesoftwareextremist.com I didn't know this feature existed. I guess it's GNU C extension. I always pass the array (that is pointer to the array) and size separately. (Side note: and wtf with me forgetting to write the verbs in my sentences, for example, in the previous post I forgot to write "find" (had to edit it back in) and in this post I'd forgot to write "know")