File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 17331733\end {slide }
17341734
17351735\begin {itemize }
1736- \item The \emph {header file } is a file that contains declarations
1736+ \item The \emph {header file } is a file that contains declarations
17371737(\emph {forward declaration }) of functions, variables and macro definitions.
17381738From the preprocessor's point of view, this is a simple file in the C language.
17391739\item \emsl {These header files are not specific to UNIX. They are part of
17631763using the \texttt {NDEBUG } define. Example: \example {assert/assert.c}.
17641764
17651765\begin {verbatim }
1766- cat assert.c
1766+ cat assert.c
17671767#include <assert.h>
17681768
17691769int
17721772 assert(1 == 0);
17731773 return (13);
17741774}
1775- $ cc assert.c
1776- $ ./a.out
1775+ $ cc assert.c
1776+ $ ./a.out
17771777Assertion failed: 1 == 0, file assert.c, line 6
17781778Abort (core dumped)
1779- $ cc -DNDEBUG assert.c
1780- $ ./a.out
1779+ $ cc -DNDEBUG assert.c
1780+ $ ./a.out
17811781$ echo $?
1782178213
17831783\end {verbatim }
1784+ \item Next to runtime asserts it is also possible to use static asserts
1785+ which are evaluated during compilation. These are handy e.g. for verification of
1786+ expected structure size/offsets.
17841787\end {itemize }
17851788
17861789
You can’t perform that action at this time.
0 commit comments