title: how to solve a deprecate declaration of a function when compiling warning?
body: <p>I have 3 file dependencies, in one of them I have implemented one function that you can see the first of all below. It returns an int type of 32 bits. The second file implements a function that calls the funtion of the first file. This function will be called from main file (third file). 
  When I compile (with keil IDE) all the files I have the following warning msg:</p>
  
  <pre><code>compiling App_Task_CAN.c...
  ..\src\Application_Tasks\App_Task_CAN.h(132): warning:  #1295-D: Deprecated      declaration App_Task_CAN_GetError - give arg types
    uint32_t App_Task_CAN_GetError();
  </code></pre>
  
  <p>This is a part of code in a file I have included stm32l4xx_hal_can.c:</p>
  
  <pre><code> uint32_t HAL_CAN_GetError(CAN_HandleTypeDef *hcan)
   {
        return hcan-&gt;ErrorCode;
   }
  </code></pre>
  
  <p>where hcan is in stm32l4xx_hal_can.h a type of:</p>
  
  <pre><code>   /**
     * @brief  CAN handle Structure definition
     */
   typedef struct
   {
       CAN_TypeDef                 *Instance;  /*!&lt; Register base address          */
  
       CAN_InitTypeDef             Init;       /*!&lt; CAN required parameters        */
  
       CanTxMsgTypeDef*            pTxMsg;     /*!&lt; Pointer to transmit structure  */
  
       CanRxMsgTypeDef*            pRxMsg;     /*!&lt; Pointer to reception structure */
  
       __IO HAL_CAN_StateTypeDef   State;      /*!&lt; CAN communication state        */
  
       HAL_LockTypeDef             Lock;       /*!&lt; CAN locking object             */
  
       __IO uint32_t               ErrorCode;  /*!&lt; CAN Error code                 */ 
  
  }CAN_HandleTypeDef;
  </code></pre>
  
  <p>Furthermore I have this implementation in other file calling to the first shown function in App_Task_CAN.c :</p>
  
  <pre><code>...
  CAN_HandleTypeDef HCAN_Struct;//hcan struct type declaration in this file
  
  uint32_t App_Task_CAN_GetError()
  {   
      static uint32_t ErrorNumb;
  
      ErrorNumb=HAL_CAN_GetError(&amp;HCAN_Struct);
  
      return ErrorNumb; //I want this functions returns an int value.
  }
  </code></pre>
  
  <p>Main code in main.c:</p>
  
  <pre><code>int main(void)
  {
      uint32_t    ErrorType=0;
  
      while (1)
      {
          ErrorType=App_Task_CAN_GetError(); //it takes the resulting value of calling HAL_CAN_GetError(&amp;HCAN_Struct)
      }
  }
  </code></pre>
  
  <p>The warning disappears when I pass an argument. But I don't know why it is asking me for a argument for saving the return value. </p>
  
  <p>Why does it needs an argument since it returns an uint32_t? Is it possible to improve the code in order to get updated ErrorType from main when main calls App_Task_CAN_GetError()?</p>
  
  <p>Note: stm32l4xx_hal_can.c and .h can not been modified since they are system libraries files.</p>