Creating a C Library: Difference between revisions
[unchecked revision] | [unchecked revision] |
Content deleted Content added
The wiki doesn't have syntax highlighting for x86 as(1), and add .size for _start |
m →Repeated Declarations: grammar fix |
||
Line 133:
== Repeated Declarations ==
The occasional poor design of the C standard library has lead to the requirement that some declarations must be repeated in multiple header files. Worse, if a header needs the FILE declaration from stdio.h, it is not allowed to include stdio.h because of
Another solution is to put the FILE in its own header <decl_FILE.H> with its own include guard. This is much cleaner and simpler to understand, but causes extra work for the preprocessor which can get comparably expensive if this is done for a lot of declarations. An alternative solution is to pre-preprocess the header files by writing a simple compiler that automatically finds these <decl_FILE.h> inclusions and inserts the contents into the header file. This
== C++ Compatibility ==
|