[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] [PATCH] preprocess all files from a command line with
From: |
Thomas Preud'homme |
Subject: |
Re: [Tinycc-devel] [PATCH] preprocess all files from a command line with a -E switch |
Date: |
Sat, 03 Jan 2015 22:46:12 +0000 |
User-agent: |
KMail/4.14.1 (Linux/2.6.38-ac2-ac100; KDE/4.14.2; armv7l; ; ) |
Le samedi 27 décembre 2014, 16:19:04 Sergey Korshunoff a écrit :
> Don't drop a preprocessor defines when tcc going to preprocess a next
> file in the same pass like
> tcc -E one.c two.c three.c -o combined.i
>
> Currently tcc don't handle such case. The new behavior is better then
> the current one. After a patch it is possible to compile combined.i
> in case:
>
> * include files are properly protected by
> #ifndef MY_INCLUDE_H
> #define MY_INCLUDE_H
> extern void func();
> #endif
> * there is no incompatible declarations for the same name in *.c
>
> An archive for a test purpose is included
Sorry but I'm not sure I like this functionality. When gcc compiles several .c
files they are compiled independently: macro are not kept accross files. Doing
this only for -E flag would make it not very consistent. Also I don't like the
shape of the patch: initialization of the preprocessing should be split out of
the function but anyway that is not worth discussing further given previous
point.
Best regards,
Thomas
- Re: [Tinycc-devel] [PATCH] preprocess all files from a command line with a -E switch,
Thomas Preud'homme <=