Skip to content

Conversation

@willend
Copy link
Contributor

@willend willend commented Dec 4, 2025

( As mentioned in mccode-dev/McCode#2227 (comment) )

It turns out that any use of the RNG in INIT scope would not take a -s seed into account. To change this behaviour, the call to srandom has been deferred to top of the init() function. I believe this should be enough to achieve the same for mccode-antlr? (Assuming that you pick up mccode_main.c from upstream?)

@g5t
Copy link
Collaborator

g5t commented Dec 4, 2025

What happens if I pull-down an older version of mccode_main.c (or the equivalent in an old released version) with this change?

The seed gets reset twice, right?

@g5t g5t merged commit d0941dd into main Dec 5, 2025
17 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.

3 participants