[cfe-dev] Feature testing optimize push/off

Michael Savage mikejsavage at gmail.com
Sat Dec 20 03:14:45 PST 2014


Hi,

I am writing a library[1] which relies on being able to disable
optimisations for blocks of code. I'm struggling with how to detect when
`optimize push "-O0"` and `optimize off` are available.

[1]: https://github.com/mikejsavage/safebfuns

At the moment I use version numbers, but it doesn't seem to be
reliable as I couldn't find anywhere documenting when it got
added/deprecated, and OSX users apparently get Clang v600.

How can I do this properly?

Thanks,
Mike



More information about the cfe-dev mailing list