Source Processor: Platform-dependent function signatures



  • Hi,

    the source processor is throwing an error for this constructor:

    #ifdef __APPLE__
    CBlowFish::CBlowFish(const unsigned char* ucKey, unsigned int keysize, const SBlock& roChain, bool backwardsCompatibility_) : m_oChain0(roChain), m_oChain(roChain)
    #else
    CBlowFish::CBlowFish(const unsigned char* ucKey, size_t keysize, const SBlock& roChain) : m_oChain0(roChain), m_oChain(roChain)
    #endif
    {
    ...
    

    The error is:
    error: Expected ',' or '{', found 'CBlowFish' instead.

    I know the source processor does not parse preprocessor statements, so yes, this might look like a syntax error to it. But it's not. This had always worked, and still does. So how can I tell the source processor to shut up about it? ;-)

    Thanks in advance,
    Frank



  • I managed to get rid of the error by adding this line to projectdefinition.txt:

    DontUncrustify="blowfish.cpp"
    

    But since this disables all source processor activity on this file, as I understood it, I wonder if there is no "cleaner" way to suppress just this one false error.



  • Hi Frank, thanks for reaching out us.

    With regard to the reported issue, which I suppose it's happening on your side, you can consider, rather than disabling uncrustifying, modifying your code as:

    CBlowFish::CBlowFish(const unsigned char* ucKey, unsigned int keysize, const SBlock& roChain
    #ifdef _APPLE_
     , bool backwardsCompatibility_
    #endif
    ) : m_oChain0(roChain), m_oChain(roChain)
    

    Looking forward to see if it works for you, give best.
    Riccardo



  • Hi Riccardo,

    thank you! I'll try that.
    Admittedly, it doesn't really improve code readability ;-)

    Best greetings,
    Frank



  • It builds, and the source processor does not complain. Thank you!


Log in to reply