2024年C C++最全VxWorks中tornado2(1),2024年最新算法真题解析:美团+Tencent+字节跳动+阿里+360+拼多多

img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上C C++开发知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

如果你需要这些资料,可以戳这里获取

GCC 2.96

October 6th, 2000

It has come to our attention that some GNU/Linux distributions are currently shipping with ``GCC 2.96’'.

We would like to point out that GCC 2.96 is not a formal GCC release nor will there ever be such a release. Rather, GCC 2.96 has been the code- name for our development branch that will eventually become GCC 3.0.

Current snapshots of GCC, and any version labeled 2.96, produce object files that are not compatible with those produced by either GCC 2.95.2 or the forthcoming GCC 3.0. Therefore, programs built with these snapshots will not be compatible with any official GCC release. Actually, C and Fortran code will probably be compatible, but code in other languages, most notably C++ due to incompatibilities in symbol encoding (``mangling’'), the standard library and the application binary interface (ABI), is likely to fail in some way. Static linking against C++ libraries may make a binary more portable, at the cost of increasing file size and memory use.

To avoid any confusion, we have bumped the version of our current development branch to GCC 2.97.

Please note that both GCC 2.96 and 2.97 are development versions; we do not recommend using them for production purposes. Binaries built using any version of GCC 2.96 or 2.97 will not be portable to systems based on one of our regular releases.

If you encounter a bug in a compiler labeled 2.96, we suggest you contact whoever supplied the compiler as we can not support 2.96 versions that were not issued by the GCC team.

Please see https://gcc.gnu.org/snapshots.html if you want to use our latest snapshots. We suggest you use 2.95.2 if you are uncertain.


重点在这句话**Actually, C and Fortran code will probably be compatible, but code in other languages, most notably C++ due to incompatibilities in symbol encoding (``mangling’’), the standard library and the application binary interface (ABI), is likely to fail in some way.**


所以在VxWorks5.5上还是乖乖用C语言吧,就别想着用C++了,等下出了问题都不知道是哪里出了问题。


那gcc2.6应该是支持C89/C90的,但是是否支持C99呢?


默认的编译命令参数为



-g -mpentium -ansi -fno-builtin -fno-defer-pop -I. -IC:/Tornado2.2/target/h/ -DCPU=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu


当我们将 -ansi 改成 -std = c99 时,会报错,如下图所示


![image-20210704115815517](https://img-blog.csdnimg.cn/img_convert/b59f7d9527f84830902c32a096fae09a.png)


当我们将 -ansi 改成 -std = c89 时,不会报错,可以正常编译,如下图所示


![image-20210704120100791](https://img-blog.csdnimg.cn/img_convert/961dacc8637c39738e65a5db54694ecc.png)


通过上面我们可以看出,该编译器只支持C89标准的。


其实我们还可以通过一个特别简单的程序来验证编译器是否支持C99。


大家应该都知道对于C89/C90标准的编译器是不支持在for循环中定义变量的,测试代码如下



int main(void) {
for(int i = 0; i < 5; i++){
;
}
return 0;
}


所以编译会发生报错


![image-20210704120854795](https://img-blog.csdnimg.cn/img_convert/2fa688c52d7d3d6b3de1ba69ea5b1d1a.png)


代码改成下面这样就可以正常编译了



int main(void) {
int i;
for(i = 0; i < 5; i++){
;
}
return 0;
}


### image-20210704121021243


另外,编译器命令参数那里,我们使用了-ansi 参数,该参数与 -std = c89是等价的,都不支持双斜线注释(//)。


![image-20210704121901330](https://img-blog.csdnimg.cn/img_convert/a1ab71bb6def86f22155eaebf16c534a.png)


这篇文章说了一下这个问题:[如何使GCC能够处理双斜线注释(C++风格注释)?]( )


我们改为-std=gnu89是不行的,不支持。


试了下 -lang-c-c+±comments ,发现是可以的,只是会报一个提示


![image-20210704123016949](https://img-blog.csdnimg.cn/img_convert/f297f312b336180a0738169a2ddec9eb.png)


但是程序是可以download进模拟机并正常运行的。




---


那这个编译器是否支持所有的标准库呢?


C语言标准库有十五个


![image-20210704111733778](https://img-blog.csdnimg.cn/img_convert/ec0d5d7ae2ce248d17ebf15b1513d76f.png)


通过下面一段代码来测试一下



#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <setjmp.h>
#include <stdarg.h>
#include <stddef.h>
#include <string.h>
#include <time.h>

int main() {
printf(“hello world\n”);
return 0;
}


发现可以正常通过编译,说明这些头文件都是存在的。


![image-20210704111922829](https://img-blog.csdnimg.cn/img_convert/5b52e2928a5a07d7516d59f19475ea34.png)


其实通过上面编译器的命令我们也可以看出很多信息,在此就不赘述了。


这边找到一篇说明的文章:[Tornado编译vxworks本质及过程]( )


我们可以找到项目下的makefile,内容如下



Makefile generated by the project manager

core information

PRJ_FILE = teststructlib.wpj
ifeq ($(wildcard Makefile),)
PRJ_DIR = …
else
PRJ_DIR = .
endif
PRJ_TYPE = vxApp
PRJ_OBJS = main.o
BUILD_SPEC = SIMNTgnu
TGT_DIR = $(WIND_BASE)/target

build-configuration info

ifeq ($(BUILD_SPEC),SIMNTgnu)
CPU = SIMNT
TOOL = gnu
TOOL_FAMILY = gnu
DEFAULT_RULE = teststructlib.out
endif

include $(TGT_DIR)/h/make/defs.project

build-configuration info

ifeq ( ( B U I L D S P E C ) , S I M N T g n u ) A R = a r s i m p c A S = c c s i m p c C C = c c s i m p c C C A R C H S P E C = − m p e n t i u m C F L A G S = − g − m p e n t i u m − a n s i − f n o − b u i l t i n − f n o − d e f e r − p o p − I . − I (BUILD_SPEC),SIMNTgnu) AR = arsimpc AS = ccsimpc CC = ccsimpc CC_ARCH_SPEC = -mpentium CFLAGS = -g -mpentium -ansi -fno-builtin -fno-defer-pop -I. -I (BUILDSPEC),SIMNTgnu)AR=arsimpcAS=ccsimpcCC=ccsimpcCCARCHSPEC=mpentiumCFLAGS=gmpentiumansifnobuiltinfnodeferpopI.I(WIND_BASE)/target/h/ -DCPU=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu
CFLAGS_AS = -g -mpentium -ansi -fno-builtin -fno-defer-pop -P -xassembler-with-cpp -I. -I$(WIND_BASE)/target/h/ -DCPU=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu
CPP = ccsimpc -E -P
LD = ldsimpc
LDFLAGS = --subsystem=windows
LD_PARTIAL = ccsimpc -r -nostdlib
LD_PARTIAL_FLAGS = -r
NM = nmsimpc -g
OPTION_DEFINE_MACRO = -D
OPTION_DEPEND = -M -w
OPTION_GENERATE_DEPENDENCY_FILE = -MD
OPTION_INCLUDE_DIR = -I
OPTION_LANG_C = -xc
OPTION_UNDEFINE_MACRO = -U
SIZE = sizesimpc
TOOL_FAMILY = gnu
POST_BUILD_RULE =

img
img

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加戳这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

89)]

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加戳这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

  • 5
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值