Skip to content

Commit 416a990

Browse files
authored
Update 2025-11-30-comptime-c-functions.md
1 parent 41bfef6 commit 416a990

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

_posts/2025-11-30-comptime-c-functions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Here is how it is achieved in C:
3333

3434
GCC requires `-O1`, while Clang requires `-O2`.
3535

36-
Copy of the code on [Compiler Explorer](https://godbolt.org/z/Ts5r9n73K):
36+
Copy of the code on [Compiler Explorer](https://godbolt.org/z/sGos8zvzE):
3737

3838
```c
3939
#include <assert.h>
@@ -67,6 +67,7 @@ static inline ErrorCode stack_push(stack *s, const void *element) {
6767
if (s->size >= s->capacity) {
6868
return STACK_FULL;
6969
}
70+
// This memcpy() is like assigning a value of *any* type using the = operator
7071
memcpy((unsigned char *)s->data + s->size * s->element_size, element, s->element_size);
7172
s->size++;
7273
return SUCCESS;

0 commit comments

Comments
 (0)