http://www.cnblogs.com/foohack/p/4090124.html

下面的类似的源码在MSVC上能正确编译通过。但是gcc/g++上就会错:

1. if(expr)
2. goto error;

3. size_t var = 0;

4.error:
5 error_handle();

4:1: error: jump to label ‘error’ [-fpermissive]
2:35: error: from here [-fpermissive]

3:9: error: crosses initialization of ‘size_t var’

解决以上问题就是要么所有变量初始化都放在函数开头,要么所有变量就不让它初始化,写成这样:

size_t var;

var = 0;

这样错误就解决了。

reference:

http://tieba.baidu.com/p/3319980115?pid=58076852390&cid=#58076852390

error: jump to label ‘XXXX’ [-fpermissive]的更多相关文章

  1. HTTP Status 500 - Error instantiating servlet class XXXX

    问题描述 web项目中请求出现错误,如下:  HTTP Status 500 - Error instantiating servlet class XXXX类  type Exception rep ...

  2. org.springframework.beans.factory.BeanCreationException: Could not autowire field org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.xxxx.service.sys.impl.ProcEn

    七月 01, 2019 4:34:20 下午 org.apache.catalina.core.StandardContext listenerStart .....org.springframewo ...

  3. 【原】“Error getting 'android:label' attribute”

    项目上线过程中遇到“Error getting 'android:label' attribute: attribute is not a string value”这个错误. 备忘下:是因为有act ...

  4. Error: [ng:areq] Argument 'xxxx' is not a function, got undefined

    "Error: [ng:areq] Argument 'keywords' is not a function, got undefined" 代码类似这样的: <div n ...

  5. FDO error:Failed to label layer(XXX) for class Default

    描述: A column was specified that does not exist. 出现这个问题的原因在于label features 展示的字段不存在或者为空,只要将其勾选去掉或者换个显 ...

  6. g++ error: extra qualification on member [-fpermissive]

    以下这段代码是在头文件里面的,DmaOpen DmaClose函数也是直接在class pcie_chip{}里面的.加了个额外的pcie_chip::才会报错. //delete pcie_chip ...

  7. Xcode error: conflicting types for 'XXXX'

    问题描述:在main方法中调用了一个写在main方法后面的方法,比如: void main(){ A(); } void A(){} Xcode编译后就报错:conflicting types for ...

  8. ERROR getting 'android:label' attribute: attribute is not a string value

    这个的原因很多地方都有描述,原因多半是多国语言string.xml 有的有这个值, 有的没有. 关键是怎么定位? 实际上他报错的是当前处理的xml element有问题, 而出错的时候盖住了要处理的. ...

  9. windows c++ 程序移植到Linux的一些要点

    这段时间得到一份源码,是Windows下的,调试了一把,可以正常运行,可是没有Linux版本,而实际的应用场景是要在Linux服务器上面运行 所以涉及到Windows下c++程序的移植,有同事竭力推荐 ...

随机推荐

  1. [saiku] 在 Tomcat 下部署 saiku

    上一篇介绍了如何配置免登录[免登录进入管理台] 本文主要是一步一步解释如何在Tomcat下部署saiku,为了让你更好更快的使用. 开始之前,假设你已经比较熟悉数据集市数据库,以及如何建立Mondri ...

  2. eclispe报错PermGen space

    最近使用eclipse做开发,使用的服务器是tomcat,但在启动时报了Caused by: java.lang.OutOfMemoryError: PermGen space的异常. 这个错误很常见 ...

  3. subList和asList

    subList subList返回仅仅只是一个视图.直接上源码 public List<E> subList(int fromIndex, int toIndex) { subListRa ...

  4. BZOJ3838 : [Pa2013]Raper

    将选取的$A$看成左括号,$B$看成右括号,那么答案是一个合法的括号序列. 那么只要重复取出$k$对价值最小的左右括号,保证每时每刻都是一个合法的括号序列即可. 将$($看成$1$,$)$看成$-1$ ...

  5. linux gdb 没有符号表被读取。请使用 "file" 命令。

    使用gdb时遇到这个问题,刚开始接触linux下使用gdb调试程序,其原因是生成的二进制可执行文件没有使用-g选项. gcc中-g选项是为了获得有关调试信息,要用gdb进行调试,必须使用-g生成二进制 ...

  6. ashx 集成于Ihandle 简易 高性能 web

    不用搞MV4..如果你用.ashx写的后台..自己加一个switch case就实现了路由...更方便,还不用配置   scaffold 不是dynamic data里面的东西吗   现在我全是ash ...

  7. iOS开发中代理使用出现的问题解决

    在给自定义的LHQTabBar设置代理的时候,定义的代理的属性的时候此时会报一个警告 我们需要遵守UITabBarDelegate的协议才行, 不过此时还有警告,警告已经变成了 此时我们需要在.m文件 ...

  8. FlyCapture2 VS2010 Configuration

    Add in the system Path: C:\Program Files (x86)\Point Grey Research\FlyCapture2\bin Project->Proje ...

  9. 9.0 alpha 版安装出现 could not execute command lessc 的问题

    解决方案: apt-get install node-less

  10. 获取当前 Windows 的安装序列号

    Dim s s = InputBox("当前Windows系统序列号为:", "Windows序列号", GetWindowsSN) WScript.Quit ...