gpt4 book ai didi

在 glibc 中找不到 iso646.h

转载 作者:太空宇宙 更新时间:2023-11-04 05:08:58 25 4
gpt4 key购买 nike

我下载了多个版本的 glibc,即 2.18、2.19、2.20、2.23,我试图找到文件 iso646.h 但找不到。我认为它是 glibc 的标准部分,所以它应该在那里。有谁知道为什么它不存在?

但是,我在本地机器的/usr/lib/gcc 目录中找到了它。所以我假设它是用 gcc 安装的。但我仍然不知道为什么我在 glibc 源代码中找不到它。我正在粘贴我在下面找到的内容:

/* Copyright (C) 1997-2014 Free Software Foundation, Inc.

This file is part of GCC.

GCC 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.

GCC 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/>. */

/*
* ISO C Standard: 7.9 Alternative spellings <iso646.h>
*/

#ifndef _ISO646_H
#define _ISO646_H

#ifndef __cplusplus
#define and &&
#define and_eq &=
#define bitand &
#define bitor |
#define compl ~
#define not !
#define not_eq !=
#define or ||
#define or_eq |=
#define xor ^
#define xor_eq ^=
#endif

#endif

编辑: 我在(从 gnu.org)下载的每个 glibc 源中找到的唯一文件(有点像 iso646.h)是 conform/data/iso646.h-data 看起来像这样:

#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4
macro and
macro and_eq
macro bitand
macro bitor
macro compl
macro not
macro not_eq
macro or
macro or_eq
macro xor
macro xor_eq

#if !defined ISO && !defined ISO99 && !defined ISO11
allow *_t
#endif
#endif

但是因为我不知道macro 在这里是如何定义的,或者它是在哪里定义的,所以这个文件对我来说是不可理解的。

最佳答案

该文件不是 libc 的一部分,而是编译器。

https://gcc.gnu.org/onlinedocs/gccint/Headers.html

$ find /|grep iso646.h
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/iso646.h
/usr/lib/gcc/x86_64-linux-gnu/4.6/include/iso646.h

关于在 glibc 中找不到 iso646.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37385899/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com