From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,551288287baf9a1c X-Google-Attributes: gid111c93,public From: Compaq C/C++ Team Subject: Re: Compaq's c++ succesfully runs under Debian woody Date: 2000/04/03 Message-ID: <38E920AA.41C6@zko.dec.com>#1/1 X-Deja-AN: 606294113 Content-Transfer-Encoding: 7bit References: <38E5D353.8A47DF26@chello.nl> Content-Type: text/plain; charset=us-ascii X-Complaints-To: iass@lead.zk3.dec.com X-Trace: lead.zk3.dec.com 954802346 1215 16.31.32.198 (3 Apr 2000 22:52:26 GMT) Mime-Version: 1.0 NNTP-Posting-Date: 3 Apr 2000 22:52:26 GMT Newsgroups: comp.os.linux.alpha Abraham Theodorus Stolk wrote: > I have one remaining problem though: > Now I have a gnu and a compaq compiler installed, and I would like > to print runtime msgs in my app, stating the compiler that was used. > > Unfortunately, compaqs compiler seems to come without a > /usr/lib/compaq/ccc-6.2.9.002-2/alpha-linux/bin/cpp, > so gnu's cpp is used, which expands the __VERSION__ macro to > gcc's version string, and not ccc's version string. > > Bram Neither of the compilers normally invoke gnu cpp to perform preprocessing, nor do they provide a separate standalone preprocessor program. Instead they perform preprocessing as an integrated part of compiler, and if you ask for explicit preprocessor output, the -E or -P flag gets passed into the compiler telling it to produce preprocessor output without going any further into the compilation process. The version of the compiler is available as a predefined macro, __DECC_VER for ccc and __DECCXX_VER for cxx. Each of these macros expands to an integer that encodes the complete version number of the compiler (excluding the "repackaging number") in fixed decimal digit positions as follows: For V6.2-002, __DECC_VER = 60290002: 6 . 2 V -002 6 02 9 0002 For T6.3-003, __DECCXX_VER = 60360003: 6 . 3 T -003 6 03 6 0003 If you want to print it in an application, you can just print the integer, or break it down into its components with / and %. - Compaq C/C++ Team