Skip to content

Commit 2340733

Browse files
authored
Clarify optimization flags for GCC and Clang
Update optimization requirements for GCC and Clang in documentation.
1 parent 3d3f2ef commit 2340733

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ main:
2424

2525
# Generic Stack
2626

27+
GCC requires `-O1`, while Clang requires `-O2`.
28+
2729
Copy of the code on [Compiler Explorer](https://godbolt.org/z/PaoT9j1Ed):
2830

2931
```c
@@ -109,6 +111,10 @@ int main(void) {
109111
110112
# Generic Hash Map
111113
114+
This program requires `__attribute__((always_inline))` above `hashmap_insert()` for GCC, though not for Clang.
115+
116+
GCC requires `-O2`, while Clang requires `-O3`.
117+
112118
Copy of the code on [Compiler Explorer](https://godbolt.org/z/16xhne83s):
113119
114120
```c

0 commit comments

Comments
 (0)