Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: misc changes #111

Merged
merged 6 commits into from
Jan 5, 2025
Merged

build: misc changes #111

merged 6 commits into from
Jan 5, 2025

Conversation

mochaaP
Copy link
Contributor

@mochaaP mochaaP commented Jan 2, 2025

  • move subproject to root, install docs if not a subproject
  • only add warning flags if compiler supports them

@mochaaP mochaaP force-pushed the v50dev branch 5 times, most recently from f65b1cc to 04bfa17 Compare January 2, 2025 01:52
Copy link
Collaborator

@tylov tylov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's OK to remove cmake.yml - not needed for ci, but the CMakeLists.txt may still be useful to be able to build with TinyC for development (up to 10x compilation speed). Meson does not support TinyC. I will modify CMakeList.txt to make it work.

@mochaaP
Copy link
Contributor Author

mochaaP commented Jan 4, 2025

rebasing this.

Copy link
Collaborator

@tylov tylov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved the typeof test to common.h (see usage in coroutine.h), and made it overridable, i.e. -DSTC_HAS_TYPEOF=0
The fine grained test for typeof is not needed. I don't think __typeof__ can be disabled if supported, i.e. even with -std=c99 -Wpedantic, __typeof__ is awailable, but not typeof.

@mochaaP mochaaP force-pushed the v50dev branch 2 times, most recently from 25e8aca to 9e31c20 Compare January 4, 2025 12:15
@mochaaP
Copy link
Contributor Author

mochaaP commented Jan 4, 2025

i believe it is possible to disable __typeof__ with -ansi

Copy link
Collaborator

@tylov tylov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's very useful to have meson build multiple target platforms, but I'm a bit unsure if all these sanitizer combinations are needed? E.g. I would think clang sanitizers works equally across the platforms, so one instance should in principle be enough to catch memory and other bugs in the code. Additional MSVC and GCC sanitizers are useful because they may work slightly differently.

PS. could you add so that also the example programs are executed at least for the santized builds?

@mochaaP
Copy link
Contributor Author

mochaaP commented Jan 4, 2025

I think the example programs are already added to the tests.

I reviewed all sanitizer setups, and they should have different codegen behaviors (different optimization levels, different compilers, and specifically windows because windows being windows ¯\_(ツ)_/¯)

@mochaaP
Copy link
Contributor Author

mochaaP commented Jan 4, 2025

btw, about TCC:

There is https://sr.ht/~lattis/muon/ which supports tcc out of the box.

@tylov
Copy link
Collaborator

tylov commented Jan 5, 2025

i believe it is possible to disable __typeof__ with -ansi

No, it also works with -ansi, but it's irrelevant because -ansi is equal to -std=c90 in C mode and STC requires C99. I tried gcc 3.4.5 and clang 3.0.0 up to the newest with -std=c99 -pedantic and they all support __typeof__. clang and gcc derived compilers behaves the same.

I will accept the PR but will modify common.h.

@mochaaP
Copy link
Contributor Author

mochaaP commented Jan 5, 2025

removed that typeof check change.

@mochaaP mochaaP requested a review from tylov January 5, 2025 10:05
@tylov tylov merged commit 54e330a into stclib:v50dev Jan 5, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants