I read about the -fsyntax-only
option in gcc
command's man page. I understand it shows errors of missing header files and it ignore the user coding errors. I need to know whether my understanding is correct or not?, also I need to know more about this option. So can any one explain about this option?
clause. Compilers options (− x on Linux, and /Qx on Microsoft Windows) control which instructions the compiler uses within a function, while the processor(…) clause controls creation of non-standard functions using wider registers (YMM or ZMM) for passing SIMD data for parameters and results.
Option Syntaxcc accepts a list of C source files and object files contained in the list of files specified by filenames. The resulting executable code is placed in a. out , unless the -o option is used. In this case, the code is placed in the file named by the -o option.
fPIC option in GCC enables the address of shared libraries to be relative so that the executable is independent of the position of libraries. This enables one to share built library which has dependencies on other shared libraries. fPIC stands for "force Position Independent Code".
-fsyntax-only
prevents the compiler from generating any object code.
Other than that it does the same thing as without this flag.
from Wikipedia
A compiler is likely to perform many or all of the following operations: lexical analysis, preprocessing, parsing, semantic analysis (syntax-directed translation), code generation, and code optimization.
It may still do the last 2 of those, because some errors are only found during optimization, but the results will be discarded, or it skips these steps entirely.
It is mainly used to get error and warning messages about the code in question. (It won’t ignore user coding errors)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With