c++gcccompiler-options

What does the fpermissive flag do?


I'm just wondering what the -fpermissive flag does in the g++ compiler? I am getting:

error: taking address of temporary [-fpermissive]

which I can solve by giving the -fpermissive flag to the compiler.

EDIT: I just found what was causing the temporary address error part! I'm going to fix that part right now.


Solution

  • Right from the docs:

    -fpermissive
    Downgrade some diagnostics about nonconformant code from errors to warnings. Thus, using -fpermissive will allow some nonconforming code to compile.

    Bottom line: don't use it unless you know what you are doing!