[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Preprocess enter an endless loop when use macro with
From: |
Marc Andre Tanner |
Subject: |
Re: [Tinycc-devel] Preprocess enter an endless loop when use macro with line feed |
Date: |
Sat, 24 Nov 2007 15:34:19 +0100 |
User-agent: |
Mutt/1.5.17 (2007-11-01) |
Hi,
On Fri, Nov 23, 2007 at 09:15:12AM +0800, Feng Nauh wrote:
> for example:
>
> // lf_macro.c
> #define M(a,b) (a+b)
> int main() {
> return M(1,
> 2);
> }
>
> "tcc -E lf_macro.c", then tcc enter an endless loop; but compile is ok.
Yep, the problem seems to be that within tcc_preprocess parse_flags is
ORed with PARSE_FLAG_LINEFEED this causes an endless loop in
macro_subst_tok (line 3268) because next_nomacro will always set tok to
TOK_LINEFEED.
There is a debian bug report[1] with a similar porblem but the mentioned
patch looks a bit bogus to me. Attached is my workaround.
Marc
[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=435027
--
Marc Andre Tanner >< http://www.brain-dump.org/ >< GPG key: CF7D56C0
preprocessor-newline.patch
Description: Text Data