This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Error C193 : '==' : illegal type conversion ??

Hi,

I have tried to remove this error but no way.

Error C193 : '==' : illegal type conversion from/to 'void'

I have tried to include severals headers file but nothing, how can I resolve this error?

This error is in the function mem_task():

void mem_task (void)
{
Byte state;

  switch (mem_state)
  {
    case MEM_INIT:
    {
   #if MEM_CHIP_TYPE != CHIP_NONE /*if chip defined*/
     if (Hard_chip_init() == OK)/* if init chip OK*/
     {
      mem_state = MEM_CHIP_INIT; /*install chip*/
     }
   #if MEM_CARD_TYPE != CARD_NONE /*if card defined*/
    if (Hard_card_init() == KO) //ERROR: C193
     {
      if (mem_state == MEM_INIT)/*if init fail*/
       {
          print_screen(FATAL_CHIP_SCREEN);/*error*/
          while(1);


and my build target output is :


Build target 'Target 1'
compiling main.c...
compiling I2C.c...
compiling ADC.c...
compiling AUD.c...
compiling DAC.c...
compiling MICRO2.c...
compiling DONG2.c...
assembling STARTUP.A51...
compiling variable.c...
compiling ide_drv.c...
compiling C_Flash.c...
compiling CF_oper.c...
modules\file\fat.h(16): warning C322: unknown identifier
modules\file\fat.h(16): warning C322: unknown identifier
modules\file\fat.h(16): warning C322: unknown identifier
modules\file\fat.h(16): warning C322: unknown identifier
modules\file\fat.h(16): warning C322: unknown identifier
modules\file\fat.h(16): warning C322: unknown identifier
modules\file\fat.h(16): warning C322: unknown identifier
modules\file\fat.h(16): warning C322: unknown identifier
modules\file\fat.h(19): warning C322: unknown identifier
modules\file\fat.h(19): warning C322: unknown identifier
modules\file\fat.h(19): warning C322: unknown identifier
modules\file\fat.h(19): warning C322: unknown identifier
modules\file\fat.h(19): warning C322: unknown identifier
modules\file\fat.h(19): warning C322: unknown identifier
modules\file\fat.h(19): warning C322: unknown identifier
modules\file\fat.h(19): warning C322: unknown identifier
CF_oper.c(189): warning C307: macro 'fat_install': parameter count mismatch
CF_oper.c(240): warning C307: macro 'fat1216_save_cluster_info': parameter count mismatch
CF_oper.c(241): warning C307: macro 'fat1216_feob': parameter count mismatch
compiling cf_drv_.c...
compiling ata.c...
compiling file.c...
modules\file\file.c(184): warning C316: unterminated conditionals
compiling fs_variable.c...
compiling fat.c...
modules\file\fat.c(3790): warning C316: unterminated conditionals
compiling song_task.c...
compiling mem_task.c...
MODULES\MEM\MEM_TASK.C(123): error C193: '==': illegal type conversion from/to 'void'
Target not created

Thank you

Parents
  • *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
    

    This warning refers to code that is not used in the program. Such code wastes space, of course. However, it also interferes with the overlay process. Each uncalled segment must be treated as the root of its own call tree for purposes of overlay analysis. So, the compiler winds up needing a lot more data/xdata memory for locals and parameters than it would if this code were gone.

    See the REMOVEUNUSED linker option. Or, find a way to remove the extra code from the source and not link it in the first place.

    *** WARNING L15: MULTIPLE CALL TO SEGMENT
        SEGMENT: ?PR?PRINTF?PRINTF
    

    printf() is not reentrant. It is unlikely that you will get the output you want if an interrupt handler and main task (or two interrupts, or two RTOS tasks) call printf at the same time.

    *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
    


    The linker can't find a function or variable that is used by another function. Typically this is because you didn't link all the object files/libraries needed for a complete program. Or, if you have "address space overflow" errors, perhaps because of the "uncalled segment" warnings, then some of the program would be missing because it doesn't fit in available memory. Once the linker runs out of room, all later references are seen as unresolved externals.

Reply
  • *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
    

    This warning refers to code that is not used in the program. Such code wastes space, of course. However, it also interferes with the overlay process. Each uncalled segment must be treated as the root of its own call tree for purposes of overlay analysis. So, the compiler winds up needing a lot more data/xdata memory for locals and parameters than it would if this code were gone.

    See the REMOVEUNUSED linker option. Or, find a way to remove the extra code from the source and not link it in the first place.

    *** WARNING L15: MULTIPLE CALL TO SEGMENT
        SEGMENT: ?PR?PRINTF?PRINTF
    

    printf() is not reentrant. It is unlikely that you will get the output you want if an interrupt handler and main task (or two interrupts, or two RTOS tasks) call printf at the same time.

    *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
    


    The linker can't find a function or variable that is used by another function. Typically this is because you didn't link all the object files/libraries needed for a complete program. Or, if you have "address space overflow" errors, perhaps because of the "uncalled segment" warnings, then some of the program would be missing because it doesn't fit in available memory. Once the linker runs out of room, all later references are seen as unresolved externals.

Children
  • Yes
    for warning L16 maybe do that:

    #if 0

    functionX ()

    #endif

    So I suppose that's good for memory space
    but if a function calls functionX that do warning L1 or L2 I think?

  • Hi,

    I have problem because I don't know how remove
    these 39 warnings
    I had first 108 warnings.

    Build target 'Target 1'
    compiling main.c...
    linking...
    *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
        SEGMENT: ?PR?CF_OPERATIONS3?CF_OPER
    *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
        SEGMENT: ?PR?CF_OPERATIONS4?CF_OPER
    *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
        SEGMENT: ?PR?_FAT1216_FRENAME?FAT
    *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
        SEGMENT: ?PR?FAT1216_FILE_GET_POS?FAT
    *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
        SEGMENT: ?CO?FAT
    *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
        SEGMENT: ?PR?MEM_STATUS?MEM_TASK
    *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
        SEGMENT: ?PR?MEM_CHECK_CARD?MEM_TASK
    *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
        SEGMENT: ?PR?MEM_CARD_SELECT?MEM_TASK
    *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
        SEGMENT: ?PR?MEM_CHIP_SELECT?MEM_TASK
    *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
        SEGMENT: ?PR?MEM_SELECT_NEXT?MEM_TASK
    *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
        SEGMENT: ?PR?MEM_SELECT_FORMAT?MEM_TASK
    *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
        SEGMENT: ?PR?MEM_LOAD_CARD?MEM_TASK
    *** WARNING L15: MULTIPLE CALL TO SEGMENT
        SEGMENT: ?PR?PRINTF?PRINTF
        CALLER1: ?PR?I2C_ISR?I2C
        CALLER2: ?C_C51STARTUP
    *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
        SYMBOL:  _CF_WRITE_OPEN
        MODULE:  fat.obj (FAT)
    *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
        SYMBOL:  ?_CF_WRITE_OPEN?BYTE
        MODULE:  fat.obj (FAT)
    *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
        SYMBOL:  _CF_WRITE_BYTE
        MODULE:  fat.obj (FAT)
    *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
        SYMBOL:  CF_WRITE_CLOSE
        MODULE:  fat.obj (FAT)
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  ?_CF_WRITE_OPEN?BYTE
        MODULE:  fat.obj (FAT)
        ADDRESS: D95FH
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  _CF_WRITE_OPEN
        MODULE:  fat.obj (FAT)
        ADDRESS: D965H
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  _CF_WRITE_BYTE
        MODULE:  fat.obj (FAT)
        ADDRESS: D98CH
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  _CF_WRITE_BYTE
        MODULE:  fat.obj (FAT)
        ADDRESS: D9A7H
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  _CF_WRITE_BYTE
        MODULE:  fat.obj (FAT)
        ADDRESS: D9C2H
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  _CF_WRITE_BYTE
        MODULE:  fat.obj (FAT)
        ADDRESS: D9D7H
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  CF_WRITE_CLOSE
        MODULE:  fat.obj (FAT)
        ADDRESS: D9F1H
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  ?_CF_WRITE_OPEN?BYTE
        MODULE:  fat.obj (FAT)
        ADDRESS: 9EBEH
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  _CF_WRITE_OPEN
        MODULE:  fat.obj (FAT)
        ADDRESS: 9ECCH
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  _CF_WRITE_BYTE
        MODULE:  fat.obj (FAT)
        ADDRESS: 9EF0H
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  ?_CF_WRITE_OPEN?BYTE
        MODULE:  fat.obj (FAT)
        ADDRESS: 9F91H
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  _CF_WRITE_OPEN
        MODULE:  fat.obj (FAT)
        ADDRESS: 9F97H
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  _CF_WRITE_BYTE
        MODULE:  fat.obj (FAT)
        ADDRESS: 9FC4H
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  ?_CF_WRITE_OPEN?BYTE
        MODULE:  fat.obj (FAT)
        ADDRESS: 9FE7H
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  _CF_WRITE_OPEN
        MODULE:  fat.obj (FAT)
        ADDRESS: 9FEDH
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  CF_WRITE_CLOSE
        MODULE:  fat.obj (FAT)
        ADDRESS: DFEBH
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  CF_WRITE_CLOSE
        MODULE:  fat.obj (FAT)
        ADDRESS: D443H
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  ?_CF_WRITE_OPEN?BYTE
        MODULE:  fat.obj (FAT)
        ADDRESS: D47AH
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  _CF_WRITE_OPEN
        MODULE:  fat.obj (FAT)
        ADDRESS: D480H
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  _CF_WRITE_BYTE
        MODULE:  fat.obj (FAT)
        ADDRESS: D4B9H
    *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
        SYMBOL:  _PRINT_MEM
        MODULE:  mem_task.obj (MEM_TASK)
    *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
        SYMBOL:  _PRINT_MEM
        MODULE:  mem_task.obj (MEM_TASK)
        ADDRESS: E085H
    Program Size: data=87.4 xdata=1870 code=59344
    creating hex file from "MPA3_V02"...
    "MPA3_V02" - 0 Error(s), 39 Warning(s).
    

    The problem concerns the files fat.c and mem_task.c ,
    how can I do for eliminate warnings?

    Thank you