Generated code by PE don't compile if C-ANSI compilation flag is set

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Generated code by PE don't compile if C-ANSI compilation flag is set

ソリューションへジャンプ
1,241件の閲覧回数
stephane_sst
Contributor I

I post this message because I am unable to compile my HCS08 project with ANSI compilation flag.

I use processor expert to generate code of some components (ADC, UART, PIO...)

 

Two files appear not ANSI compliant :

  - start08.C : asm keyword is unknown, should be __asm.

  - IO_Map.h : error:C1021 Bit field type is not 'int'

typedef union {
  byte Byte;
  struct {
    byte PTAD0       :1;                                       /* Port A Data Register Bit 0 */
    byte PTAD1       :1;                                       /* Port A Data Register Bit 1 */
    byte PTAD2       :1;                                       /* Port A Data Register Bit 2 */
    byte PTAD3       :1;                                       /* Port A Data Register Bit 3 */
    byte             :1; 
    byte             :1; 
    byte             :1; 
    byte             :1; 
  } Bits;
  struct {
    byte grpPTAD :4;
    byte         :1;
    byte         :1;
    byte         :1;
    byte         :1;
  } MergedBits;
} PTADSTR;

 

I read in a documentation about processor expert : "Beans can support several languages (ASM, ANSI C, Modula and others) and the code is generated for the selected language."

 

I hope that C-ANSI compilation is possible, and that someone can help me.

 

Regards

 

0 件の賞賛
1 解決策
1,001件の閲覧回数
ProcessorExpert
Senior Contributor III

Hello,

 

Unfortunatelly ProcessorExpert supports only the default compiler settings and all beans are tested with this settings.

 

IO_Map.h : error:C1021 Bit field type is not 'int'

This file is generated by Processor Expert. In case you want to modify it manually you have to swicth off its generation by using "Disable Code generation" menu command from its pop-up menu (see details in enclosed screen-shot).

 

I have checked also options to disable such error in compiler "Messages" option but this message is not "moveable".

 

best regards
Vojtech Filip
Processor Expert Support Team

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
1,002件の閲覧回数
ProcessorExpert
Senior Contributor III

Hello,

 

Unfortunatelly ProcessorExpert supports only the default compiler settings and all beans are tested with this settings.

 

IO_Map.h : error:C1021 Bit field type is not 'int'

This file is generated by Processor Expert. In case you want to modify it manually you have to swicth off its generation by using "Disable Code generation" menu command from its pop-up menu (see details in enclosed screen-shot).

 

I have checked also options to disable such error in compiler "Messages" option but this message is not "moveable".

 

best regards
Vojtech Filip
Processor Expert Support Team

0 件の賞賛
1,001件の閲覧回数
stephane_sst
Contributor I

Thanks for your answer, and sorry for my very late answer : I was not notified that someone replied to me.

 

Actually, I don't intend to modify what Processor Expert generate. I was surpised that the generated source code is not compliant with ANSI C. The problem is that if IO_Map.h is not ANSI  C , all the software cannot be ANSI C, because the IO_Map.h file is indeirectly included almost every were.

 

Well, I can live with it.

0 件の賞賛