#pragma GCC system_header有什么用

GCC系统头文件标记解析

看c++ std::string 的源码,发现有#pragma GCC system_header这个,不知道什么意思,去google了一下,发现意思如下,以后自己代码中还是不要用这个.

从#pragma GCC system_header直到文件结束之间的代码会被编译器视为系统头文件之中的代码. 系统头文件中的代码往往不能完全遵循C标准, 所以头文件之中的警告信息往往不显示. (除非用 #warning显式指明). 

// <bits/erase_if.h> -*- C++ -*- // Copyright (C) 2015-2023 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. /** @file bits/erase_if.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. */ #ifndef _GLIBCXX_ERASE_IF_H #define _GLIBCXX_ERASE_IF_H 1 #pragma GCC system_header #if __cplusplus >= 201402L #include <bits/c++config.h> namespace std { _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cplusplus > 201703L #define __cpp_lib_erase_if 202002L #endif namespace __detail { template <typename _Container, typename _UnsafeContainer, typename _Predicate> typename _Container::size_type __erase_nodes_if(_Container &__cont, _UnsafeContainer &__ucont, _Predicate __pred) { typename _Container::size_type __num = 0; for (auto __iter = __ucont.begin(), __last = __ucont.end(); __iter != __last;) { if (__pred(*__iter)) { __iter = __cont.erase(__iter); ++__num; } else ++__iter; } return __num; } } // namespace __detail _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif // C++14 #endif // _GLIBCXX_ERASE_IF_H
08-27
class "NXOpen::CAM::OrientGeometry"没有成员 "CoordinateSystem“#ifndef NXOpen_CAM_ORIENTGEOMETRY_HXX_INCLUDED #define NXOpen_CAM_ORIENTGEOMETRY_HXX_INCLUDED //-------------------------------------------------------------------------- // Copyright 2024 Siemens //-------------------------------------------------------------------------- // Header for C++ interface to JA API //-------------------------------------------------------------------------- // // Source File: // CAM_OrientGeometry.ja // // Generated by: // apiwrap // // WARNING: // This file is automatically generated - do not edit by hand // #ifdef _MSC_VER #pragma once #endif #include <NXOpen/NXDeprecation.hxx> #include <vector> #include <NXOpen/NXString.hxx> #include <NXOpen/Callback.hxx> #include <NXOpen/CAM_NCGroup.hxx> #include <NXOpen/libnxopencpp_cam_exports.hxx> #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4996) #endif #ifdef __GNUC__ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif namespace NXOpen { namespace CAM { class OrientGeometry; } namespace CAM { class NCGroup; } namespace CAM { class _OrientGeometryBuilder; class OrientGeometryImpl; /** Represents a Orient Group <br> To create or edit an instance of this class, use @link NXOpen::CAM::OrientGeomBuilder NXOpen::CAM::OrientGeomBuilder @endlink <br> <br> Created in NX7.5.0. <br> */ class NXOPENCPP_CAMEXPORT OrientGeometry : public NXOpen::CAM::NCGroup { private: OrientGeometryImpl * m_orientgeometry_impl; private: friend class _OrientGeometryBuilder; protected: OrientGeometry(); public: ~OrientGeometry(); }; } } #ifdef _MSC_VER #pragma warning(pop) #endif #ifdef __GNUC__ #ifndef NX_NO_GCC_DEPRECATION_WARNINGS #pragma GCC diagnostic warning "-Wdeprecated-declarations" #endif #endif #undef EXPORTLIBRARY #endif ”
最新发布
10-23
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值