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 1733
1733
\end {slide }
1734
1734
1735
1735
\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
1737
1737
(\emph {forward declaration }) of functions, variables and macro definitions.
1738
1738
From the preprocessor's point of view, this is a simple file in the C language.
1739
1739
\item \emsl {These header files are not specific to UNIX. They are part of
1763
1763
using the \texttt {NDEBUG } define. Example: \example {assert/assert.c}.
1764
1764
1765
1765
\begin {verbatim }
1766
- cat assert.c
1766
+ cat assert.c
1767
1767
#include <assert.h>
1768
1768
1769
1769
int
1772
1772
assert(1 == 0);
1773
1773
return (13);
1774
1774
}
1775
- $ cc assert.c
1776
- $ ./a.out
1775
+ $ cc assert.c
1776
+ $ ./a.out
1777
1777
Assertion failed: 1 == 0, file assert.c, line 6
1778
1778
Abort (core dumped)
1779
- $ cc -DNDEBUG assert.c
1780
- $ ./a.out
1779
+ $ cc -DNDEBUG assert.c
1780
+ $ ./a.out
1781
1781
$ echo $?
1782
1782
13
1783
1783
\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.
1784
1787
\end {itemize }
1785
1788
1786
1789
You can’t perform that action at this time.
0 commit comments