zoukankan      html  css  js  c++  java
  • C编译器中对h文件的重重包含导致的预处理不同的问题

    在.h文件中使用以下代码

    extern __inline__ Mcal_WdtCalcSeqPassword(uint16 SeqPassword)
    {
    /*IFX_MISRA_RULE_08_05_STATUS=Allowed for inline functions defined in header
    files*/
    uint16 InterPasswordl;
    /*IFX_MISRA_RULE_08_05_STATUS=Allowed for inline functions defined in header
    files*/
    uint16 Expected_Passl;
    /* calculate 2nd bit position value */
    InterPasswordl = ((SeqPassword >> 15U)^(SeqPassword >> 14U)^
    (SeqPassword >> 13U)^(SeqPassword >> 3U)) & 1U;
    /*shift each each bit by 1 towards left */
    Expected_Passl = (uint16)(((uint16)(SeqPassword << 1U)|
    (uint16)(InterPasswordl << 2U)) & 0x0000FFFFU);
    /* return the calculated next sequence password value */
    return(Expected_Passl);
    }

    不会报错。

    但是一旦使用其他形式的修饰,比如在illd中经常使用的

    static __inline__ __attribute__((__always_inline__))

    就会报错。

  • 相关阅读:
    jQuery Validate 插件
    本地存储 web storage
    ajax简介及JS写原生ajax
    swiper插件简介及用法
    JavaScript中的string对象及方法
    javascript数组中的方法
    面向对象
    logging模块具体补充
    模块补充
    内置函数总结
  • 原文地址:https://www.cnblogs.com/praiseslow/p/13723902.html
Copyright © 2011-2022 走看看