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

gcc compilation error: fallthrough keyword #4568

Closed
muvarov opened this issue Nov 15, 2021 · 4 comments
Closed

gcc compilation error: fallthrough keyword #4568

muvarov opened this issue Nov 15, 2021 · 4 comments
Assignees

Comments

@muvarov
Copy link

muvarov commented Nov 15, 2021

Bunch of projects using wolfssl issue compilation error like that:

|/usr/include/optee/export-user_ta/include/compiler.h:259:21: error: expected ')' before 'attribute'
| 259 | #define fallthrough attribute((fallthrough))
| | ^~~~~~~~~~~~~
| ./lib/wolf/wolf_symlink/wolfssl/wolfcrypt/types.h:184:50: note: in expansion of macro 'fallthrough'
| 184 | #define FALL_THROUGH attribute ((fallthrough));
| | ^~~~~~~~~~~
| lib/wolf/wolf_symlink/wolfcrypt/src/ecc.c:2980:13: note: in expansion of macro 'FALL_THROUGH'
| 2980 | FALL_THROUGH;
| | ^~~~~~~~~~~~
| In file included from ./lib/wolf/wolf_symlink/wolfssl/wolfcrypt/ecc.h:26,
| from lib/wolf/wolf_symlink/wolfcrypt/src/ecc.c:106:
| ./lib/wolf/wolf_symlink/wolfssl/wolfcrypt/types.h:184:62: error: expected identifier or '(' before ')' token
| 184 | #define FALL_THROUGH attribute ((fallthrough));
| | ^
| lib/wolf/wolf_symlink/wolfcrypt/src/ecc.c:2980:13: note: in expansion of macro 'FALL_THROUGH'
| 2980 | FALL_THROUGH;

Actually it's wrong define for fallthrough keywork. FIx is here #4563

BR,
Maxim.

@kareem-wolfssl
Copy link
Contributor

Hi @muvarov ,

What compiler are you using? fallthrough is the correct keyword for GCC: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html

Thanks,
Kareem

@kareem-wolfssl
Copy link
Contributor

I misunderstood the issue @muvarov . You have a conflicting definition of fallthrough. I will work on getting this corrected.

@kareem-wolfssl
Copy link
Contributor

Hi @muvarov ,

Please try rebuilding with #4580 and let me know if it helps.

Thanks,
Kareem

@muvarov
Copy link
Author

muvarov commented Nov 19, 2021

@kareem-wolfssl I spend some time understaning this changes. And it's looks like this issue was in 74ebf51 and it's fixed in 74ebf51.

I sent PR to update submodule:
microsoft/MSRSec#35

So I think if you can drop this change for now if you can not reproduce it locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants