Skip to content
This repository was archived by the owner on Dec 14, 2021. It is now read-only.

ARM C compiler syntax issues #533

Open
kevinvalk opened this issue Jan 9, 2018 · 3 comments
Open

ARM C compiler syntax issues #533

kevinvalk opened this issue Jan 9, 2018 · 3 comments
Labels

Comments

@kevinvalk
Copy link

I am using Sourcetrail for a project that is written in C for Cortex-M4 (arm) and is compiled using the ARM Compiler version 6.01 (bundles with DS-5 Development Studio).

The following issues are present when scanning the source code with Sourcetrail:

@mlangkabel
Copy link
Contributor

Hi @kevinvalk, thanks for opening this issue!

  • I think we also encountered your issue with anonymous typedef structs/enums/unions while working on the next release. The issue was present whenever more than one translation unit was referencing that symbol. This issue will be fixed with the 2018.1 relase that is coming soon :)
  • We'll investigate the two other issues you mentioned and get back to you as soon as we have more information.

@mlangkabel
Copy link
Contributor

After investigating the two other issues you mentioned it looks like the Clang compiler (that Sourcetrail is using for code analysis) supports neither ARM inline assembly statements of the format __asm{nop} nor the __irq ARM keyword.

  • As a workaround for inline assembly statements I think you could use the __asm("statements"); format which matches the GCC format or just ignore the errors thrown by the source code analysis. As long as the errors are non-fatal they only have a very local impact on the index. For inline assembly statements only the internal usage of local variables will be lost.
  • As a workaround for the unsupported __irq keyword you could add an empty define to your Sourcetrail project (using the following flag: -D __irq=) which would allow the indexer to visit the content of the IRQ-handler function.

Even though this is far from good news I hope the workaround help.

As a positive side effect of having this issue on our issue tracker we just implemented handling Microsoft inline assembly statements!

@kevinvalk
Copy link
Author

Thanks @mlangkabel for your detailed explanation. This is almost exactly what I did to fix the errors (I wanted to fix all errors to see if that perhaps resolved the anonymous typedef issues).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants