X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: Alex Vinokur Newsgroups: comp.os.msdos.djgpp Subject: What does a program know of its optimization level? Date: Sun, 24 Feb 2002 15:46:43 +0200 Lines: 61 Message-ID: <3C78EEC3.EA2DFB88@bigfoot.com> NNTP-Posting-Host: 62.90.123.5 Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1014558406 6337751 62.90.123.5 (16 [79865]) X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com =============================================================== Windows98 gpp : GNU C++ version 2.95.3 20010315/djgpp (release) (djgpp) compiled by GNU C version 2.95.3 20010315/djgpp (release). =============================================================== Here is some program. // ----- C++-code : BEGIN ----- // File aaa.c #include int main() { #ifdef __OPTIMIZE__ cout << "Optimize = <" << __OPTIMIZE__ << ">" << endl; #else cout << "Optimize = Not Defined" << endl; #endif return 0; } // ----- C++-code : END ------- // ----- Compiling & Running : BEGIN ----- %gpp aaa.c a.exe Optimize = Not Defined %gpp -O1 aaa.c a.exe Optimize = <1> %gpp -O2 aaa.c a.exe Optimize = <1> // ----- Compiling & Running : END ------- The program "knows" if it was compiled with optimization, however it doesn't know which level of optimization (O1, O2) was used. Is there any possibility to know within a program which level of optimization was used? =========================== Alex Vinokur mailto:alexvn AT bigfoot DOT com mailto:alexvnw AT yahoo DOT com http://up.to/alexvn http://go.to/alexv_math ===========================