Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is meanging of gcc option "-fmessage-length"?

I am using CDT(eclipse for c language). I found that default gcc compiler options are -O0 -g3 -Wall -c -fmessage-length=0. what's the meaning of -fmessage-length? that should be -fflag, but what about message-length? I didnt find it in GCC Command-Line Options. Thanks for your consideration.

like image 818
Nick Dong Avatar asked Aug 18 '12 03:08

Nick Dong


People also ask

What does Option mean in GCC?

When you invoke GCC, it normally does preprocessing, compilation, assembly and linking. The "overall options" allow you to stop this process at an intermediate stage. For example, the -c option says not to run the linker.

What does the GCC command do?

GCC stands for GNU Compiler Collections which is used to compile mainly C and C++ language. It can also be used to compile Objective C and Objective C++.

What is f flag in GCC?

'f' stands for 'flag'. -fpic # flag to set position independent code -fno-builtin # don't recognize build in functions ... The technical definition is that 'f' defines "Control the interface conventions used in code generation".


2 Answers

I didnt find it in GCC Command-Line Options.

That's because you're looking at "a modified version of the Command-Line Options section of the GCC Manual."

This is the official list of all possible GCC command-line options, which leads to this section: "3.7 Options to Control Diagnostic Messages Formatting". This is what the section has to say:

3.7 Options to Control Diagnostic Messages Formatting

Traditionally, diagnostic messages have been formatted irrespective of the output device's aspect (e.g. its width, ...). You can use the options described below to control the formatting algorithm for diagnostic messages, e.g. how many characters per line, how often source location information should be reported. Note that some language front ends may not honor these options.

-fmessage-length=n

Try to format error messages so that they fit on lines of about n characters. The default is 72 characters for g++ and 0 for the rest of the front ends supported by GCC. If n is zero, then no line-wrapping is done; each error message appears on a single line.

...

like image 187
In silico Avatar answered Oct 05 '22 10:10

In silico


man page for gcc says

-fmessage-length=n
       Try to format error messages so that they fit on lines of about n characters.  The default is 72 characters for g++ and 0 for the rest of the front ends supported by GCC.  If n is
       zero, then no line-wrapping will be done; each error message will appear on a single line.

Just a formatting option for error messages.

like image 33
Chethan Ravindranath Avatar answered Oct 05 '22 11:10

Chethan Ravindranath