Merged
llvm与gcc的兼容性分析--implementation defined behavior #49
AtomGit-BotAdd on Sep 28, 2024
llvm与gcc的兼容性分析--implementation defined behavior #49
Merged
AtomGit-BotAdd on Sep 28, 2024
Merged fromrefs/pull/49/headintomaster
A
AtomGit-Bot
Sep 28, 2024

在C11 标准中测试了70条。
在C14中测试了2条。
与GCC文档中的implementation-defined behaviours列表保持一致。

likedislike
Pull Request has been successfully merged by .
(Thank you for AtomGit-Bot's contribution.)
AAtomGit-Bot
Sep 28, 2024 指派了测试人openeuler-ci-bot
AAtomGit-Bot
Sep 28, 2024 指派了 openeuler-ci-bot 参与评审
openeuler-ci-botopeneuler-ci-botCollaborators
Sep 28, 2024 添加了   newcomer 标签
openeuler-ci-bot
openeuler-ci-botCollaborators
Sep 28, 2024 Comments:

Hi yang-youwen, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Compiler, and any of the maintainers: @jvmboy , @eastb233 , @kuenking111 , @cf-zhao , @li-yancheng , @stubCode , @alexanderbill , @openeuler-ci-bot

likedislike
openeuler-ci-botopeneuler-ci-botCollaborators
Sep 28, 2024 添加了   sig/Compiler 标签
openeuler-ci-botopeneuler-ci-botCollaborators
Sep 28, 2024 添加了   openeuler-cla/yes 标签
AAtomGit-Bot
Sep 28, 2024 添加了   lgtm-ibforu 标签
AAtomGit-Bot
Sep 28, 2024 移除了   lgtm-ibforu 标签
AAtomGit-Bot
Sep 28, 2024 更新了说明
wangjx6
wangjx6Oct 28, 2024Start code review1
Compiler Features/GCC_LLVM/implementation-defined behaviours/readme.md
@@ -0,0 +4,4 @@
4+ 
5+ 
6+ 
7+测试环境为Ubuntu 22.04.4 LTS,GCC版本为11.4.0,LLVM版本为14.0.0,Clang版本为14.0.0-1ubuntu1.1,glibc版本为2.35。
wangjx6
wangjx6Oct 28, 2024Comments:

请在readme中写一下,做这件事情的背景和目的

likedislike
wangjx6
wangjx6Oct 28, 2024Start code review1
Compiler Features/GCC_LLVM/implementation-defined behaviours/C11.md
@@ -0,0 +1051,4 @@
1051+ 
1052+> **GCC Extension for 128-bit Integers** GCC provides a set of nonstandard integer types as an extension, for example `__int128`. This type is not defined by the C or C++ standards but is supported on some platforms, offering extended precision for integer arithmetic. It is only supported on platforms that provide a `__int128` hardware or software support.
1053+ 
1054+在LLVM-PROJECT/libcxx/include/stdint.h中:
wangjx6
wangjx6Oct 28, 2024Comments:

不能因为clang的文档中没有相关描述就认定 llvm和gcc是一致的,这个结论不太可靠。
你可以看看stdint.h两边是否一致。验证一下非标准扩展类型是否有差异。

likedislike
wangjx6
wangjx6Oct 28, 2024Start code review1
Compiler Features/GCC_LLVM/implementation-defined behaviours/C11.md
@@ -0,0 +2032,4 @@
2032+ 
2033+## 10. Qualifiers
2034+ 
2035+### 1. What constitutes an access to an object that has volatile-qualified type ([6.7.3](https://port70.net/~nsz/c/c11/n1570.html#6.7.3)).
wangjx6
wangjx6Oct 28, 2024Comments:

你可以在这个文档的结尾总结一下有差异的行为有哪些。

likedislike
wangjx6
wangjx6Oct 28, 2024Start code review1
Compiler Features/GCC_LLVM/implementation-defined behaviours/CPP14.md
@@ -0,0 +159,4 @@
159+Aborted
160+```
161+ 
162+栈不会展开,和GCC一致。
wangjx6
wangjx6Oct 28, 2024Comments:

可以在结尾总结一下,有差异的都有哪些

likedislike
wangjx6
wangjx6Oct 28, 2024Start code review1
Compiler Features/GCC_LLVM/implementation-defined behaviours/C11.md
@@ -0,0 +6,4 @@
6+ 
7+### 1. How a diagnostic is identified ([3.10](https://port70.net/~nsz/c/c11/n1570.html#3.10), [5.1.1.3](https://port70.net/~nsz/c/c11/n1570.html#5.1.1.3)).
8+ 
9+- 如何识别诊断
wangjx6
wangjx6Oct 28, 2024Comments:

感觉这个中文翻译不是很必要,或许你只保留中文,或者只保留英文即可。

likedislike
wangjx6
wangjx6Oct 28, 2024Start code review1
Compiler Features/GCC_LLVM/implementation-defined behaviours/C11.md
@@ -0,0 +440,4 @@
440+- signed char 和 unsigned char 中哪个与“普通” char 具有相同范围、表示和行为。
441+ 
442+- Determined by ABI.
443+ - 对于本测试环境而言,GCC和Clang均为signed char。
wangjx6
wangjx6Oct 28, 2024Comments:

这个应该改成:clang和gcc都是signed char 这个结论。

likedislike
AAtomGit-Bot
Oct 28, 2024 推送了代码
openeuler-ci-bot
openeuler-ci-botCollaborators
Oct 28, 2024 Comments:

/retest

likedislike
openeuler-ci-botopeneuler-ci-botCollaborators
Oct 28, 2024 添加了   stat/needs-squash 标签
cf-zhao
cf-zhaoCollaborators
Oct 29, 2024 Comments:

/lgtm
/approve

likedislike
openeuler-ci-bot
openeuler-ci-botCollaborators
Oct 29, 2024 Comments:

lgtm was added to this pull request by: cf-zhao. 👋
NOTE: If this pull request is not merged while all conditions are met, comment "/check-pr" to try again. 😄

likedislike
openeuler-ci-botopeneuler-ci-botCollaborators
Oct 29, 2024 添加了   lgtm 标签
openeuler-ci-botopeneuler-ci-botCollaborators
Oct 29, 2024 添加了   approved 标签
openeuler-ci-bot
openeuler-ci-botCollaborators
Oct 29, 2024 Comments:

approved was added to this pull request by: cf-zhao. 👋
NOTE: If this pull request is not merged while all conditions are met, comment "/check-pr" to try again. 😄

likedislike
openeuler-ci-botopeneuler-ci-botCollaborators
Oct 29, 2024 合并了Pull Request(通过 API 合并)