-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Allow additional extensions for c++ source files #48
Comments
Hi @jonesinator. Thanks for your really comprehensive report on that issue! Right now there are only a handful of file extensions that Coati detects by default.
For the case you mentioned above I would recommend adding the |
Thanks! I'm glad there's already a workaround in the product. I had to use header_extensions instead of source_extensions, but otherwise this worked for me. When I used source_extensions it complained about redefinition of In case anyone has the same issue, the exact XML I used is below. It seems like specifying a single header_extensions entry overrides the default entries instead of adding to them, so I had to have a tag for both hpp and ipp even though hpp is normally automatically detected by Coati.
|
@jonesinator: On a second thought adding the extension as a ´header_extension´ makes sense, as your compiler also wouldn't create a translation unit for that file. |
A reasonably common practice for template classes is to place the class declaration in an h/hpp file, and then place the class definition in an ipp file and include the ipp file from the hpp file. For example, the boost libraries do this.
It seems as though the ipp files are not being considered c++ code by Coati. Consider the following files:
foo.hpp
foo.ipp
main.cpp
Makefile
ipp-test.coatiproject
When Coati attempts analysis I get the following output
12:36:43 | Storage.cpp:1188 addSourceLocation() | ERROR: Can't create source location, file node does not exist for: /home/aaronj/sandbox/ipp-test/foo.ipp
Coati reports no errors were encountered:

However, the source of the go function can't be retrieved:

If I put the code in foo.ipp directly into foo.hpp and rerun the analysis things work as expected and the go function is no longer undefined.
It would be good to allow users to specify custom extensions that should be parsed by Coati as C/C++ code.
The text was updated successfully, but these errors were encountered: