gcc-extensions

    -1热度

    2回答

    鉴于这种代码: using vec = uint32_t __attribute__ ((vector_size (16))); 怎样才可以改写MSVC 2015年?

    2热度

    2回答

    我正在使用一个很好的GCC扩展,它允许我们在结构中声明VLA。现在我发现了一种通过这种方式将VLA传递给函数的方法(通过值)。我也找到了一种方法来回报一个,但在一个非常有限的情况下。 本实施例的功能码是这样的: extern void func3() { size_t size; scanf("%zu", &size); struct tx{int _[size

    4热度

    1回答

    我一直认为变长数组在C++中是不允许的(请参阅:Why aren't variable-length arrays part of the C++ standard?)。但是为什么这段代码编译和工作? #include <iostream> using namespace std; int main() { int n; cin >> n; int a[n]

    1热度

    1回答

    下面的代码并不G正下方++编译4.8 #include <vector> using namespace std; int main() { vector<int> v; typeof(v)::iterator it; } 如果我更换的typeof到decltype使用,它工作正常。我知道有一个模板结构 template<class T> struct Self {

    1热度

    2回答

    我尝试codefights.com,发现某人的答案,其中涉及给予所有最长字符串矢量做到这一点的一个问题: std::vector<std::string> r, allLongestStrings(std::vector<std::string> a) { int b=0; for (s:a) if (s.size()>b) b=s.size(); for (s:a)

    0热度

    1回答

    我不确定如何找出要支持的任何给定属性需要哪种版本的ARM编译器(armcc)。 例如__atribute__((noinline))? 见 http://www.keil.com/support/man/docs/armcc/armcc_chr1359124975804.htm

    7热度

    2回答

    在我的C语言实践中,我面临着一个表达式,然后我把它简化为: int a=({10;}); 这是一个合法的表达,因为它得到过去的gcc编译器。 请关注此零件:({10;})。有人能解释吗?越详细越好。谢谢!

    0热度

    2回答

    我想通过asm内联一个分支来调用c中的外部函数。我正在编译为arm m0指令集,但它返回的是错误的表达式。 的代码是: __asm volatile ( " cmp r3,#0 \n" " b %[my_function] \n" //Call function " bx r14 \n" : //

    0热度

    1回答

    我想知道它是否可能在代码块中使用gcc扩展,如typeof在Windows环境中。 以下代码仅用于展示我想如何使用typeof。 #include <stdio.h> #include <stdlib.h> #define SWAP(x, y) do { typeof(x) temp##x##y = x; x = y; y = temp##x##y; } while (0) typedef

    1热度

    1回答

    标准不允许指针void *和指针之间转换为功能: 6.3.2.3:8一个指针,指向一个类型的函数可被转换成一个指针到另一个类型的函数再回来;结果应该等于原始指针 。如果使用转换的指针 调用类型与指向的 类型不兼容的函数,则行为未定义。 有在油嘴/ GTK几个功能打破该规则,作为一个例子g_signal_handlers_block_by_func 一个典型的例子转换在GtkEntry为大写: vo