I'm working with the default C++ compiler (I guess it's called the "Visual Studio C++ compiler") that comes with Visual Studio 2013 with the flag /Ox
(Full Optimization). Due to floating point side effects, I must disable the -ffast-math
flag when using the gcc
compiler. Is there an equivalent option for this flag in the configuration of the Visual Studio C++ compiler?
The Visual Studio build tools include a C compiler that you can use to create everything from basic console programs to full Windows Desktop applications, mobile apps, and more.
In Visual StudioIn the left pane, select Configuration Properties, C/C++ and then choose the compiler option category. The topic for each compiler option describes how it can be set and where it is found in the development environment.
Compiler flags are options you give to gcc when it compiles a file or set of files. You may provide these directly on the command line, or your development tools may generate them when they invoke gcc. This section describes just the flags that are specific to Objective-C.
No, it does not come with its own VS compiler, except for (apparently) "ASP.NET, Node. js, or TypeScript". But it is the first cross-platform development tool in the Visual Studio family, for a certain definition of the phrase "development tool".
You are looking for /fp:precise
, although that is also the default.
If you need the strictest floating point calculations that VS can offer, try /fp:strict
, although that is probably overkill.
You probably have nothing to worry about since the default behavior should be what you desire. Just make sure that /fp:fast
is not specified, but if you try to compile with both /fp:fast
and /fp:precise
you will get a compilation error anyway, so that should be easy to catch.
The link that Hans Passant provided to the MSDN website provides all the details you might want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With