问题标签 [gcc-extensions]

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 回答
1976 浏览

c++ - Are variable length arrays there in c++?

I had always thought that variable length arrays were not allowed in c++(Refer :Why aren't variable-length arrays part of the C++ standard?) .But than why does this code compile and work?

0 投票
0 回答
57 浏览

c - 使用代码块作为右值 - 在 if()、for()、while() 内部?

我注意到gcc接受如下代码:

等等。
可以创建一个匿名代码块并将其视为右值(只要最后一条语句是变量/值)。

这在某些情况下很有用——我发现的特定用例是以这种方式从内联汇编语句返回值。但也可以使用它来转换函数返回void但通过指针参数修改内存,例如:

我一直在试图找到文档证明这是 *normal8 / C标准允许这种事情,穷人的 lambda

谁能提供详细信息?

0 投票
1 回答
789 浏览

c++ - 在 G++ 4.8 中,typeof 仍然不能与 "::" 一起使用

以下代码在 G++ 4.8 下无法编译

如果我将 typeof 替换为 decltype,它可以正常工作。我知道使用模板结构的解决方法

接着

但仍然很烦人。

这是一个应该报告的错误吗?或者这是一个功能?

0 投票
2 回答
1002 浏览

c++ - 如何在 Microsoft Visual Studio 中使用 Arduino(由于#include_next 预编译器问题)

简而言之,

我需要这样做,

但是 Visual Studio 不喜欢这样并抱怨,

我不能简单地做

文件太多了!!

有什么解决办法吗??

0 投票
2 回答
1457 浏览

c - Rewrite GCC cleanup macro with nested function for Clang?

I'm trying to work through an issue on a third party library. The issue is the library uses GCC's nested functions buried in a macro, and Clang does not support nested functions and has no plans to do so (cf., Clang Bug 6378 - error: illegal storage class on function).

Here's the macro that's the pain point for me and Clang:

And here's how its used (from the code comments):

The Clang User Manual states to use C++ and a lambda function to emulate. I'm not sure that's the best strategy, and a C project will likely not accept a C++ patch (they would probably tar and feather me first).

Is there a way to rewrite the macro so that's its (1) more accommodating to Clang, and (2) preserves original function semantics?

0 投票
2 回答
60 浏览

c - 无法理解以下函数声明

任何人都可以解释以下函数声明。

0 投票
2 回答
473 浏览

c++ - 简单的 c++ 程序出现编译错误

当我尝试编译此代码时,它显示错误:

这是文件:

$是 的简单名称DEBUG,在运行时它是0or 1

编译错误是针对这个源文件的。如何摆脱这个并编译?

0 投票
1 回答
6522 浏览

c - C中的“[0 ... 255] =”语法是什么?

参考js0n.c

代码语法如下:

谁能解释这里正在做什么?语法[0 ... 255]&&l_bad在这里做什么?

0 投票
2 回答
2921 浏览

c - ASM Inline 调用 C 外部函数

我正在尝试通过与分支内联的 asm 调用 c 中的外部函数。我正在编译为 arm m0 指令集,但它返回错误的表达式。

代码是:

回报是:

我们需要做什么?

0 投票
0 回答
97 浏览

c - GCC 的语句表达式——他们采用 C 标准的历史是什么?

使用gcc,以下是有效的 C 语句:

这相当于

编辑:这是我的(希望能提供更多信息)问题:

  • 是否请求 ISO C 标准委员会/机构将这些作为 C 标准的一部分?
  • 如果是,是在 C99 之前吗?在 C11 之前?之后?
  • 给出或建议不将其作为语言的一部分的原因是什么?
  • 使用这个我不知道的构造是否有一些大的陷阱或缺点?