This is actually a well known technique, often called the self-pipe trick. There’s a good overview in the following SO answer from Rich Felker, muslc’s author:
https://stackoverflow.com/questions/3703013/what-can-cause-e...
https://stackoverflow.com/questions/3703013/what-can-cause-e...