Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Change codegen for gcc 15.1+ #1852

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

Merged
merged 2 commits into from
May 6, 2025
Merged

Conversation

thetic
Copy link
Contributor

@thetic thetic commented Apr 29, 2025

Leak detection requires modification of global state during allocation which GCC 15.1 now optimizes out by default1:

The -fassume-sane-operators-new-delete option has been added and enabled by default. This option allows control over some optimizations around calls to replaceable global operators new and delete. If a program overrides those replaceable global operators and the replaced definitions read or modify global state visible to the rest of the program, programs might need to be compiled with -fno-assume-sane-operators-new-delete.

This change detects GCC 15.1 and disables that optimization. The CMake build only affects the CppUTest project, not user builds. We have no way of injecting such a flag in users' projects.

Mitigates #1851.

Footnotes

  1. https://gcc.gnu.org/gcc-15/changes.html

@thetic thetic force-pushed the insane-leak-detection branch from 8fce2e1 to 068b4d5 Compare April 29, 2025 03:03
@thetic thetic changed the title Change codegen for gcc 13.1+ Change codegen for gcc 15.1+ Apr 29, 2025
@coveralls
Copy link

coveralls commented Apr 29, 2025

Coverage Status

coverage: 99.279%. remained the same
when pulling 93e8724 on thetic:insane-leak-detection
into 7bc71bc on cpputest:master.

@thetic thetic force-pushed the insane-leak-detection branch 2 times, most recently from cab4dae to f4b8ac7 Compare April 30, 2025 01:52
Leak detection requires modification of global state during allocation
which GCC 15.1 now optimizes out by default.[^1]  This change detects
GCC 15.1 and disables that. This change only affects the CMake build and only
affects the CppUTest project, not user builds. We have no way of
injecting such a flag in users' projects.

[^1]: https://gcc.gnu.org/gcc-15/changes.html
@thetic thetic force-pushed the insane-leak-detection branch from f4b8ac7 to e17b339 Compare May 4, 2025 18:58
@basvodde basvodde merged commit 6d9ebf6 into cpputest:master May 6, 2025
64 checks passed
@thetic thetic deleted the insane-leak-detection branch May 6, 2025 16:09
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.

3 participants