bugTiny C Compiler - Bugs: bug #50847, #line directive corrupts #include...


bug #50847: #line directive corrupts #include search path

Submitted by:  None
Submitted on:  Fri 21 Apr 2017 01:37:11 PM UTC  
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 21 Apr 2017 01:37:11 PM UTC, original submission:  

Esteemed tinycc maintainers -

See attached test case.  The #line directive seems to corrupt tinycc's ability to correctly find a .h file in the same directory as the C source file that #includes it.

Expected result of unpacking tinycc_bug.tar.gz; cd tinycc_bug; ./demo

+ gcc -c dir/foo.c
+ gcc -c dir/bad.c
+ tcc -c dir/foo.c
+ tcc -c dir/bad.c

Actual result:

+ gcc -c dir/foo.c
+ gcc -c dir/bad.c
+ tcc -c dir/foo.c
+ tcc -c dir/bad.c
mythical.c:10: error: include file 'simple.h' not found

Note that the only difference between foo.c and bad.c is the presence of the #line directive.

In the production code that "found" this case, the effect was more insidious: by not finding the correct include file, it found a different include file of the same name (through a long list of -I command line options).  The include step therefore succeeded (from tinycc's perspective), but the mistake caused a syntax fault much farther on in the compilation phase.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #40466:  tinycc_bug.tar.gz added by None (485B - application/gzip)


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.




Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2017-04-21 None Attached File- => Added tinycc_bug.tar.gz, #40466

Back to the top

Powered by Savane 3.5