Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CodeStyle] fix pragma-pack warning on macos #47399

Merged
merged 1 commit into from
Oct 28, 2022
Merged

[CodeStyle] fix pragma-pack warning on macos #47399

merged 1 commit into from
Oct 28, 2022

Conversation

GreatV
Copy link
Contributor

@GreatV GreatV commented Oct 27, 2022

PR types

Others

PR changes

Others

Describe

Fix pragma-pack warning on macOS.

cat before.log | grep "\[\-W" |grep -v party | awk '{print $NF}'|sort|uniq -c|sort -nr
   4 [-Wc++17-extensions]
   2 [-Wexceptions]
   1 [-Wunknown-warning-option]
   1 [-Wreturn-type-c-linkage]
   1 [-Wpragma-pack]
cat after.log | grep "\[\-W" |grep -v party | awk '{print $NF}'|sort|uniq -c|sort -nr
   4 [-Wc++17-extensions]
   2 [-Wexceptions]
   1 [-Wreturn-type-c-linkage]

@paddle-bot
Copy link

paddle-bot bot commented Oct 27, 2022

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@luotao1
Copy link
Contributor

luotao1 commented Oct 27, 2022

为什么[-Wunknown-warning-option] 这个也消失了呢?

@GreatV
Copy link
Contributor Author

GreatV commented Oct 27, 2022

为什么[-Wunknown-warning-option] 这个也消失了呢?

看了一下都是 eigen3 引入的,一个日志里有单独一行[-Wunknown-warning-option],另一个没有。很奇怪。

2022-10-27 20:58:33 5 warnings generated.
2022-10-27 20:58:33 [-Wunknown-warning-option]
2022-10-27 20:58:33     #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"

@GreatV
Copy link
Contributor Author

GreatV commented Oct 28, 2022

怀疑是日志没有及时写入,导致多出来的。都是Eigen/src/Core/util/DisableStupidWarnings.h引入的,报了有7700+相同的warning,时间上来不及,导致日志错位。这个warning目前应该可以忽略。
另外下载了一个最近成功的CI,也有几行错位:

2022-10-28 02:04:13 /home/Paddle/build/third_party/eigen3/src/extern_eigen3/unsupported/Eigen/CXX11/../../../Eigen/src/Core/util/DisableStupidWarnings.h:48:38: warning: unknown warning group '-Wimplicit-int-float-conversion', ignored [-Wunknown-warning-option]
2022-10-28 02:04:13     #ableStupidWarnings.h:48:38: warning: unknown warning group '-Wimplicit-int-float-conversion', ignored [-Wunknown-warning-option]
2022-10-28 02:04:13     #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
...
2022-10-28 02:04:15 [ 33%] Building CXX object paddle/phi/kernels/CMakeFiles/phi_cpu.dir/cpu/prior_box_kernel.cc.o
2022-10-28 02:04:15 [ 33%] Building CXX object paddle/phi/kernels/CMakeFiles/phi_cpu.dir/cpu/psroi_pool_kernel.cc.o
2022-10-28 02:04:15 unsupported/Eigen/CXX11/../../../Eigen/src/Core/util/DisableStupidWarnings.h:48:38: warning: unknown warning group '-Wimplicit-int-float-conversion', ignored [-Wunknown-warning-option]
2022-10-28 02:04:15     #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"

@luotao1 @zhiqiu

@GreatV
Copy link
Contributor Author

GreatV commented Oct 28, 2022

这个warning在apple clang 10中出现,在apple clang 14中就没有了,应该是能识别到-Wimplicit-int-float-conversion这个flag了。

➜ clang --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
➜ cat ./0.log | grep "\[\-W" |grep -v party | awk '{print $NF}'|sort|uniq -c|sort -nr  
  26 [-Wnon-c-typedef-for-linkage]
  25 [-Wdeprecated-declarations]
   7 [-Wdangling-gsl]
   4 [-Wc++17-extensions]
   4 [-Walign-mismatch]
   2 [-Wexceptions]
   1 [-Wreturn-type-c-linkage]
   1 [-Wpragma-pack]
➜ cat ./1.log | grep "\[\-W" |grep -v party | awk '{print $NF}'|sort|uniq -c|sort -nr
  26 [-Wnon-c-typedef-for-linkage]
  25 [-Wdeprecated-declarations]
   7 [-Wdangling-gsl]
   4 [-Wc++17-extensions]
   2 [-Wexceptions]
   1 [-Wunused-value]
   1 [-Wreturn-type-c-linkage]

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. LGTM

@luotao1 luotao1 merged commit 800e053 into PaddlePaddle:develop Oct 28, 2022
@GreatV GreatV deleted the fix_macos_warning branch October 28, 2022 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants