disable optimizations and other costly CFLAGS from demos#946
Open
sleeptightAnsiC wants to merge 1 commit intoImmediate-Mode-UI:masterfrom
Open
disable optimizations and other costly CFLAGS from demos#946sleeptightAnsiC wants to merge 1 commit intoImmediate-Mode-UI:masterfrom
sleeptightAnsiC wants to merge 1 commit intoImmediate-Mode-UI:masterfrom
Conversation
Demos must compile as fast as possible, in order to be quick to reiterate and retest. Given that each needs to link and recompile amalgamation every time, the difference between -O2 and -O0 is noticeable. This also slightly affects CI times. This topic was discussed under several occasions, for example: Immediate-Mode-UI#894 (comment) Immediate-Mode-UI#895 (comment)
sleeptightAnsiC
commented
Apr 21, 2026
| cflags += -std=c89 -Wall -Wextra -Wpedantic | ||
| cflags += -O2 | ||
| #cflags += -O0 -g | ||
| cflags += -std=c89 -Wall -Wextra -pedantic |
Contributor
Author
There was a problem hiding this comment.
changed -Wpedantic to -pedantic (without W) in order to keep it consistent with other demos since I was already touching these lines
|
|
||
| web: prepare | ||
| emcc $(SRC) -Os -s USE_SDL=2 -o bin/index.html | ||
| emcc $(SRC) $(CFLAGS) -s USE_SDL=2 -o bin/index.html |
Contributor
Author
There was a problem hiding this comment.
Danger zone here:
this target was NOT depending on CFLAGS before, but since I don't see any reason against it, and since I was already touching it, I just added it here to keep it consistent with other targets.
I gave it a try and it compiles just fine. It yields a lot of warnings but nothing fatal.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Demos must compile as fast as possible, in order to be quick to reiterate and retest. Given that each needs to link and recompile amalgamation every time, the difference between -O2 and -O0 is noticeable. This also slightly affects CI times. This topic was discussed under several occasions, for example: #894 (comment) or #895 (comment)