㈠ 關於linux gcc編譯器關閉gs驗證機制「 -fno-stack-protector 」
內核和應用程序的編譯是不一樣的,編譯應用的時候會調用一些你的編譯器工具鏈里的libc庫的,但是編譯內核的時候是不能call這些lib的,所以不能按著編譯應用的思想去編譯內核。你這個選項根本對內核無用。
㈡ -Wno-deprecated-declarations編譯選項什麼意思
這個編譯選項是用來關閉Xcode中關於廢棄API的警告
比如 你代碼中使用了某個已經被廢棄的API 這是Xcode會出現一個警告
這時你就可以通過這個編譯選項 關閉掉這個警告。
㈢ C++ int i[233];我直接這樣寫代表了什麼意思
C++ int i[233];直接這樣寫代表了,定義了一個整形的數組,共有233個整形元素,數組的名字叫做i。
㈣ Dev-C++一直提示「源文件未編譯」怎麼解決
1、打開DEV-C++,點擊菜單欄中的「工具」,點擊「編譯選項」這個選項,打開編譯選項對話框。
5、最後,重啟DEV-C++即可,問題完美解決,可以繼續完美地使用調試功能啦。
㈤ gcc 編譯優化做了哪些事求解答
用過gcc的都應該知道編譯時候的-O選項吧。它就是負責編譯優化。下面列出它的說明: -O -O1 Optimize. Optimizing compilation takes somewhat more time, and a lot more memory for a large function. With -O, the compiler tries to rece code size and execution time, without performing any optimizations that take a great deal of compilation time. -O turns on the following optimization flags: -fdefer-pop -fdelayed-branch -fguess-branch-probability -fcprop-registers -floop-optimize -fif-conversion -fif-conver- sion2 -ftree-ccp -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-ter -ftree-lrs -ftree-sra -ftree-rename -ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants -O also turns on -fomit-frame-pointer on machines where doing so does not interfere with debugging. -O doesn』t turn on -ftree-sra for the Ada compiler. This option must be explicitly speci- fied on the command line to be enabled for the Ada compiler. -O2 Optimize even more. GCC performs nearly all supported optimizations that do not involve a space-speed tradeoff. The compiler does not perform loop unrolling or function inlining when you specify -O2. As compared to -O, this option increases both compilation time and the performance of the generated code. -O2 turns on all optimization flags specified by -O. It also turns on the following opti- mization flags: -fthread-jumps -fcrossjumping -foptimize-sibling-calls -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm -fexpensive-optimizations -fstrength-rece -fre- run-cse-after-loop -frerun-loop-opt -fcaller-saves -fpeephole2 -fschele-insns -fsched- ule-insns2 -fsched-interblock -fsched-spec -fregmove -fstrict-aliasing -fdelete-null-pointer-checks -freorder-blocks -freorder-functions -falign-functions -falign-jumps -falign-loops -falign-labels -ftree-vrp -ftree-pre Please note the warning under -fgcse about invoking -O2 on programs that use computed gotos. -O3 Optimize yet more. -O3 turns on all optimizations specified by -O2 and also turns on the -finline-functions, -funswitch-loops and -fgcse-after-reload options. -O0 Do not optimize. This is the default. -Os Optimize for size. -Os enables all -O2 optimizations that do not typically increase code size. It also performs further optimizations designed to rece code size. -Os disables the following optimization flags: -falign-functions -falign-jumps -falign-loops -falign-labels -freorder-blocks -freorder-blocks-and-partition -fprefetch-loop-arrays -ftree-vect-loop-version If you use multiple -O options, with or without level numbers, the last such option is the one that is effective. Options of the form -fflag specify machine-independent flags. Most flags have both positive and negative forms; the negative form of -ffoo would be -fno-foo. In the table below, only one of the forms is listed---the one you typically will use. You can figure out the other form by either removing no- or adding it. The following options control specific optimizations. They are either activated by -O options or are related to ones that are. You can use the following flags in the rare cases when "fine-tuning" of optimizations to be performed is desired. -fno-default-inline Do not make member functions inline by default merely because they are defined inside the class scope (C++ only). Otherwise, when you specify -O, member functions defined inside class scope are compiled inline by default; i.e., you don』t need to add inline in front of the member function name. -fno-defer-pop Always pop the arguments to each function call as soon as that function returns. For machines which must pop arguments after a function call, the compiler normally lets argu- ments accumulate on the stack for several function calls and pops them all at once. Disabled at levels -O, -O2, -O3, -Os. -fforce-mem Force memory operands to be copied into registers before doing arithmetic on them. This proces better code by making all memory references potential common subexpressions. When they are not common subexpressions, instruction combination should eliminate the separate register-load. This option is now a nop and will be removed in 4.2. -fforce-addr Force memory address constants to be copied into registers before doing arithmetic on them. -fomit-frame-pointer Don』t keep the frame pointer in a register for functions that don』t need one. This avoids the instructions to save, set up and restore frame pointers; it also makes an extra regis- ter available in many functions. It also makes debugging impossible on some machines. On some machines, such as the VAX, this flag has no effect, because the standard calling sequence automatically handles the frame pointer and nothing is saved by pretending it doesn』t exist. The machine-description macro "FRAME_POINTER_REQUIRED" controls whether a target machine supports this flag. Enabled at levels -O, -O2, -O3, -Os. -foptimize-sibling-calls Optimize sibling and tail recursive calls. Enabled at levels -O2, -O3, -Os. -fno-inline Don』t pay attention to the "inline" keyword. Normally this option is used to keep the com- piler from expanding any functions inline. Note that if you are not optimizing, no func- tions can be expanded inline. -finline-functions Integrate all simple functions into their callers. The compiler heuristically decides which functions are simple enough to be worth integrating in this way. If all calls to a given function are integrated, and the function is declared "static", then the function is normally not output as assembler code in its own right. Enabled at level -O3. -finline-functions-called-once Consider all "static" functions called once for inlining into their caller even if they are not marked "inline". If a call to a given function is integrated, then the function is not output as assembler code in its own right. Enabled if -funit-at-a-time is enabled. -fearly-inlining Inline functions marked by "always_inline" and functions whose body seems smaller than the function call overhead early before doing -fprofile-generate instrumentation and real inlining pass. Doing so makes profiling significantly cheaper and usually inlining faster on programs having large chains of nested wrapper functions. Enabled by default. -finline-limit=n By default, GCC limits the size of functions that can be inlined. This flag allows the control of this limit for functions that are explicitly marked as inline (i.e., marked with the inline keyword or defined within the class definition in c++). n is the size of func- tions that can be inlined in number of pseudo instructions (not counting parameter han- dling). The default value of n is 600. Increasing this value can result in more inlined code at the cost of compilation time and memory consumption. Decreasing usually makes the compilation faster and less code will be inlined (which presumably means slower programs). This option is particularly useful for programs that use inlining heavily such as those based on recursive templates with C++. Inlining is actually controlled by a number of parameters, which may be specified indivi- ally by using --param name=value. The -finline-limit=n option sets some of these parame- ters as follows: max-inline-insns-single is set to I<n>/2. max-inline-insns-auto is set to I<n>/2. min-inline-insns is set to 130 or I<n>/4, whichever is smaller. max-inline-insns-rtl is set to I<n>. See below for a documentation of the indivial parameters controlling inlining. Note: pseudo instruction represents, in this particular context, an abstract measurement of function』s size. In no way does it represent a count of assembly instructions and as such its exact meaning might change from one release to an another. -fkeep-inline-functions In C, emit "static" functions that are declared "inline" into the object file, even if the function has been inlined into all of its callers. This switch does not affect functions using the "extern inline" extension in GNU C. In C++, emit any and all inline functions into the object file. -fkeep-static-consts Emit variables declared "static const" when optimization isn』t turned on, even if the vari- ables aren』t referenced. GCC enables this option by default. If you want to force the compiler to check if the variable was referenced, regardless of whether or not optimization is turned on, use the -fno-keep-static-consts option. -fmerge-constants Attempt to merge identical constants (string constants and floating point constants) across compilation units. This option is the default for optimized compilation if the assembler and linker support it. Use -fno-merge-constants to inhibit this behavior. Enabled at levels -O, -O2, -O3, -Os. -fmerge-all-constants Attempt to merge identical constants and identical variables. This option implies -fmerge-constants. In addition to -fmerge-constants this considers e.g. even constant initialized arrays or initialized constant variables with integral or floating point types. Languages like C or C++ require each non-automatic variable to have distinct location, so using this option will result in non-conforming behavior. -fmolo-sched Perform swing molo scheling immediately before the first scheling pass. This pass looks at innermost loops and reorders their instructions by overlapping different itera- tions. -fno-branch-count-reg Do not use "decrement and branch" instructions on a count register, but instead generate a sequence of instructions that decrement a register, compare it against zero, then branch based upon the result. This option is only meaningful on architectures that support such instructions, which include x86, PowerPC, IA-64 and S/390. The default is -fbranch-count-reg, enabled when -fstrength-rece is enabled. -fno-function-cse Do not put function addresses in registers; make each instruction that calls a constant function contain the function』s address explicitly. This option results in less efficient code, but some strange hacks that alter the assembler output may be confused by the optimizations performed when this option is not used. The default is -ffunction-cse -fno-zero-initialized-in-bss If the target supports a BSS section, GCC by default puts variables that are initialized to zero into BSS. This can save space in the resulting code. This option turns off this behavior because some programs explicitly rely on variables going to the data section. E.g., so that the resulting executable can find the beginning of that section and/or make assumptions based on that. The default is -fzero-initialized-in-bss. -fmudflap -fmudflapth -fmudflapir For front-ends that support it (C and C++), instrument all risky pointer/array dereferenc- ing operations, some standard library string/heap functions, and some other associated con- structs with range/validity tests. Moles so instrumented should be immune to buffer overflows, invalid heap use, and some other classes of C/C++ programming errors. The instrumentation relies on a separate runtime library (libmudflap), which will be linked into a program if -fmudflap is given at link time. Run-time behavior of the instrumented program is controlled by the MUDFLAP_OPTIONS environment variable. See "env MUD- FLAP_OPTIONS=-help a.out" for its options. Use -fmudflapth instead of -fmudflap to compile and to link if your program is multi-threaded. Use -fmudflapir, in addition to -fmudflap or -fmudflapth, if instrumenta- tion should ignore pointer reads. This proces less instrumentation (and therefore faster execution) and still provides some protection against outright memory corrupting writes, but allows erroneously read data to propagate within a program. -fstrength-rece Perform the optimizations of loop strength rection and elimination of iteration vari- ables. Enabled at levels -O2, -O3, -Os. -fthread-jumps Perform optimizations where we check to see if a jump branches to a location where another comparison subsumed by the first is found. If so, the first branch is redirected to either the destination of the second branch or a point immediately following it, depending on whether the condition is known to be true or false. Enabled at levels -O2, -O3, -Os. -fcse-follow-jumps In common subexpression elimination, scan through jump instructions when the target of the jump is not reached by any other path. For example, when CSE encounters an "if" statement with an "else" clause, CSE will follow the jump when the condition tested is false. Enabled at levels -O2, -O3, -Os. -fcse-skip-blocks This is similar to -fcse-follow-jumps, but causes CSE to follow jumps which conditionally skip over blocks. When CSE encounters a simple "if" statement with no else clause, -fcse-skip-blocks causes CSE to follow the jump around the body of the "if". Enabled at levels -O2, -O3, -Os. -frerun-cse-after-loop Re-run common subexpression elimination after loop optimizations has been performed. Enabled at levels -O2, -O3, -Os. -frerun-loop-opt Run the loop optimizer twice. Enabled at levels -O2, -O3, -Os. -fgcse Perform a global common subexpression elimination pass. This pass also performs global constant and propagation. Note: When compiling a program using computed gotos, a GCC extension, you may get better runtime performance if you disable the global common subexpression elimination pass by adding -fno-gcse to the command line. Enabled at levels -O2, -O3, -Os. -fgcse-lm When -fgcse-lm is enabled, global common subexpression elimination will attempt to move loads which are only killed by stores into themselves. This allows a loop containing a load/store sequence to be changed to a load outside the loop, and a /store within the loop. Enabled by default when gcse is enabled. -fgcse-sm When -fgcse-sm is enabled, a store motion pass is run after global common subexpression elimination. This pass will attempt to move stores out of loops. When used in conjunction with -fgcse-lm, loops containing a load/store sequence can be changed to a load before the loop and a store after the loop. Not enabled at any optimization level. -fgcse-las When -fgcse-las is enabled, the global common subexpression elimination pass eliminates rendant loads that come after stores to the same memory location (both partial and full rendancies). Not enabled at any optimization level. -fgcse-after-reload When -fgcse-after-reload is enabled, a rendant load elimination pass is performed after reload. The purpose of this pass is to cleanup rendant spilling. -floop-optimize Perform loop optimizations: move constant expressions out of loops, simplify exit test con- ditions and optionally do strength-rection as well. Enabled at levels -O, -O2, -O3, -Os. -floop-optimize2 Perform loop optimizations using the new loop optimizer. The optimizations (loop unrolling, peeling and unswitching, loop invariant motion) are enabled by separate flags. -funsafe-loop-optimizations If given, the loop optimizer will assume that loop indices do not overflow, and that the loops with nontrivial exit condition are not infinite. This enables a wider range of loop optimizations even if the loop optimizer itself cannot prove that these assumptions are valid. Using -Wunsafe-loop-optimizations, the compiler will warn you if it finds this kind of loop. -fcrossjumping Perform cross-jumping transformation. This transformation unifies equivalent code and save code size. The resulting code may or may not perform better than without cross-jumping. Enabled at levels -O2, -O3, -Os. -fif-conversion Attempt to transform conditional jumps into branch-less equivalents. This include use of conditional moves, min, max, set flags and abs instructions, and some tricks doable by standard arithmetics. The use of conditional execution on chips where it is available is controlled by "if-conversion2". Enabled at levels -O, -O2, -O3, -Os. -fif-conversion2 Use conditional execution (where available) to transform conditional jumps into branch-less equivalents. Enabled at levels -O, -O2, -O3, -Os. -fdelete-null-pointer-checks Use global dataflow analysis to identify and eliminate useless checks for null pointers. The compiler assumes that dereferencing a null pointer would have halted the program. If a pointer is checked after it has already been dereferenced, it cannot be null. In some environments, this assumption is not true, and programs can safely dereference null pointers. Use -fno-delete-null-pointer-checks to disable this optimization for programs which depend on that behavior. Enabled at levels -O2, -O3, -Os. -fexpensive-optimizations Perform a number of minor optimizations that are relatively expensive. Enabled at levels -O2, -O3, -Os. -foptimize-register-move -fregmove Attempt to reassign register numbers in move instructions and as operands of other simple instructions in order to maximize the amount of register tying. This is especially helpful on machines with two-operand instructions. Note -fregmove and -foptimize-register-move are the same optimization. Enabled at levels -O2, -O3, -Os. -fdelayed-branch If supported for the target machine, attempt to reorder instructions to exploit instruction slots available after delayed branch instructions. Enabled at levels -O, -O2, -O3, -Os. -fschele-insns If supported for the target machine, attempt to reorder instructions to eliminate execution stalls e to required data being unavailable. This helps machines that have slow floating point or memory load instructions by allowing other instructions to be issued until the result of the load or floating point instruction is required. Enabled at levels -O2, -O3, -Os. -fschele-insns2 Similar to -fschele-insns, but requests an additional pass of instruction scheling after register allocation has been done. This is especially useful on machines with a rel- atively small number of registers and where memory load instructions take more than one cycle. Enabled at levels -O2, -O3, -Os. -fno-sched-interblock Don』t schele instructions across basic blocks. This is normally enabled by default when scheling before register allocation, i.e. with -fschele-insns or at -O2 or higher. -fno-sched-spec Don』t allow speculative motion of non-load instructions. This is normally enabled by default when scheling before register allocation, i.e. with -fschele-insns or at -O2 or higher. -fsched-spec-load Allow speculative motion of some load instructions. This only makes sense when scheling before register allocation, i.e. with -fschele-insns or at -O2 or higher. -fsched-spec-load-dangerous Allow speculative motion of more load instructions. This only makes sense when scheling before register allocation, i.e. with -fschele-insns or at -O2 or higher. -fsched-stalled-insns -fsched-stalled-insns=n Define how many insns (if any) can be moved prematurely from the queue of stalled insns into the ready list, ring the second scheling pass. -fno-fsched-stalled-insns and -fsched-stalled-insns=0 are equivalent and mean that no insns will be moved prematurely. If n is unspecified then there is no limit on how many queued insns can be moved prema- turely. -fsched-stalled-insns-dep -fsched-stalled-insns-dep=n Define how many insn groups (cycles) will be examined for a dependency on a stalled insn that is candidate for premature removal from the queue of stalled insns. This has an effect only ring the second scheling pass, and only if -fsched-stalled-insns is used and its value is not zero. +-fno-sched-stalled-insns-dep is equivalent to +-fsched-stalled-insns-dep=0. +-fsched-stalled-insns-dep without a value is equivalent to +-fsched-stalled-insns-dep=1. -fsched2-use-superblocks When scheling after register allocation, do use superblock scheling algorithm. Superblock scheling allows motion across basic block boundaries resulting on faster scheles. This option is experimental, as not all machine descriptions used by GCC model the CPU closely enough to avoid unreliable results from the algorithm. This only makes sense when scheling after register
㈥ 在VC6.0中 c++ 怎麼用函數去實現關閉編譯窗口
1.如果你打開的是模態窗口,在該窗口類執行結束之後加上CDialog::OnCancel;
2.如果你打開的是非模態窗口,在該窗口類執行結束後加上DestroyWindow();
同時重載PostNcDestroy 虛函數,具體操作如下:
void CTestDlg::PostNcDestroy()
{
// TODO: Add your specialized code here and/or call the base class
delete this;
CDialog::PostNcDestroy();
}
㈦ gcc的位域壓縮模式,也沒有辦法,使其通過編譯器選項關閉
1下載
的海合會網站( http://gcc.gnu.org/ 的)或者通過網上搜索可以找到下載資源。目前的GCC 3.4.0的最新版本。該文件是可供下載,一般有兩種形式:GCC-3.4.0.tar.gz和gcc-3.4.0.tar.bz2,只是不相同的壓縮格式,內容完全一樣的,你可以下載一個。
2。解壓
根據壓縮格式,解壓以下選擇適當的方式(下面的「%」表示命令行提示符):
%焦油xzvf GCC-3.4.0.tar。廣州
或
%bzcat gcc-3.4.0.tar.bz2的焦油xvf命令 -
新一代的gcc-3.4.0這個目錄被稱為源目錄,使用$ {srcdir的}表示它。後來出現在$ {SRCDIR},其中真正的路徑應該更換。 pwd命令用來顯示當前路徑。
在$ {SRCDIR} / install目錄下的GCC有詳細的安裝說明,可用瀏覽器打開index.html閱讀。
3。建立目標目錄
目標目錄(使用$ {OBJDIR}表示)是用來存放編譯結果的地方。 GCC建議編譯後的文件不上的源目錄$ {srcdir的]中(雖然這也可),最好是單獨存儲在另一個目錄中,且不能$ {srcdir的}子目錄中。
例如,您可以創建一個文件名為gcc構建的目標目錄(源目錄$ {SRCDIR}是相同的目錄):
%MKDIR GCC構建%CD GCC-
以下操作主要是在目標目錄中建立在$ {OBJDIR}。
4。配置
目的是確定配置的GCC編譯器安裝到哪裡($ {DESTDIR}),然後指定用什麼語言支持一些其他的選擇。其中,$ {DESTDIR} $「{OBJDIR}不能或$ {SRCDIR}相同的目錄。
配置是通過$ {srcdir的}根據配置來完成。它的命令格式(記得用你的真實路徑替換$ {DESTDIR}):
%$ {SRCDIR} /配置的 - prefix = $ {DESTDIR} [其他選項]
例如,如果你想安裝GCC 3.4.0進入/ usr/local/gcc-3.4.0的目錄下,$ {DESTDIR}意味著這條道路。
在我的機器,我是這樣配置:
%。 / gcc-3.4.0/configure的 - 前綴= / usr/local/gcc- 3.4.0 - 啟用線程= POSIX - 禁用檢查 - 啟用 - 長隆 - 主機= I386-redhat的linux的 - 系統 - 啟用zlib的語言?= C,C + +,JAVA
GCC安裝在/ usr/local/gcc-3.4.0目錄下,支持C / C + +和JAVA語言及其他選項,請參見GCC提供的幫助說明。
5。編譯
這是一個漫長的過程。在我的機器上(P4-1.6),這個過程花了超過50分鍾。
6。安裝
執行以下命令來編譯的庫文件復制到$ {DESTDIR}目錄(路徑根據您的設置,您可能需要管理員許可權):
%使安裝
至此,GCC 3.4.0安裝過程就完成了。
6。其他設置
GCC 3.4.0的所有文件,包括命令文件(如gcc,g+ +的),所以庫文件目錄$ {DESTDIR},分別存放,如命令文件中的bin目錄下,在lib庫文件,頭文件包括遜色。由於該命令文件和庫文件所在的目錄不包含在相應的搜索路徑,它是必要的,以進行適當的設置後,編譯器可以成功地找到並使用它們。
6.1 GCC,G+ +,gcj的設置
要使用命令如GCC 3.4.0的gcc,最簡單的方法是把它的路徑$ {DESTDIR} / bin中放置在PATH環境變數。我不知道這種方式,但與符號鏈接的方式來實現這樣做的好處,所以我仍然可以使用舊的系統,原始版本的GCC編譯器。
首先,查看原來的gcc所在的路徑:
%GCC
在我的系統中,該命令將顯示:/ usr / bin中/海灣合作委員會。因此,原來的gcc命令在/ usr / bin目錄下。我們可以把GCC 3.4.0的gcc,g+ +的,GCJ和其他命令在/ usr / bin目錄下,分別創建一個符號鏈接:
%CD / usr / bin中
% LN - S $ {DESTDIR} / bin中/ GCC gcc34
%LN-S $ {DESTDIR} / bin中/ G+ + G+ 34
%LN-S $ {DESTDIR】/ BIN / gcj的gcj34 BR p>因此,可以單獨使用gcc34,G+ 34,gcj34的調用GCC 3.4.0的gcc,G+ +,gcj的完成了C,C + +,JAVA程序的編譯。雖然仍然可以使用舊版本的GCC編譯器在gcc,g+ +的其他命令。
6.2庫路徑設置
$ {DESTDIR} / lib路徑LD_LIBRARY_PATH環境變數,它是最好添加到系統的配置文件,所以它是沒有必要的每一個的設置此環境變數。
例如,如果GCC 3.4.0安裝在/ usr/local/gcc-3.4.0目錄下,在RH Linux可以直接運行在命令行或在文件/ etc /配置文件在這里補充一個:
SETENV LD_LIBRARY_PATH / usr/local/gcc-3.4.0/lib:$ LD_LIBRARY_PATH
7。測試
隨著新的編譯命令(gcc34,G+ +34等)編譯你以前的C,C + +程序來測試新安裝的GCC編譯器能正常工作。
8。根據需要,可以刪除或保留$ {SRCDIR} $ {OBJDIR}目錄。
如果您正在使用Ubuntu或Fedora的,那麼你可以將它安裝直接在源
㈧ C++中Release版本和DEBUG版本編譯選項差別的問題。
你是不是有變數沒有初始化或者用了諸如i=i++ + ++i這種未定義行為!這兩種情況必須考慮!盡量別去考慮debug和release的內存分配方式!
㈨ 我在打開一個網頁的時候出現了「您的瀏覽器不支持Javaacript或關閉了Java編譯器 」
這些網頁中有Javaacript腳本
你的瀏覽器可能是IE5.0或是更早的版本,也沒有升級過。
你可以嘗試更新IE瀏覽器
或是點開IE的選項中,在高級中設置。