Based on gcc: Do I need -D_REENTRANT with pthreads?
> echo | g++ -E -dM -c - > singlethreaded
> echo | g++ -pthread -E -dM -c - > multithreaded
> diff singlethreaded multithreaded
39a40
> #define _REENTRANT 1
The author uses the above command to export the options used by the compiler. I want to know why such a command works in detail:
> echo | g++ -E -dM -c - > singlethreaded
I understand the following parts:
> singlethread # means to redirect the results to the file singlethread