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,240 次查看
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,000 次查看
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,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 项奖励
1,000 次查看
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 项奖励