View previous topic :: View next topic |
Author |
Message |
newguy
Joined: 24 Jun 2004 Posts: 1911
|
CCS support for version checking at compile time? [Solved] |
Posted: Fri Feb 15, 2019 3:26 pm |
|
|
I've searched and either I'm not using the proper keywords or what I'm looking for doesn't exist.
Does CCS have some kind of support for a compiler environment check? For example, let's say I create a project and eventually release something. I use compiler version 5.x, and leave comments in the code saying as much. A colleague then edits the project to make a minor change but uses compiler version 5.y and - for argument's sake - something breaks.
It would be useful to force the compiler to check what compiler version is actually being used, and generate an error if it's not what it is supposed to be.
I realize that I could simply put in a Code: | #warning Version 5.x must be used!!! | but that would assume that people read compiler warnings.
Anyone know if this is supported? |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1911
|
|
Posted: Fri Feb 15, 2019 3:38 pm |
|
|
Nevermind: I knew I had seen something about compiler version checking/restriction. If you use the IDE, it's in Options->Project, General. Checkbox for "Use specific compiler version" |
|
|
jeremiah
Joined: 20 Jul 2010 Posts: 1358
|
|
Posted: Fri Feb 15, 2019 6:59 pm |
|
|
We also do a precompiler check against the version and issue either a #warning or #error if the compiler version doesn't match.
Something like:
Code: |
#if getenv("VERSION") != 5.080
#error Using wrong compiler version
#endif
|
|
|
|
newguy
Joined: 24 Jun 2004 Posts: 1911
|
|
Posted: Sun Feb 17, 2019 2:15 pm |
|
|
That's exactly what I was looking for. Cheers! |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Thu Feb 28, 2019 1:21 am |
|
|
newguy wrote: | That's exactly what I was looking for. Cheers! |
Don't forget to change the OP subject to include "SOLVED" somehow.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
|