当前位置: 首页 > news >正文

大连做公司网站的公司wordpress页面链接如何修改

大连做公司网站的公司,wordpress页面链接如何修改,分发平台,网站建设做网站可以吗这个是今天在微信群里讨论的一个问题#xff0c;先看图片点击查看大图代码流程大概是这个样子的点击查看大图查看 length 和 space1 的值#xff0c;明显看到 length 小于 space1 的值#xff0c;即使是这样小白都能搞懂流程的情况下#xff0c;代码还是跑到else里面区执行… 这个是今天在微信群里讨论的一个问题先看图片点击查看大图代码流程大概是这个样子的点击查看大图查看 length 和 space1 的值明显看到 length 小于 space1 的值即使是这样小白都能搞懂流程的情况下代码还是跑到else里面区执行调试查看数据然后 我们就在群里讨论有的大神说这个是内存越界也有大神说可能是人品有问题也有大神说这个是因为写代码前没有选好一个良辰吉日反正大家想法都非常多也非常古怪这可能就是讨论群存在的一个原因了。经过不断的验证发现这个问题是因为编译器优化的问题。如果在设置里面把优化选项去掉代码就执行正确编译器对代码优化当然还有一个问题就是如果我想开启优化毕竟代码太大占用的存储空间是很大的如果能节省点空间是最好的了。所以就出现了一种只针对某些代码不优化的设置像这样我们使用GCC编译的时候也是有可能因为代码优化导致这样的问题的庆幸的是GCC也有设置不进行优化的开关。#使用GCC编译器设置选择性不优化某段代码#pragma GCC push_options #pragma GCC optimize (O0) #pragma GCC pop_options push 的意思是把当前的编译优化选项压栈然后再设置当前的优化选项之后再出栈把之前压栈的选项提取出来。具体可以参考链接https://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Function-Specific-Option-Pragmas.html链接里面还介绍了一些其他的用法原文如下5.52.12 Function Specific Option Pragmas #pragma GCC target (string...) This pragma allows you to set target specific options for functions defined later in the source file. One or more strings can be specified. Each function that is defined after this point will be as if attribute((target(STRING))) was specified for that function. The parenthesis around the options is optional. See Function Attributes, for more information about the target attribute and the attribute syntax. The #pragma GCC target pragma is not implemented in GCC versions earlier than 4.4, and is currently only implemented for the 386 and x86_64 backends.#pragma GCC optimize (string...) This pragma allows you to set global optimization options for functions defined later in the source file. One or more strings can be specified. Each function that is defined after this point will be as if attribute((optimize(STRING))) was specified for that function. The parenthesis around the options is optional. See Function Attributes, for more information about the optimize attribute and the attribute syntax. The #pragma GCC optimize pragma is not implemented in GCC versions earlier than 4.4.#pragma GCC push_options #pragma GCC pop_options These pragmas maintain a stack of the current target and optimization options. It is intended for include files where you temporarily want to switch to using a different #pragma GCC target or #pragma GCC optimize and then to pop back to the previous options. The #pragma GCC push_options and #pragma GCC pop_options pragmas are not implemented in GCC versions earlier than 4.4.#pragma GCC reset_options This pragma clears the current #pragma GCC target and #pragma GCC optimize to use the default switches as specified on the command line. The #pragma GCC reset_options pragma is not implemented in GCC versions earlier than 4.4. #当然还有指定某个函数设置优化等级int max(int a, int b) __attribute__((optimize(O0))); {return a  b ? a : b; } #使用volatile 关键字避免编译器优化volatile 的作用是提醒CPU如果遇到被volatile 修饰的变量要从内存里面去取值而不要偷懒直接从缓存里面取值我们一般是用在那些被中断处理函数使用的那些变量。如果有些代码你不希望CPU偷懒那你就可以加上volatile 让CPU从内存取数据。CSDN上有这样一个例子https://blog.csdn.net/qq_28637193/article/details/88988951今天碰到一个gcc优化相关的问题为了让一个页变成脏页页表中dirty位被置上需要执行下面这段代码1 uint32_t *page; 2 // ... 3 page[0]  page[0]; 最后一行代码很有可能被gcc优化掉因为这段代码看起来没有任何实际的作用。那么如何防止gcc对这段代码做优化呢设置gcc编译时优化级别为-O0肯定是不合适的这样对程序性能影响会比较大。stackoverflow上的Dietrich Epp给出了一个强制类型转换的方案((unsigned char volatile *)page)[0]  page[0]; 通过volatile关键字禁止gcc的优化#总结、什么情况会导致这样的问题1、堆栈溢出应该是一个原因之前我有遇到的情况是栈空间设置太小然后溢出到堆空间导致问题。2、使用某个函数导致溢出我们使用的函数比如内存拷贝函数如果长度设置不对也会导致影响到其他的代码。3、还有就是上面说的编译器优化导致的问题。评论说说你在开发过程总遇到过哪些奇葩的问题又是如何解决的呢#推荐阅读    专辑|Linux文章汇总    专辑|程序人生    专辑|C语言嵌入式Linux微信扫描二维码关注我的公众号
http://www.pierceye.com/news/340266/

相关文章:

  • 互联网建设网站的的好处中国建盏大师排名2021
  • 商城网站建设新闻制作一个网站需要多久
  • 为什么要创建网站子目录泰安网信科技
  • 住房和城乡建设部网站质保金企业手机网站建设效果
  • 网站建设制作鸿运通邯郸网络运营中心电话号码
  • 辽阳企业网站建设价格中国交通建设股份有限公司官网
  • 企业网站域名后缀手机网站设计规格
  • 网页制作成品模板网站中国兰州网首页
  • 企业展示型网站php批量外链工具
  • 网站公司做网站dede查看网站
  • 网站软件大全免费下品牌网站策划
  • 网站解析密码网站被收录后又被提出了
  • 图片外链上传网站美篇app怎么制作
  • h5自适应网站建设是什么意思保险官网
  • 建设网站的时候名师工作室建设网站
  • 网页开发网站宜昌网站seo
  • 网站做国际化网站服务器及运营维护公告
  • 潍坊网站开发招聘信息只做乡村旅游的网站
  • 什么网站可以做二建的题目汕尾网站网站建设
  • 如何用wampp 做网站网店seo
  • 新乡企业网站建设公司长安网站建设多少钱
  • 九亭镇村镇建设办官方网站工作简历模板电子版免费
  • 有保障的无锡网站制作wordpress怎么映射到外网访问不了
  • 邯郸网站设计怎么做移动网站 用户体验
  • 实验报告网站建设与网页制作oa系统是什么
  • 信息发布网站开发模板提高网站响应速度
  • 本科网站开发毕业设计贵阳平台网站建设
  • 安徽省建设厅网站打不开杭州建设网 执法人员名单
  • 外贸网站建站公司如何做滴滴网站平台
  • 淄博张店做网站的公司建筑设计公司资质等级