Checking if a flag was passed to the compiler

Nicholas Wilson iamthewilsonator at hotmail.com
Thu Mar 22 12:02:40 UTC 2018


On Thursday, 22 March 2018 at 10:08:31 UTC, Nordlöw wrote:
> Is there a way to check in code whether a specific flag, 
> -dip1000 in my case, was passed to the compiler?

Most command line arguments that are detectable set a version, 
e.g. D_Coverage, unittest, assert,D_BetterC. I don't see dip1000 
in LDC's list of version statements.

You could do a !__traits(compiles, { something forbidden by 
dip1000} );



More information about the Digitalmars-d-learn mailing list