| Anonymous | Login | Signup for a new account | 2010-09-06 09:50 EDT |
| Main | My View | View Issues | Change Log | Roadmap | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0009468 | [GCC-XML] | major | always | 2009-09-01 03:54 | 2009-09-01 09:49 | ||||
| Reporter | edice | View Status | public | ||||||
| Assigned To | Brad King | ||||||||
| Priority | normal | Resolution | fixed | ||||||
| Status | closed | ||||||||
| Summary | 0009468: Quote include behaviour not correct | ||||||||
| Description |
Attached is a tarball with the following test project structure: ./dir_a ./dir_a/a.hpp ./dir_a/common_name.hpp ./dir_b ./dir_b/b.hpp ./dir_b/common_name.hpp ./main.cpp ./demonstrate.sh ./preprocessed_gcc.log ./preprocessed_gccxml.log main.cpp #includes "dir_a/a.hpp" and "dir_b/b.hpp" which works fine. Both a.hpp and b.hpp both have: #include "common_name.hpp" Which is also fine, both will include their respective local common_name.hpp file. However, gccxml will always include dir_a/common_name.hpp, which is not consistent with gcc. There is a little script "demonstrate.sh" which runs the compilers and demonstrates the problems. It also generates some log files with the preprocessed code (log files included in tarball). This is the output of the script: $ ./demonstrate.sh Using gcc preprocessor to generate correct code. Results in preprocessed_gcc.log Using gccxml and preprocessor - will show INCORRECT code. Results in preprocessed_gccxml.log. NOTE THAT dir_a/common_name.hpp is included when dir_b should've been included. main.cpp:8:2: error: #error "Did not include b/common_name.hpp" Using gcc plain - will pass Using gccxml - will fail main.cpp:8:2: error: #error "Did not include b/common_name.hpp" And this is the key part of preprocessed_gccxml.log, with a note on where the problem happens: # 1 "main.cpp" # 1 "dir_a/a.hpp" 1 # 1 "dir_a/common_name.hpp" 1 #define HELLO_A # 1 "dir_a/a.hpp" 2 # 2 "main.cpp" 2 # 1 "dir_b/b.hpp" 1 # 1 "dir_a/common_name.hpp" 1 <--- should have included dir_b/common_name.hpp #define HELLO_A <--- therefore, incorrect #define # 1 "dir_b/b.hpp" 2 # 3 "main.cpp" 2 # 11 "main.cpp" int main() { return 0; } This is what it looked like from gcc's preprocessor: # 1 "main.cpp" # 1 "dir_a/a.hpp" 1 # 1 "dir_a/common_name.hpp" 1 #define HELLO_A # 1 "dir_a/a.hpp" 2 # 2 "main.cpp" 2 # 1 "dir_b/b.hpp" 1 # 1 "dir_b/common_name.hpp" 1 <--- the correct file :) #define HELLO_B <--- the correct #define # 1 "dir_b/b.hpp" 2 # 3 "main.cpp" 2 # 11 "main.cpp" int main() { return 0; } |
||||||||
| Additional Information | |||||||||
| Tags | No tags attached. | ||||||||
| Attached Files |
|
||||||||
|
|
|||||||||
Relationships [ Relation Graph ]
[ Dependency Graph ]
|
||||||
|
||||||
| Mantis 1.1.4[^] Copyright © 2000 - 2008 Mantis Group |