In general, use the same coding style as the surrounding code.However, do not make any unnecessary changes as that complicatesthe VCS (git) history and makes it harder to merge patches. Sodo not modify code just to make it conform to a coding style.IndentationTurn on a "fill tabs with spaces" option in your editor.Remove tabs and trailing spaces from any lines that are modified.Note that some files are indented with 2 spaces (when theyhave large indentation) while most are indented with 4 spaces.LanguageTCC is mostly implemented in C90. Do not use any non-C90 featuresthat are not already in use.Non-C90 features currently in use, as revealed by./configure --extra-cflags="-std=c90 -Wpedantic":- long long (including "LL" constants)- inline- very long string constants- assignment between function pointer and 'void *'- "//" comments- empty macro arguments (DEF_ASMTEST in i386-tok.h)- unnamed struct and union fields (in struct Sym), a C11 featureTestingA simple "make test" is sufficient for some simple changes. However,before committing a change consider performing some of the followingadditional tests:- Build and run "make test" on several architectures.- Build with ./configure --enable-cross.- If the generation of relocations has been changed, try compilingwith TCC and linking with GCC/Clang. If the linker has beenmodified, try compiling with GCC/Clang and linking with TCC.- Test with ASan/UBSan to detect memory corruption and undefined behaviour:make clean./configuremakemake testcp libtcc.a libtcc.a.hidemake clean./configure --extra-cflags="-fsanitize=address,undefined -g"makecp libtcc.a.hide libtcc.amake test- Test with Valgrind to detect some uses of uninitialised values:make clean./configuremake# On Intel, because Valgrind does floating-point arithmetic differently:( cd tests && gcc -I.. tcctest.c && valgrind -q ./a.out > test.ref )make test TCC="valgrind -q --leak-check=full `pwd`/tcc -B`pwd` -I`pwd`"(Because of how VLAs are implemented, invalid reads are expectedwith 79_vla_continue.)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。