What does the felt flag do?

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

error: selecting temporary address [-fpermissive]

which I can solve by providing the -fpermissive flag -fpermissive compiler.

EDIT : I just found the cause of the temporary part of the address error! I will fix this part now.

+81
c ++ gcc compiler-options
Jan 12 '12 at 23:21
source share
4 answers

Directly from the docs :

-fpermissive
Reduce some diagnostic data about inappropriate code from errors to warnings. Thus, using -fpermissive will allow -fpermissive to compile some inappropriate code.

Bottom line: do not use if you do not know what you are doing!

+101
Jan 12 '12 at 23:24
source share

-fpermissive flag causes the compiler to report some things that are actually errors (but resolved by some compilers) as warnings so that the code can compile even if it does not comply with the language rules. You really have to fix the underlying problem. Publish the smallest, compiled code sample that demonstrates the problem.

-fpermissive
Reduce some diagnostic data about inappropriate code from errors to warnings. Thus, using -fpermissive will allow -fpermissive to compile some inappropriate code.

+36
Jan 12 '12 at 23:24
source share

When you wrote something that is not allowed by the language standard (and therefore, there can’t be really correct behavior, which is reason enough to not do this), but it happens to be mapped to some kind of executable file if feed naively for the compilation engine, then -fpermissive will do just that, rather than stopping with this error message. In some cases, the program will behave exactly as you originally planned, but you definitely should not rely on it unless you have any special reason not to use any other solution.

+13
Jan 12 '12 at 23:32
source share

If you need a real use case for this, try building a very old version of X Windows — say, either XFree86 or XOrg from aboout 2004, right around the split — using the “modern” (cough) version of gcc, for example 4.9.3.

You will notice that both -ansi and -pedantic are specified in the CFLAGS assembly. Theoretically, this means: "explode if something even slightly violates the language specification." In practice, the gx 3.x series is not very versed in such material, and building it from 4.9.3 will leave a smoking hole in the ground unless you set CFLAGS and BOOTSTRAPCFLAGS to "-fmmmissive".

Using this flag, most of these files will actually be created, allowing you to freely switch to the version-specific chip that the lexer will generate. =]

+4
Jul 29 '16 at 5:14
source share



All Articles