问题标签 [gcc4.6]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
16527 浏览

c++ - 你能混合使用同一个编译器的不同版本编译的c++吗

例如,我可以混合使用 GCC-4.6 和 GCC-4.9 编译的一组库。

我知道不同的编译器“品种”(例如 VS)不能与 MinGW 一起使用,但不同代的同一编译器可以吗?有可能出现问题吗?如果是这样呢?

0 投票
2 回答
197 浏览

c++ - C++ reliance on argument to const reference not changing

Please consider the following code:

Compiled with g++ 4.6 with -O3, I can see that the compiled re-reads the value of "a" between the function calls. Changing a's definition to "const int", the compiler doesn't do that, and instead simply loads immediate value "12" into edi. The same is true if a is not const, but I change func1's signature to accept by value.

While not a bug in the code generation, this is still weird behavior. Being as it is that func1 made a commitment not to change a, why should the compiler's code change based on whether a is const or not?

Edit: Some skeptics claim that I might be reading the code wrong. The above code produces the following with -S compilation:

Changing a to const produces:

0 投票
2 回答
92 浏览

c - (C99)在不同的宏中展开宏

我的程序中有一个函数,它需要 3 个参数。有时在代码中有一个宏定义了其中的 2 个参数。

所以这:

可以这样调用:

现在,我需要更改我的代码,以便像调用另一个函数的宏一样调用该函数。

如果 X 和 Y 真的作为变量传递,这很好用。有没有办法让它也适用于宏 PAR?

我正在使用 GCC 4.6

0 投票
2 回答
1066 浏览

debian - libgcc1 依赖 gcc-5-base 但它不可安装

我正在尝试通过使用在 Debian 7.8 上安装 fbi apt-get install fbi,但我收到包含以下内容的错误消息:

实际上,每当我尝试使用apt-get.

此错误消息背后的原因可能是什么?

提前致谢, 阿纳斯

0 投票
1 回答
2046 浏览

linux - Unable to locate package gcc-4.6-base:i386

I'm having trouble with running a script to install prerequisite packages, which requires gcc-4.6-base:i386, and don't know how to install it with aptitude or something similar. For reference, I'm currently running Ubuntu 5.4.0-6ubuntu1~16.04.2. The error messages I'm getting are:

It looks like the binary package can be found here. Furthermore, I've tried this out but to no avail. I've also done multiple rounds of sudo apt-get update and sudo apt-get install. For reference, this is an Ardupilot project and I'm following along here, getting stuck on running the script Tools/scripts/install-prereqs-ubuntu.sh -y.

Any and all help appreciated, and I'd be happy to provide more info if need be. Thanks!

0 投票
4 回答
360 浏览

c++ - 如果参数具有成员变量,则专门化函数

我有一个模板化的错误报告功能,因为它可以报告许多不同消息类的错误:

但是,某些类型的消息具有可以报告的更详细的错误或其他专门的错误报告,例如

由于有许多类型,例如SpecificMsg,我宁愿不为每种类型创建单独的模板特化。是否可以为任何具有.details成员变量的类型创建通用专业化/部分专业化?

如果可能的话,我希望有一种方法可以做到这一点(如果它有一个专业化,如果它有.details一个不同的专业化.other_info,等等)。

编辑:这是明确询问功能。我见过做类似事情来专门化模板的代码,但我从来没有遇到过可以为非成员函数做我想做的事情。我怀疑将用于类的方法转换为用于函数的方法并不难,但我无法弄清楚如何去做。

编辑 2:我的 gcc (4.6.3) 版本似乎不支持完整的 C++11 标准,因此void_t“重复”问题中提到的选项对我不起作用。我的编译器抱怨“'type'之前的预期嵌套名称说明符”等,甚至不让我定义void_t。因此,我从我的问题中删除了 C++11 标签。

0 投票
1 回答
48 浏览

llvm - macos10.14上如何搭建LLVM Dragonegg?

看了《LLVM Core Libraries入门》这本书,跟着书走,我想在我的mac上搭建一个dragonegg-3.3,所以我下载dragonegg-3.3源代码表格' http://llvm.org/releases/ 3.3/dragonegg-3.3.src.tar.gz ',然后我在书中构建dragonegg-3.3使用命令

但是我的mac没有gcc-4.6,现在macos10.14上也安装不了gcc-4.6!,看来gcc-4.6是老版本的gcc,不适合现在的macos10.14。

在macos10.14上构建或安装dragonegg应该怎么做,非常感谢!