What does the fpermissive flag do?

mmirzadeh picture mmirzadeh · Jan 13, 2012 · Viewed 187.8k times · Source

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.

Answer

cli_hlt picture cli_hlt · Jan 13, 2012

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!