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

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Jump to solution
564 Views
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 Kudos
1 Solution
324 Views
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

View solution in original post

0 Kudos
2 Replies
325 Views
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 Kudos
324 Views
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 Kudos