Search code examples
cmicrochipmplabxc8xc16

mplab xc8/16 builtin_constant_p


I was searching for this in the mplab compiler users guide but haven't found anything. I am asking it here to confirm that I am not blind or anything:

The GCC compiler provides some very interesting and useful built-in functions like __builtin_constant_p(x) or similar stuff. I have never found anything like that in the microchip compilers and I don't think there is.

So the question: Do Microchip XCxx Compilers provide any non-standard built-in functions apart from the device specific ones (like declaring variables at a given register address or declaring an interrupt function)?

EDIT: To clarify some more: I am mostly interested in retrieving information from the compiler. A good example would be something like builtin_constant, as it makes information available to the program which is normally not usable. But I do not limit this question to find constant expressions only.


Solution

  • XC16 manual in google and out rolls: http://ww1.microchip.com/downloads/en/DeviceDoc/50002071E.pdf appendix G.