Mplab xc8 / 16 builtin_constant_p

I searched for this in the mplab compiler user manual but found nothing. I am asking here to confirm that I am not blind or something:

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

So the question is: do Microchip XCxx compilers provide any non-standard built-in functions other than device-specific (such as declaring variables at a given register address or declaring an interrupt function)?

EDIT: To clarify something else: I'm most interested in retrieving information from the compiler. Something like builtin_constant would be a good example, as it makes information available to a program that is not normally used. But I am not limiting this question to finding constant expressions only.

+3


source to share


2 answers


XC16 tutorial on google and out rolls: http://ww1.microchip.com/downloads/en/DeviceDoc/50002071E.pdf Appendix G.



0


source


The same document mentioned by @Marco van de Voort contains a list of predefined macros in section 19.4 which provides compiler environment and device details.



There is also an undocumented __DEBUG macro that is defined when running in MPLABX in debug mode (MPLABX defines this in a call to the compiler).

0


source







All Articles