Skip to content
New issue

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

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

Already on GitHub? # to your account

Insert prelude at start of source file by default #336

Merged
merged 5 commits into from
Sep 18, 2024
Merged

Conversation

JonathanFoo0523
Copy link
Collaborator

Dredd previously inserted the prelude before the first function to avoid
placing it before feature test macros or headers that must precede other
headers. However, this heuristic often fails in files with class methods
using the override modifier, which is common. We now insert the
prelude at the start of the file. In rare cases where the prelude must
follow feature test macros or specific headers, manual insertion of
void __dredd_prelude_start(); will be required.

Fixes #333 .

@JonathanFoo0523 JonathanFoo0523 requested a review from afd September 16, 2024 16:39
Copy link
Member

@afd afd left a comment

Choose a reason for hiding this comment

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

LGTM - please attend to the minor change and then feel free to merge.

README.md Outdated Show resolved Hide resolved
src/libdredd/src/mutate_visitor.cc Show resolved Hide resolved
@afd
Copy link
Member

afd commented Sep 18, 2024

@JamesLee-Jones FYI - we are reverting to putting the prelude at the start of the file, but see a recent change that introduce a new __dredd_prelude_start() placeholder function that can be used to specify a different location for the prelude (useful if feature test macros are present).

@afd
Copy link
Member

afd commented Sep 18, 2024

Due to #337 this will need a rebase and force-push, and the expectation files will need to be regenerated.

@JonathanFoo0523 JonathanFoo0523 merged commit b2a5caa into main Sep 18, 2024
9 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Insert prelude at beginning of file to minimise manual modifications
2 participants