error: jump to label ‘XXXX’ [-fpermissive]
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]的更多相关文章
- HTTP Status 500 - Error instantiating servlet class XXXX
问题描述 web项目中请求出现错误,如下: HTTP Status 500 - Error instantiating servlet class XXXX类 type Exception rep ...
- 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 ...
- 【原】“Error getting 'android:label' attribute”
项目上线过程中遇到“Error getting 'android:label' attribute: attribute is not a string value”这个错误. 备忘下:是因为有act ...
- Error: [ng:areq] Argument 'xxxx' is not a function, got undefined
"Error: [ng:areq] Argument 'keywords' is not a function, got undefined" 代码类似这样的: <div n ...
- FDO error:Failed to label layer(XXX) for class Default
描述: A column was specified that does not exist. 出现这个问题的原因在于label features 展示的字段不存在或者为空,只要将其勾选去掉或者换个显 ...
- g++ error: extra qualification on member [-fpermissive]
以下这段代码是在头文件里面的,DmaOpen DmaClose函数也是直接在class pcie_chip{}里面的.加了个额外的pcie_chip::才会报错. //delete pcie_chip ...
- Xcode error: conflicting types for 'XXXX'
问题描述:在main方法中调用了一个写在main方法后面的方法,比如: void main(){ A(); } void A(){} Xcode编译后就报错:conflicting types for ...
- ERROR getting 'android:label' attribute: attribute is not a string value
这个的原因很多地方都有描述,原因多半是多国语言string.xml 有的有这个值, 有的没有. 关键是怎么定位? 实际上他报错的是当前处理的xml element有问题, 而出错的时候盖住了要处理的. ...
- windows c++ 程序移植到Linux的一些要点
这段时间得到一份源码,是Windows下的,调试了一把,可以正常运行,可是没有Linux版本,而实际的应用场景是要在Linux服务器上面运行 所以涉及到Windows下c++程序的移植,有同事竭力推荐 ...
随机推荐
- 【JUnit 报错】java.lang.NoClassDefFoundError: org/apache/logging/log4j/message/Message
使用JUnit的时候,报错:java.lang.NoClassDefFoundError: org/apache/logging/log4j/message/Message 原因是因为项目中导入的架包 ...
- org.apache.flume.FlumeException: NettyAvroRpcClient { host: xxx.xxx.xxx.xxx, port: 41100 }: RPC
2014-12-19 01:05:42,141 (lifecycleSupervisor-1-1) [WARN - org.apache.flume.sink.AbstractRpcSink.star ...
- poj 1611 The Suspects 并查集
The Suspects Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 30522 Accepted: 14836 De ...
- include、include_once与require、require_once区别
include与require的区别 include在引入不存文件时产生一个警告且脚本还会继续执行,而require则会导致一个致命性错误且脚本停止执行. <?php include 'no.p ...
- HTML-Canvas03
颜色合成 globalCompositeOperation 属性: //先绘制一个图形. ctx.fillStyle = "#00ff00"; ctx.fillRect(10,10 ...
- http://blog.csdn.net/jiazimo/article/details/17265061
http://blog.csdn.net/jiazimo/article/details/17265061
- DP(优化) UVALive 6073 Math Magic
/************************************************ * Author :Running_Time * Created Time :2015/10/28 ...
- WPF之TextBox
1. TextBox实现文字垂直居中 TextBox纵向长度比较长但文字字体比较小的时候,在输入时就会发现文字不是垂直居中的. 而使用中我们发现,TextBox虽然可以设置文字的水平对齐方式,但却没有 ...
- BZOJ2584 : [Wc2012]memory
xy方向分开考虑 用扫描线处理出拓扑序,第二问直接回答拓扑序, 第一问: 将操作倒过来,变成加入线段,用线段树维护区间拓扑序的最值 #include<cstdio> #include< ...
- 20145325张梓靖 实验三 "敏捷开发与XP实践"
20145325张梓靖 实验三 "敏捷开发与XP实践" 程序设计过程 实验内容 使用 git 上传代码 git上传中遇到的问题 使用 git 相互更改代码 实现代码的重构 git ...