Forums - Hexagon compiler having trouble with `typedef struct mystruct *mystruct`

3 posts / 0 new
Last post
Hexagon compiler having trouble with `typedef struct mystruct *mystruct`
errolflynn
Join Date: 3 Aug 16
Posts: 29
Posted: Thu, 2017-02-16 18:41

I have this line in a header file:

typedef struct mystruct *mystruct;

And the corresponding struct definition in a .cpp file. Pretty standard practices. 

I am getting this compilation error:

fatal error: typedef redefinition with different types ('struct mystruct *' vs mystruct')

This is using the Hexagon Tools Compiler (7.2.12) from Hexagon 3.0 SDK. It is officially QuIC LLVM Hexagon Clang version 7.2.12. Building for Snapdragon Flight. This should work as far as I know. It works with Ubuntu clang version 3.5.0-4ubuntu2~trusty2 (based on LLVM 3.5.0) for x86_64-pc-linux-gnu.

  • Up0
  • Down0
errolflynn
Join Date: 3 Aug 16
Posts: 29
Posted: Fri, 2017-02-17 11:39
  • Up0
  • Down0
errolflynn
Join Date: 3 Aug 16
Posts: 29
Posted: Fri, 2017-02-17 12:31

I have tried this outside of PX4, and apparently the compiler works fine. It must be PX4 compilation that does not create libraries then link or something.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.