博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用strings命令时需要小心gcc/g++的优化选项
阅读量:4142 次
发布时间:2019-05-25

本文共 527 字,大约阅读时间需要 1 分钟。

      看程序:

#include 
using namespace std;int main(){ char szTest[] = "abcxxx"; printf("defxxx\n"); return 0;}
     看g++和stings:

taoge@localhost Desktop> g++ test.cpp &&  strings a.out | grep abcabcxxxtaoge@localhost Desktop> g++ test.cpp &&  strings a.out | grep defdefxxxtaoge@localhost Desktop> g++ test.cpp -O2 &&  strings a.out | grep abctaoge@localhost Desktop> g++ test.cpp -O2 &&  strings a.out | grep defdefxxxtaoge@localhost Desktop>
    

     所以, 如果我们要对程序加入“印记”, 最好是用log形式(如printf), 而不是用char szTest[]方式。 总之, 是为了方便用strings准确鉴别出改动。

转载地址:http://hzwti.baihongyu.com/

你可能感兴趣的文章
不要丧呀&&POJ 2362 && [剪枝]&&[dfs]
查看>>
HDU - 1213有意思的并查集/"掌门"
查看>>
HYSBZ - 1012 最大数maxnumber
查看>>
CodeForces - 939 A B签到题特训(...
查看>>
S失败者的典型-UVA1587
查看>>
cf919的ABC(太咸nowatashi)
查看>>
ASCII Area UVA - 1641 WA原因总结(没有脑子
查看>>
vjudge新手常见错误(误)和好习惯18.2.23
查看>>
UVA455水题目字符串(最长相等emm)
查看>>
UVA11346带图
查看>>
UVA10059暴力初步
查看>>
The Dole Queue UVA - 133(依次抓走做夫妻肺片)
查看>>
UVA10976摸鱼的暴力枚举初步.....
查看>>
UVA514 Rails 栈初步..
查看>>
UA489 变态啊= -Hangman Judge 刽子手
查看>>
第一周天梯赛(??) hdu1401坑爹的生日&&ac me 26个英文字母
查看>>
HDU1408 盐水的故事
查看>>
Codeforces #467 (Div. 2) B. Vile Grasshoppers 蚂蚱的题目
查看>>
CF934a 孩子和灯笼!
查看>>
CCCC周六/水仙花数/hdu1408,完数/
查看>>