tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] #line directive with file name


From: Christian Jullien
Subject: Re: [Tinycc-devel] #line directive with file name
Date: Fri, 13 Apr 2018 07:32:22 +0200

Yakov, with mod on Windows I tried this:

 

c:\tmp>type foo.c

int main() {

    #line 30 "demo.c"

    printf("hello\n");

    #line 40 "demo.c"

    return 0;

}

 

c:\tmp>tcc -E foo.c

# 1 "foo.c"

int main() {

# 30 "demo.c"

    printf("hello\n");

# 40 "demo.c"

    return 0;

}

 

On it’s side gcc gives:

c:\tmp>gcc -E foo.c

# 1 "foo.c"

# 1 "<built-in>"

# 1 "<command-line>"

# 1 "foo.c"

int main() {

# 30 "demo.c"

    printf("hello\n");

# 40 "demo.c"

    return 0;

}

 

And cl gives:

 

#line 1 "foo.c"

int main() {

    #line 30 "demo.c"

    printf("hello\n");

    #line 40 "demo.c"

    return 0;

}

 

Which looks correct. Is there something I’m missing with the issue you’re facing?

 

From: Tinycc-devel [mailto:address@hidden On Behalf Of Yakov
Sent: vendredi 13 avril 2018 02:36
To: address@hidden
Subject: [Tinycc-devel] #line directive with file name

 

I am curious why my copy of TinyC ignores the second argument to the #line directive?

In a file named prog.c I am trying to rename lines as if they come from demo.c

int main() {

    #line 30 "demo.c"

    printf("hello\n");

    #line 40 "demo.c"

    return 0;

}

It works as expected for GCC, but TinyC will always print prog.c ignoring the argument.

Latest tcc from git. Ubuntu. x86_64. Musl. (Because GNU LibC does not work with addr2line).

 

Thanks,

Yakov


reply via email to

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