Interestingly,cl.exethoughtfully remove alliostreamrelated functions consistently even if I didn't use/O2or any other flags, justcl.exe main.cpp. (For the code above,cl.exeproduces 100+KB binary). Did I miss any other useful gcc flags for this?
-Wsuggest-attribute=const Warn about functions which might be candidates forattribute((const)) -Wsuggest-attribute=noreturn 当函数可能是attribute((noreturn))的备选时给出警告 -Wsuggest-attribute=pure Warn about functions which might be candidates forattribute((pure)) -Wsurprising 对“可疑”的构造给...
-Wsuggest-attribute=const Warn about functions which might be candidates for attribute((const)) -Wsuggest-attribute=noreturn 当函数可能是 attribute((noreturn)) 的备选时给出警告 -Wsuggest-attribute=pure Warn about functions which might be candidates for attribute((pure)) -Wsurprising 对“可疑”的...
-Wsuggest-attribute=const Warn about functions which might be candidates forattribute((const)) -Wsuggest-attribute=noreturn 当函数可能是attribute((noreturn)) 的备选时给出警告 -Wsuggest-attribute=pure Warn about functions which might be candidates forattribute((pure)) -Wsurprising 对“可疑”的构造给...
-Gy 分隔链接器函数 separate functions for linker -GZ 启用运行时调试检查 enable runtime debug checks -Gh 启用钩子函数调用 enable hook function call -Ge 对所有函数强制堆栈检查 force stack checking for all funcs -Gs[num] 禁用堆栈检查调用 disable stack checking calls ...
-frequire-return-statement Functions which return values must end with return statements 其他编译选项 -o 设定输出文件名 -c 只编译,不连接. -E 只做预编译. -pipe 在多个编译过程之间使用管道. --version 显示版本. -static 静态连接. -ansi C 模式下支持所有 ISO C90 标准的 C 程序, C++ 模式下去除...
Functions declared static within a .c file are only visible/usable within that file only. If they are not used in it, then they are effectively dead code and the compiler warns you about this fact. In GCC you can use the unused function attribute to suppress this warning: static int __...
Return type deduction for normal functions N3638 4.8 (N3386) 4.9 (N3638) __cpp_decltype_auto >= 201304 Generalized lambda capture (init-capture) N3648 4.5 (partial) 4.9 (N3648) __cpp_init_captures >= 201304 Generic (polymorphic) lambda expressions N3649 4.9 __cpp_generic_lambdas >= 201...
Non-literal variables (and labels and gotos) in constexpr functions P2242R3 12 __cpp_constexpr >= 202110L Character encoding of diagnostic text P2246R1 No Character sets and encodings P2314R4 No Consistent character literal encoding P2316R2 Yes Add support for preprocessing directives elifd...
functions -finline-limit=n -fkeep-inline-functions -fkeep-static-consts -fmerge-constants -fmerge-all-constants -fmove-all-movables -fnew-ra -fno-branch-count-reg -fno-default-inline -fno-defer-pop -fno-function-cse -fno-guess-branch-probability -fno-inline -fno-math-errno -fno-...