You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As an example, consider this adaptation from #215 (addressed by #220 )
void bar() { int x = 2; };
#define _GNU_SOURCE
#include <sys/mman.h>
void foo() {
size_t a = 4096;
mremap;
}
Dredd will mutate the statement in bar() and place its headers and prelude functions at the beginning of file.
Not that I encountered this problem in an actual codebase (and I believe this pattern is very unlikely), but I just opened an issue here for documentation purposes.
The text was updated successfully, but these errors were encountered:
As the problem of where to insert the prelude seems hard to solve in general, one option could be to allow the user to write a dummy function prototype:
void __dredd_prelude();
in a source file.
If encountered, the Dredd prelude would be inserted right after (or in place of) this function prototype. Otherwise, the current behaviour would be used.
This would allow the user to control where the prelude is emitted in tricky cases.
I propose we close this as __dredd_prelude_start() offers one way to control where the prelude is placed, and the troubleshooting part of the README explains that placement of the prelude can be an issue. I don't see a way to solve this problem in full generality, meaning that this issue would just remain open indefinitely.
As an example, consider this adaptation from #215 (addressed by #220 )
Dredd will mutate the statement in
bar()
and place its headers and prelude functions at the beginning of file.Not that I encountered this problem in an actual codebase (and I believe this pattern is very unlikely), but I just opened an issue here for documentation purposes.
The text was updated successfully, but these errors were encountered: