-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide version information in in preprocessor #282
Labels
Comments
I agree this would be nice. Thanks for the suggestion, I'll look into it. |
xavierleroy
added a commit
that referenced
this issue
Mar 25, 2019
As suggested in #282, it can be useful to #ifdef code depending on specific versions of CompCert. Assuming a version number of the form MM.mm or MM.mm.pp the following macros are predefined: __COMPCERT_MAJOR__=MM (the major version number) __COMPCERT_MAJOR__=mm (the minor version number) __COMPCERT_PATCHLEVEL__=pp (the patchlevel, or 0 if none) __COMPCERT_VERSION__=MMmmpp (two decimal digits each, e.g. 30500 for version 3.5)
A proposed implementation: #284. |
tbrk
pushed a commit
to inria-parkas/CompCert
that referenced
this issue
May 21, 2019
As suggested in AbsInt#282, it can be useful to #ifdef code depending on specific versions of CompCert. Assuming a version number of the form MM.mm , the following macros are predefined: __COMPCERT_MAJOR__=MM (the major version number) __COMPCERT_MINOR__=mm (the minor version number) __COMPCERT_VERSION__=MMmm (two decimal digits for the minor, e.g. 305 for version 3.5) We also define __COMPCERT_BUILDNR__ if the build number is not empty in file ./VERSION. Closes: AbsInt#282
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd like to add support for CompCert to Hedley, but AFAICT there is no way to tell from the preprocessor which version of CompCert is in use, so there is no way to tell when certain features can be enabled.
For example, it looks like noinline was added with version 3.2, so if I'd like to be able to do something like
It looks like this would basically just require something like
But obviously the version number shouldn't be hard-coded, and I'm not sure where to get it.
The text was updated successfully, but these errors were encountered: