在这篇文章中,我们将为您详细介绍linuxGcc4.4.7snprintf莫名崩溃的内容,并且讨论关于linux程序崩溃的相关问题。此外,我们还会涉及一些关于Arm计划将SLS补丁反向移植到GCC10
在这篇文章中,我们将为您详细介绍linux Gcc 4.4.7 snprintf莫名崩溃的内容,并且讨论关于linux程序崩溃的相关问题。此外,我们还会涉及一些关于Arm 计划将 SLS 补丁反向移植到 GCC 10 和 GCC 9、C++ Standards Support in GCC - GCC 对 C++ 标准的支持、CentOS 7 x64 安装 gcc 和 gcc-c++、CentOS 升级 gcc gcc-c++ 到 4.8 版本的知识,以帮助您更全面地了解这个主题。
本文目录一览:- linux Gcc 4.4.7 snprintf莫名崩溃(linux程序崩溃)
- Arm 计划将 SLS 补丁反向移植到 GCC 10 和 GCC 9
- C++ Standards Support in GCC - GCC 对 C++ 标准的支持
- CentOS 7 x64 安装 gcc 和 gcc-c++
- CentOS 升级 gcc gcc-c++ 到 4.8 版本
linux Gcc 4.4.7 snprintf莫名崩溃(linux程序崩溃)
#if 0
///!!!!BUGS linux -O3这下这个函数直接崩溃原因不明
#else
int appendLen = sprintf(U.rpt.datas, "%s", (*iter)->url);
用sprintf没事,用snprintf直接崩溃,真是诡异
环境Release版 -O3优化,Debug版没事。真是坑爹
Arm 计划将 SLS 补丁反向移植到 GCC 10 和 GCC 9
6 月份,Google 的 SafeSide 小组在 ARM 处理器的 Armv8-A(Cortex-A)CPU 体系结构中发现了一个名为 Straight-Line Speculation(SLS)的新漏洞(CVE-2020-13844),该漏洞可导致攻击者对ARM架构处理器进行侧信道攻击。彼时,Arm 对该漏洞进行了披露,不过并未引起公众太大的关注。
目前,该 SLS 漏洞似乎已经变得愈发严重起来。Arm 方面正在着手将 GCC 11 开发代码中的缓解措施反向移植到 GCC 10 甚至是 GCC 9。Arm 的一位工程师已经发布了一个 SLS 补丁程序,该补丁程序将反向移植到 GCC 9,而 GCC 10 的补丁则预计将在 GCC 10.2 发布后出现。
Arm 于本月初将其最初的 SLS 缓解措施合并到了 GCC Git 中,涵盖 RET 和 BR 指令。用户现下可通过编译器在易受攻击的指令周围插入 speculation barrier(SB)指令来缓解 SLS。不过 Arm 方面表示,其不建议默认情况下启用这些基于编译器的缓解措施,理由是过度使用 SB 指令会对性能造成影响。
可以通过 -mharden-sls= 来启用 GCC 的 Arm SLS 缓解。其中值为“all”时,可缓解所有易受攻击的指令,为“retbr”时则仅在 RET 和 BR 指令上插入 speculation barrier,而“blr”只用于缓解 BLR usage。当前,此 Arm SLS 缓解措施尚不支持 per-function basis 缓解。
C++ Standards Support in GCC - GCC 对 C++ 标准的支持
C++ Standards Support in GCC - 2019-2-20
GCC supports different dialects of C++, corresponding to the multiple published ISO standards. Which standard it implements can be selected using the -std=
command-line option.
- C++98
- C++11
- C++14
- C++17
- C++2a
- Technical Specifications
For information about the status of the library implementation, please see this page.
C++2a Support in GCC
GCC has experimental support for the next revision of the C++ standard, which is expected to be published in 2020.
C++2a features are available as part of "mainline" GCC in the trunk of GCC''s repository and will be available in GCC 8 and later. To enable C++2a support, add the command-line parameter -std=c++2a
to your g++
command line. Or, to enable GNU extensions in addition to C++2a features, add -std=gnu++2a
.
Important: Because the ISO C++2a standard is still evolving, GCC''s support is experimental. No attempt will be made to maintain backward compatibility with implementations of C++2a features that do not reflect the final standard.
C++2a Language Features
The following table lists new language features that have been accepted into the C++2a working draft. The "Proposal" column provides a link to the ISO C++ committee proposal that describes the feature, while the "Available in GCC?" column indicates the first version of GCC that contains an implementation of this feature (if it has been implemented).
Language Feature | Proposal | Available in GCC? | SD-6 Feature Test |
---|---|---|---|
Default member initializers for bit-fields | P0683R1 | 8 | |
Fixing const-qualified pointers to members | P0704R1 | 8 | |
Allow lambda capture [=, this] |
P0409R2 | 8 | |
__VA_OPT__ for preprocessor comma elision |
P0306R4 P1042R1 |
8 (partial, no #__VA_OPT__ support) |
|
Designated initializers | P0329R4 | 8 | |
Familiar template syntax for generic lambdas | P0428R2 | 8 | |
List deduction of vector | P0702R1 | 8 | |
Concepts | P0734R0 P0857R0 P1084R2 P1141R2 |
TS with -fconcepts | |
Range-based for statements with initializer | P0614R1 | 9 | |
Simplifying implicit lambda capture | P0588R1 | 8 | |
ADL and function templates that are not visible | P0846R0 | 9 | |
const mismatch with defaulted copy constructor |
P0641R2 | 9 | |
Less eager instantiation of constexpr functions |
P0859R0 | 5.2 (mostly) 9 (P0859R0) |
|
Consistent comparison (operator<=> ) |
P0515R3 P0905R1 P1120R0 |
No | __cpp_impl_three_way_comparison >= 201711 |
Access checking on specializations | P0692R1 | Yes | |
Default constructible and assignable stateless lambdas | P0624R2 | 9 | |
Lambdas in unevaluated contexts | P0315R4 | 9 | |
Language support for empty objects | P0840R2 | 9 | |
Relaxing the range-for loop customization point finding rules | P0962R1 | 8 | |
Allow structured bindings to accessible members | P0969R0 | 8 | |
Relaxing the structured bindings customization point finding rules | P0961R1 | 8 | |
Down with typename! | P0634R3 | 9 | |
Allow pack expansion in lambda init-capture | P0780R2 | 9 | |
Proposed wording for likely and unlikely attributes | P0479R5 | 9 | |
Deprecate implicit capture of this via [=] | P0806R2 | 9 | |
Class Types in Non-Type Template Parameters | P0732R2 | 9 | __cpp_nontype_template_parameter_class >= 201806 |
Atomic Compare-and-Exchange with Padding Bits | P0528R3 | No (PR 88101) | |
Efficient sized delete for variable sized classes | P0722R3 | 9 | __cpp_impl_destroying_delete >= 201806 |
Allowing Virtual Function Calls in Constant Expressions | P1064R0 | 9 | |
Prohibit aggregates with user-declared constructors | P1008R1 | 9 | |
Support for contract based programming in C++ | P0542R5 P1289R1 |
No (PR 88102) | |
explicit(bool) | P0892R2 | 9 | __cpp_conditional_explicit >= 201806 |
Signed integers are two''s complement | P1236R1 | 9 | |
char8_t | P0482R6 | 9 | __cpp_char8_t >= 201811 |
Immediate functions (consteval) | P1073R3 | No | |
std::is_constant_evaluated | P0595R2 | 9 | |
Nested inline namespaces | P1094R2 | 9 | |
Relaxations of constexpr restrictions | P1002R1 P1327R1 P1330R0 |
No | |
Feature test macros | P0941R2 | 4.9 (__cpp_ macros) 5 ( __has_cpp_attribute ) |
C++17 Support in GCC
GCC has experimental support for the latest revision of the C++ standard, which was published in 2017.
C++17 features are available as part of "mainline" GCC in the trunk of GCC''s repository and in GCC 5 and later. To enable C++17 support, add the command-line parameter -std=c++17
to your g++
command line. Or, to enable GNU extensions in addition to C++17 features, add -std=gnu++17
.
Important: Because the final ISO C++17 standard is still new, GCC''s support is experimental. No attempt will be made to maintain backward compatibility with implementations of C++17 features that do not reflect the final standard.
C++17 Language Features
The following table lists new language features that have been accepted into the C++17 working draft. The "Proposal" column provides a link to the ISO C++ committee proposal that describes the feature, while the "Available in GCC?" column indicates the first version of GCC that contains an implementation of this feature (if it has been implemented).
Language Feature | Proposal | Available in GCC? | SD-6 Feature Test |
---|---|---|---|
Removing trigraphs | N4086 | 5 | |
u8 character literals |
N4267 | 6 | __cpp_unicode_characters >= 201411 |
Folding expressions | N4295 | 6 | __cpp_fold_expressions >= 201411 |
Attributes for namespaces and enumerators | N4266 | 4.9 (namespaces) 6 (enumerators) |
__cpp_namespace_attributes >= 201411 __cpp_enumerator_attributes >= 201411 |
Nested namespace definitions | N4230 | 6 | __cpp_nested_namespace_definitions >= 201411 |
Allow constant evaluation for all non-type template arguments | N4268 | 6 | __cpp_nontype_template_args >= 201411 |
Extending static_assert |
N3928 | 6 | __cpp_static_assert >= 201411 |
New Rules for auto deduction from braced-init-list | N3922 | 5 | |
Allow typename in a template template parameter | N4051 | 5 | |
[[fallthrough]] attribute |
P0188R1 | 7 | __has_cpp_attribute(fallthrough) |
[[nodiscard]] attribute |
P0189R1 | 4.8 ([[gnu::warn_unused_result]] )7 (P0189R1) |
__has_cpp_attribute(nodiscard) |
[[maybe_unused]] attribute |
P0212R1 | 4.8 ([[gnu::unused]] )7 (P0212R1) |
__has_cpp_attribute(maybe_unused) |
Extension to aggregate initialization | P0017R1 | 7 | __cpp_aggregate_bases >= 201603 |
Wording for constexpr lambda |
P0170R1 | 7 | __cpp_constexpr >= 201603 |
Unary Folds and Empty Parameter Packs | P0036R0 | 6 | __cpp_fold_expressions >= 201603 |
Generalizing the Range-Based For Loop | P0184R0 | 6 | __cpp_range_based_for >= 201603 |
Lambda capture of *this by Value |
P0018R3 | 7 | __cpp_capture_star_this >= 201603 |
Construction Rules for enum class variables |
P0138R2 | 7 | |
Hexadecimal floating literals for C++ | P0245R1 | 3.0 | __cpp_hex_float >= 201603 |
Dynamic memory allocation for over-aligned data | P0035R4 | 7 | __cpp_aligned_new >= 201606 |
Guaranteed copy elision | P0135R1 | 7 | __cpp_guaranteed_copy_elision >= 201606 |
Refining Expression Evaluation Order for Idiomatic C++ | P0145R3 | 7 | |
constexpr if |
P0292R2 | 7 | __cpp_if_constexpr >= 201606 |
Selection statements with initializer | P0305R1 | 7 | |
Template argument deduction for class templates | P0091R3 P0512R0 |
7 8 |
__cpp_deduction_guides >= 201606 __cpp_deduction_guides >= 201611 |
Declaring non-type template parameters with auto | P0127R2 | 7 | __cpp_template_auto >= 201606 __cpp_nontype_template_parameter_auto >= 201606 |
Using attribute namespaces without repetition | P0028R4 | 7 | |
Ignoring unsupported non-standard attributes | P0283R2 | Yes | |
Structured bindings | P0217R3 | 7 | __cpp_structured_bindings >= 201606 |
Remove Deprecated Use of the register Keyword |
P0001R1 | 7 | |
Remove Deprecated operator++(bool) |
P0002R1 | 7 | |
Make exception specifications be part of the type system | P0012R1 | 7 | __cpp_noexcept_function_type >= 201510 |
__has_include for C++17 |
P0061R1 | 5 | |
Rewording inheriting constructors (core issue 1941 et al) | P0136R1 | 7 | __cpp_inheriting_constructors >= 201511 |
Inline variables | P0386R2 | 7 | __cpp_inline_variables >= 201606 |
DR 150, Matching of template template arguments | P0522R0 | 7 | __cpp_template_template_args >= 201611 |
Removing dynamic exception specifications | P0003R5 | 7 | |
Pack expansions in using-declarations | P0195R2 | 7 | __cpp_variadic_using >= 201611 |
A byte type definition |
P0298R0 | 7 |
Technical Specifications
GCC also implements experimental support for some language Technical Specifications published by the C++ committee.
Important: Because these Technical Specifications are still evolving toward future inclusion in a C++ standard, GCC''s support is experimental. No attempt will be made to maintain backward compatibility with implementations of features that do not reflect the final standard.
Technical Specification | Document | Available in GCC? | Compiler Option | SD-6 Feature Test |
---|---|---|---|---|
Concepts | N4377 | 6 | -fconcepts | __cpp_concepts >= 201507 |
Transactional Memory | N4514 | 6 (no atomic_cancel) | -fgnu-tm | __cpp_transactional_memory >= 201505 |
Coroutines | N4649 | No | ||
Modules | N4720 | In progress |
C++14 Support in GCC
GCC has full support for the previous revision of the C++ standard, which was published in 2014.
This mode is the default in GCC 6.1 and above; it can be explicitly selected with the -std=c++14
command-line flag, or -std=gnu++14
to enable GNU extensions as well.
C++14 Language Features
The following table lists new language features that are part of the C++14 standard. The "Proposal" column provides a link to the ISO C++ committee proposal that describes the feature, while the "Available in GCC?" column indicates the first version of GCC that contains an implementation of this feature.
Language Feature | Proposal | Available in GCC? | SD-6 Feature Test |
---|---|---|---|
Tweak to certain C++ contextual conversions | N3323 | 4.9 | |
Binary literals | N3472 | 4.3 (GNU) 4.9 (N3472) |
__cpp_binary_literals >= 201304 |
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 >= 201304 |
Variable templates | N3651 | 5 | __cpp_variable_templates >= 201304 |
Relaxing requirements on constexpr functions | N3652 | 5 | __cpp_constexpr >= 201304 |
Member initializers and aggregates | N3653 | 5 | __cpp_aggregate_nsdmi >= 201304 |
Clarifying memory allocation | N3664 | N/A | |
Sized deallocation | N3778 | 5 | __cpp_sized_deallocation >= 201309 |
[[deprecated]] attribute | N3760 | 4.9 (N3797) | __has_cpp_attribute(deprecated) >= 201309 |
Single-quotation-mark as a digit separator | N3781 | 4.9 (N3797) | __cpp_digit_separator >= 201309 |
This feature was briefly part of the C++14 working paper, but was not part of the published standard; as a result, it has been removed from the compiler.
Language Feature | Proposal | Available in GCC? | SD-6 Feature Test |
---|---|---|---|
Runtime-sized arrays with automatic storage duration (Removed from the standard) |
N3639 | ?.? (GNU VLAs) 4.9 (N3639) 5 (GNU VLAs) |
__cpp_runtime_arrays >= 198712 |
C++11 Support in GCC
GCC 4.8.1 was the first feature-complete implementation of the 2011 C++ standard, previously known as C++0x.
This mode can be selected with the -std=c++11
command-line flag, or -std=gnu++11
to enable GNU extensions as well.
For information about C++11 support in a specific version of GCC, please see:
- GCC 4.3 C++0x Status
- GCC 4.4 C++0x Status
- GCC 4.5 C++0x Status
- GCC 4.6 C++0x Status
- GCC 4.7 C++11 Status
- GCC 4.8 C++11 Status
Language Feature | Proposal | Available in GCC? | SD-6 Feature Test |
---|---|---|---|
Rvalue references | N2118 | GCC 4.3 | __cpp_rvalue_references >= 200610 |
Rvalue references for *this |
N2439 | GCC 4.8.1 | __cpp_ref_qualifiers >= 200710 |
Initialization of class objects by rvalues | N1610 | Yes | |
Non-static data member initializers | N2756 | GCC 4.7 | __cpp_nsdmi >= 200809 |
Variadic templates | N2242 | GCC 4.3 | __cpp_variadic_templates >= 200704 |
Extending variadic template template parameters | N2555 | GCC 4.4 | |
Initializer lists | N2672 | GCC 4.4 | __cpp_initializer_lists >= 200806 |
Static assertions | N1720 | GCC 4.3 | __cpp_static_assert >= 200410 |
auto -typed variables |
N1984 | GCC 4.4 | |
Multi-declarator auto |
N1737 | GCC 4.4 | |
Removal of auto as a storage-class specifier | N2546 | GCC 4.4 | |
New function declarator syntax | N2541 | GCC 4.4 | |
New wording for C++0x lambdas | N2927 | GCC 4.5 | __cpp_lambdas >= 200907 |
Declared type of an expression | N2343 | GCC 4.3 | __cpp_decltype >= 200707 |
decltype and call expressions | N3276 | GCC 4.8.1 | |
Right angle brackets | N1757 | GCC 4.3 | |
Default template arguments for function templates | DR226 | GCC 4.3 | |
Solving the SFINAE problem for expressions | DR339 | GCC 4.4 | |
Template aliases | N2258 | GCC 4.7 | __cpp_alias_templates >= 200704 |
Extern templates | N1987 | Yes | |
Null pointer constant | N2431 | GCC 4.6 | |
Strongly-typed enums | N2347 | GCC 4.4 | |
Forward declarations for enums | N2764 | GCC 4.6 | |
Generalized attributes | N2761 | GCC 4.8 | __cpp_attributes >= 200809; __has_cpp_attribute(noreturn) >= 200809; __has_cpp_attribute(carries_dependency) == 0 (not implemented) |
Generalized constant expressions | N2235 | GCC 4.6 | __cpp_constexpr >= 200704 |
Alignment support | N2341 | GCC 4.8 | |
Delegating constructors | N1986 | GCC 4.7 | __cpp_delegating_constructors >= 200604 |
Inheriting constructors | N2540 | GCC 4.8 | __cpp_inheriting_constructors >= 200802 |
Explicit conversion operators | N2437 | GCC 4.5 | |
New character types | N2249 | GCC 4.4 | __cpp_unicode_characters >= 200704 |
Unicode string literals | N2442 | GCC 4.5 | __cpp_unicode_literals >= 200710 |
Raw string literals | N2442 | GCC 4.5 | __cpp_raw_strings >= 200710 |
Universal character name literals | N2170 | GCC 4.5 | |
User-defined literals | N2765 | GCC 4.7 | __cpp_user_defined_literals >= 200809 |
Standard Layout Types | N2342 | GCC 4.5 | |
Defaulted and deleted functions | N2346 | GCC 4.4 | |
Extended friend declarations | N1791 | GCC 4.7 | |
Extending sizeof |
N2253 | GCC 4.4 | |
Inline namespaces | N2535 | GCC 4.4 | |
Unrestricted unions | N2544 | GCC 4.6 | |
Local and unnamed types as template arguments | N2657 | GCC 4.5 | |
Range-based for | N2930 | GCC 4.6 | __cpp_range_based_for >= 200907 |
Explicit virtual overrides | N2928 N3206 N3272 |
GCC 4.7 | |
Minimal support for garbage collection and reachability-based leak detection | N2670 | No | |
Allowing move constructors to throw [noexcept] | N3050 | GCC 4.6 | |
Defining move special member functions | N3053 | GCC 4.6 | |
Concurrency | |||
Sequence points | N2239 | Yes | |
Atomic operations | N2427 | GCC 4.4 | |
Strong Compare and Exchange | N2748 | GCC 4.5 | |
Bidirectional Fences | N2752 | GCC 4.8 | |
Memory model | N2429 | GCC 4.8 | |
Data-dependency ordering: atomics and memory model | N2664 | GCC 4.4 (memory_order_consume) |
|
Propagating exceptions | N2179 | GCC 4.4 | |
Abandoning a process and at_quick_exit | N2440 | GCC 4.8 | |
Allow atomics use in signal handlers | N2547 | Yes | |
Thread-local storage | N2659 | GCC 4.8 | |
Dynamic initialization and destruction with concurrency | N2660 | GCC 4.3 | __cpp_threadsafe_static_init >= 200806 |
C99 Features in C++11 | |||
__func__ predefined identifier |
N2340 | GCC 4.3 | |
C99 preprocessor | N1653 | GCC 4.3 | |
long long |
N1811 | GCC 4.3 | |
Extended integral types | N1988 | Yes |
C++98 Support in GCC
GCC has full support for the 1998 C++ standard as modified by the 2003 technical corrigendum and some later defect reports, excluding the export
feature which was later removed from the language.
This mode is the default in GCC versions prior to 6.1; it can be explicitly selected with the -std=c++98
command-line flag, or -std=gnu++98
to enable GNU extensions as well.
Copyright (C) Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
These pages are maintained by the GCC team. Last modified 2019-02-07.
参考地址:https://gcc.gnu.org/projects/cxx-status.html
CentOS 7 x64 安装 gcc 和 gcc-c++
一、安装 gcc
yum install gcc # 安装gcc
二、输入【gcc -v】测试 gcc 安装是否成功
[root@localhost bin]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)
[root@localhost bin]#
三、安装 gcc-c++
yum install gcc-c++ # 安装g++
四、输入【g++ -v】测试 gcc-c++ 安装是否成功
[root@localhost bin]# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)
[root@localhost bin]#
CentOS 升级 gcc gcc-c++ 到 4.8 版本
1. 使用 redhat developer toolset 1.1 的 repo,安装 GCC
cd /etc/yum.repos.d
wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
yum --enablerepo=testing-devtools-2-centos-6 install devtoolset-2-gcc devtoolset-2-gcc-c++
2. 替换系统中原来的 GCC
通过通过第一步会把 GCC 安装到以下目录:
/opt/rh/devtoolset-2/root/usr/bin
接下来需要修改系统的配置,使默认的 gcc 和 g++ 命令使用的是新安装的版本。
ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/
hash -r
现在查看 g++ 的版本号:
#gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
已经从 4.4.7 升级到 4.8.2 了。
关于linux Gcc 4.4.7 snprintf莫名崩溃和linux程序崩溃的介绍现已完结,谢谢您的耐心阅读,如果想了解更多关于Arm 计划将 SLS 补丁反向移植到 GCC 10 和 GCC 9、C++ Standards Support in GCC - GCC 对 C++ 标准的支持、CentOS 7 x64 安装 gcc 和 gcc-c++、CentOS 升级 gcc gcc-c++ 到 4.8 版本的相关知识,请在本站寻找。
本文标签: