|
880 | 880 |
|
881 | 881 | \begin{itemize} |
882 | 882 | \item \texttt{-l}/\texttt{-L} are actually options for the linker, i.e. the |
883 | | -compiler will pass them on onto the linker. |
| 883 | +compiler will pass them on onto the linker. To pass options to the linker |
| 884 | +in more robust way, use the \texttt{-Xlinker} option. |
884 | 885 | \item Both the compiler and linker have an extensive list of additional options |
885 | 886 | that influence the generated code and what warnings are printed during the |
886 | 887 | compilation/linking based on the chosen language and the standard. See manual |
887 | | -pages for \texttt{cc}, \texttt{gcc}, and/or \texttt{ld}. |
| 888 | +pages for \texttt{cc}, \texttt{gcc} or \texttt{clang}, and/or \texttt{ld}. |
| 889 | +\item There are many additional warnings and sets of warnings which can be |
| 890 | +enabled for compilation such as \texttt{-Wall}, \texttt{-Wextra}, |
| 891 | +\texttt{-pedantic} and many others. |
| 892 | +\item Also, it might be worthwhile to convert all warnings into errors via |
| 893 | +\texttt{-Werror} to make sure the problems do not go unaddressed. |
| 894 | +\item These days modern compilers include extra checks which used to be part |
| 895 | +of program called \texttt{lint} which checked for unused variables, mismatches |
| 896 | +in format strings etc. They also provide almost graphical level of warnings |
| 897 | +showing not only what is problematic but also how it can be fixed. |
| 898 | +\item Also, modern compilers feature the capability of formerly standalone |
| 899 | +\emph{static analyzers} e.g. being able to detect problems across function calls. |
| 900 | +\item Further, modern compilers have error checking plugins which change the |
| 901 | +emitted code to employ various checks, e.g. \emph{address sanitizer} (detecting |
| 902 | +out of bounds access, heap allocation problems, etc.) or \emph{thread sanitizer}. |
888 | 903 | \end{itemize} |
889 | 904 |
|
890 | 905 | %%%%% |
|
0 commit comments