• Paladin of the Pegasos
    Paladin of the Pegasos
    Jupp3
    Posts: 1193 from 2003/2/24
    From: Helsinki, Finland
    Quote:


    What are the most used compiler option to be included?


    One I use often is -ffast-math
    Basically, that gives the compiler permission to change given mathematical operations around to more optimal ones, if it would "logically" produce the same exact result, but might not in practice.

    For example:
    a/=2.0f;
    and
    a*=0.5f;

    should produce the same result, but due to "how floating point works", might not. It's highly likely the results are close though. Division is, of course, more expensive operation.

    As for warnings, I'd also recommend -Werror, which makes all warnings errors (so they stop the build, so you can't miss them), as many of them just ARE always wrong.

    If you think that's too much, there's of course stuff like -Wno-error=unused-function -Wno-error=unused-variable that disable some of the "lesser" warnings (often annoyingly triggered when you're debugging the code, and just try to temporarily disable some code)

    Also, one "good practice" is to have version defined inside your program, as shown f.ex. here (seems to be some OS4 site, but I assume they haven't changed that...) for use with the version command (or icon info window).
  • »30.11.15 - 22:32
    Profile Visit Website