tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] cached header files cause multi-includes to fail


From: Simon Lehmayr
Subject: Re: [Tinycc-devel] cached header files cause multi-includes to fail
Date: Thu, 9 Jul 2009 18:02:34 +0200

Hi,

the project works this way:

ee.c:
--------
...
#include "ee.h"
...
--------
ee.h:
--------
#ifndef ...
#define ...

#include "ee_cfg.h"
...
enum blabla
{
#define CFG1
#include "ee_cfg.h"
EE_MAX_E
};
...
--------
And thus the following includes are just ignored

Greetings,
Simon

----- Original Message ----- From: "grischka" <address@hidden>
To: <address@hidden>
Sent: Thursday, July 09, 2009 11:18 AM
Subject: Re: [Tinycc-devel] cached header files cause multi-includes to fail


Simon Lehmayr wrote:
Hi,
I found an error in tcc while compiling a project which uses one header that includes another header several times using defines to generate different code. Caching of headers hides the following includes thus no code is generated in these cases.
I disabled caching by returning NULL in the cache check.
Caching should include the environmental state (defines, etc) to avoid this problem.

There is some state included, that is headers are skipped only if there is
an #ifndef macro around, such as:

#ifndef FOO_H
#define FOO_H
...
#endif

And the ifdef must be the first thing and the endif must be the last.

I'm not sure how this can not work but maybe you can tell more details.
Also you could compile TCC with INC_DEBUG (at tcc.h:79).

 Greetings,
Simon





_______________________________________________
Tinycc-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/tinycc-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]