Liste des Groupes | Revenir à cl c |
(I think I know the answer but I would like to learn more.)I don't use them in generated code either. (Only in a brief section at the top to define my prefered type designations.)
I am using C89 as "compiler backend intermediate language".
I want a very simple output that could facilitate the construction of a simple C89 compiler focused on code generation.
I am removing these features from the generated code.
- typedef
- enum
- preprocessor
- const
At this output, I am generating the prototypes for the functions I call.I don't use #include either, not even for standard headers, although gcc doesn't like it when I define my own std library functions. There are ways to shut it up though.
For instance,
int strcmp( const char* lhs, const char* rhs );
is generated as
int strcmp( char* lhs, char* rhs );
I am also generating the structs as required (on demand). For the structs I am renaming it because I am generating all structs at global scope.I don't know why the linker would care about anything. All it sees are symbol imports and exports.
Question:
Does the compiler/linkers? Cares If I am lying about const? Or If rename the structs?
I think it does not care, and it seems to work (it compiles and run).
Les messages affichés proviennent d'usenet.