CDD_IPC: GHS compiler throws errors for flexible array variable

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: High
    • MCAL
    • MCAL-23487
    • MCUSW_J7_09.01.00
    • MCUSW_J7_09.02.00
    • Hide
      j7200-evm
      j721e-evm
      j721s2-evm
      j784s4-evm
      Show
      j7200-evm j721e-evm j721s2-evm j784s4-evm

      The MCAL IPC library goes into the ASIL-D MCU R5F core. Customer is using GHS Safety Certified Compiler which generates a number of errors and warnings, which do not show up with TI ARM Clang Compiler. 

      mcal/CddIpc/ipc_baremetal_hw/src/ipc_api.c", line 143 (col. 26): error #1029: type containing an unknown-size array is not allowedError line marked ith ==>

      /**
       *  \brief Element to hold payload copied onto receiver's queue.
       */
      typedef struct RPMessage_MsgElem_s
      {
          IpcUtils_QElem    elem;          /**< Allow list linking.          */
          uint32          len;           /**< Length of data               */
          uint32          src;           /**< Src address/endPt of the msg */
          uint32          procId;        /**< Processor sending the msg    */
      ==>    uint8          data[];        /**< payload begins here          */
      } RPMessage_MsgElem;/* The RPMessage Object */
      
      typedef struct RPMessage_Object_s
      {
          uint32             endPt;        /**< Unique id (procId | queueIndex) */
          void                 *semHandle;   /**< I/O Completion                 */
          RPMessage_Callback   cb;           /**< RPMessage Callback */
          void*                arg;          /**< Callback argument */
          IpcUtils_QHandle     queue;        /**< Queue of pending messages             */
          uint8              unblocked;    /**< Use with signal to unblock _receive() */
          IpcUtils_HeapParams  heapParams;   /* Save the heapBuf params to delete Heap   */
          IpcUtils_HeapHandle  heap;         /* Heap from which to allocate free messages */
          RPMessage_EndptPool  *pool;        /**< track associated pool for cleanup */
          void*                recv_buffer;  /**< Application buffer from RPMessage_recv() */
          RPMessage_MsgElem    payload;      /**< Message info for RPMessage_recv() */
      } RPMessage_Object;

      Analysis
      GHS doesn't like any structure or variable that has zero size. Given that this is data generated by TI, Customer insists TI fix the issues.

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Connection: Intermediate to External PROD System
                EXTSYNC-4422 - CDD_IPC: GHS compiler throws errors...
                SYNCHRONIZED
                • Last Sync Date: