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

 
 

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

Submitter:  None
Submitted:  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
* Mandatory Fields

Add a New Comment Rich Markup
   

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.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

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

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

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.13-f8d8.
Corresponding source code