📄 gcc.1
字号:
.br \ \ ....br \ \ if (change_y) y = save_y;.br }.spThis has no bug because.I save_yis used only if it is set..spSome spurious warnings can be avoided if you declare as.B volatileall the functions you use that never return..BPA nonvolatile automatic variable might be changed by a call to.IR longjmp (3C).These warnings as well are possible only in optimizing compilation..spThe compiler sees only the calls to.IR setjmp (3C).It cannot know where.IR longjmp (3C)will be called; in fact, a signal handler couldcall it at any point in the code.As a result, you may get a warning even when there isin fact no problem because.IR longjmp (3C)cannot in fact be called at the place which would cause a problem..BPA function can return either with or without a value.(Falling off the end of the function body is considered returning withouta value.)For example, this function would evoke such a warning:.sp foo (a).br {.br \ \ if (a > 0).br \ \ \ \ return a;.br }.spSpurious warnings can occur because GNU CC does not realize thatcertain functions (including.IR abort (3C)and .IR longjmp (3C))will never return..BPAn expression-statement contains no side effects..spIn the future, other useful warnings may also be enabled by this option..TP.B \-WimplicitWarn whenever a function is implicitly declared..TP.B \-Wreturn-typeWarn whenever a function is defined with a return-type that defaults to.BR int .Also warn about any.B returnstatement with no return-value in a function whose return-type is not.BR void ..TP.B \-WunusedWarn whenever a local variable is unused aside from its declaration,and whenever a function is declared static but never defined..TP.B \-WswitchWarn whenever a.B switchstatement has an index of enumeral type and lacks a.B casefor one or more of the named codes of that enumeration.(The presence of a.B defaultlabel prevents this warning.).B caselabels outside the enumeration range also provokewarnings when this option is used..TP.B \-WcommentWarn whenever a comment-start sequence.B /\(**appears in a comment..TP.B \-WtrigraphsWarn if any trigraphs are encountered (assuming they are enabled)..TP.B \-WallAll of the above .B \-Woptions combined.These are all the options which pertain to usage that we do not recommend andthat we believe is always easy to avoid, even in conjunction with macros..sp The other.BR \-W ...options below are not implied by.B \-Wallbecause certain kinds of useful macros are almost impossible to writewithout causing those warnings..TP.B \-WshadowWarn whenever a local variable shadows another local variable..TP.BI \-Wid-clash- lenWarn whenever two distinct identifiers match in the first.I lencharacters.This may help you prepare a program that will compile with certain obsolete,brain-damaged compilers..TP.B \-Wpointer-arithWarn about anything that depends on the size of a function type or of.BR void .GNU C assigns these types a size of 1, for convenience in calculations with.B void \(**pointers and pointers to functions..TP.B \-Wcast-qualWarn whenever a pointer is cast so as to remove a type qualifier fromthe target type.For example, warn if a .B const char \(**is cast to an ordinary.BR "char \(**" ..TP.B \-Wwrite-stringsGive string constants the type.B const char[\fIlength\fB]so that copying the address of one into a.RB non- "const char \(**"pointer will get a warning.These warnings will help you find at compile timecode that can try to write into a string constant,but only if you have been very careful about using.B constin declarations and prototypes.Otherwise, it will just be a nuisance; this is why we did not make.B \-Wallrequest these warnings..TP.B \-pGenerate extra code to write profile information suitablefor the analysis program.IR prof (1)..TP.B \-pgGenerate extra code to write profile information suitable for theanalysis program.IR gprof (1)..TP.B \-aGenerate extra code to write profile information for basic blocks,suitable for the analysis program.IR tcov (1).Eventually GNU.IR gprof (1)should be extended to process this data..TP.BI \-l librarySearch a standard list of directories for a library named.IR library ,which is actually a file named.BR lib\fIlibrary\fB.a .The linker uses this file as if it had been specified precisely by name..spThe directories searched include several standard system directoriesplus any that you specify with.BR \-L ..spNormally the files found this way are library files--archive fileswhose members are object files.The linker handles an archive file by scanning through it for memberswhich define symbols that have so far been referenced but not defined.But if the file that is found is an ordinary object file, it is linkedin the usual fashion.The only difference between using an.B \-loption and specifying a file name is that.B \-lsearches several directories..TP.BI \-L dirAdd directory.I dirto the list of directories to be searched for.BR \-l ..TP.B \-nostdlibDon't use the standard system libraries and startup files when linking.Only the files you specify (plus .BR gnulib )will be passed to the linker..TP.BI \-m machinespecMachine-dependent option specifying something about the type of target machine.These options are defined by the macro.B TARGET_SWITCHESin the machine description.The default for the options is also defined by that macro,which enables you to change the defaults..spThese are the.B \-moptions defined in the 68000 machine description:.sp.B \-m68020.br.B \-mc68020.in +.5iGenerate output for a 68020 (rather than a 68000).This is the default if you use the unmodified sources..in -.5i.sp.B \-m68000.br.B \-mc68000.in +.5iGenerate output for a 68000 (rather than a 68020)..in -.5i.sp.B \-m68881.in +.5iGenerate output containing 68881 instructions for floating point.This is the default if you use the unmodified sources..in -.5i.sp.B \-mfpa.in +.5iGenerate output containing Sun FPA instructions for floating point..in -.5i.sp.B \-msoft-float.in +.5iGenerate output containing library calls for floating point..in -.5i.sp.B \-mshort.in +.5iConsider type.B intto be 16 bits wide, like.BR "short int" ..in -.5i.sp.B \-mnobitfield.in +.5iDo not use the bit-field instructions..B \-m68000implies.BR \-mnobitfield ..in -.5i.sp.B \-mbitfield.in +.5iDo use the bit-field instructions..B \-m68020implies.BR \-mbitfield .This is the default if you use the unmodified sources..in -.5i.sp.B \-mrtd.in +.5iUse a different function-calling convention, in which functionsthat take a fixed number of arguments return with the.B rtdinstruction, which pops their arguments while returning.This saves one instruction in the caller since there is no need to popthe arguments there..spThis calling convention is incompatible with the one normallyused on Unix, so you cannot use it if you need to call librariescompiled with the Unix compiler..spAlso, you must provide function prototypes for all functions thattake variable numbers of arguments (including .BR printf (3S));otherwise incorrect code will be generated for calls to those functions..spIn addition, seriously incorrect code will result if you call afunction with too many arguments.(Normally, extra arguments are harmlessly ignored.).spThe.B rtdinstruction is supported by the 68010 and 68020 processors,but not by the 68000..in -.5i.spThese.B \-moptions are defined in the Vax machine description:.sp.B \-munix.in +.5iDo not output certain jump instructions .RB ( aobleqand so on) that the Unix assembler for the Vaxcannot handle across long ranges..in -.5i.sp.B \-mgnu.in +.5iDo output those jump instructions, on the assumption that youwill assemble with the GNU assembler..in -.5i.sp.B \-mg.in +.5iOutput code for g-format floating point numbers instead of d-format..in -.5i.spThese.B \-mswitches are supported on the Sparc:.sp.B \-mfpu.in +.5iGenerate output containing floating point instructions.This is the default if you use the unmodified sources..in -.5i.sp.B \-msoft-float.in +.5iGenerate output containing library calls for floating point..in -.5i.sp.B \-mno-epilogue.in +.5iGenerate separate return instructions for.B returnstatements.This has both advantages and disadvantages; I don't recall what they are..in -.5i.spThese.B \-moptions are defined in the Convex machine description:.sp.B \-mc1.in +.5iGenerate output for a C1.This is the default when the compiler is configured for a C1..in -.5i.sp.B \-mc2.in +.5iGenerate output for a C2.This is the default when the compiler is configured for a C2..in -.5i.sp.B \-margcount.in +.5iGenerate code which puts an argument count in the word preceding eachargument list.Some nonportable Convex and Vax programs need this word.(Debuggers don't; this info is in the symbol table.).in -.5i.sp.B \-mnoargcount.in +.5iOmit the argument count word.This is the default if you use the unmodified sources..in -.5i.TP.BI \-f flagSpecify machine-independent flags.Most flags have both positive and negative forms; the negative form of.B \-ffoowould be.BR \-fno-foo .In the table below, only one of the forms is listed--the one whichis not the default.You can figure out the other form by either removing.B no-or adding it..TP.B \-fpcc-struct-returnUse the same convention for returning.B structand.B unionvalues that is used by the usual C compiler on your system.This convention is less efficient for small structures, and on manymachines it fails to be reentrant; but it has the advantage of allowingintercallability between GCC-compiled code and PCC-compiled code..TP.B \-ffloat-storeDo not store floating-point variables in registers.This prevents undesirable excess precision on machines such as the68000 where the floating registers (of the 68881) keep moreprecision than a .B doubleis supposed to have..spFor most programs, the excess precision does only good, but a fewprograms rely on the precise definition of IEEE floating point.Use.B \-ffloat-storefor such programs..TP.B \-fno-asmDo not recognize.BR asm ,.B inlineor.B typeofas a keyword.These words may then be used as identifiers.You can use.BR __asm__ ,.B __inline__and.B __typeof__instead..TP.B \-fno-defer-popAlways pop the arguments to each function call as soon as thatfunction returns.Normally the compiler (when optimizing) lets arguments accumulateon the stack for several function calls and pops them all at once..TP.B \-fstrength-reducePerform the optimizations of loop strength reduction andelimination of iteration variables..TP.B \-fcombine-regsAllow the combine pass to combine an instruction that copies oneregister into another.This might or might not produce better code when used in addition to.BR \-O .
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -