-
Notifications
You must be signed in to change notification settings - Fork 163
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
Fix compilation with -Wpedantic on GCC #1059
Conversation
e67096f
to
0a5c517
Compare
source/include/FreeRTOS_IPv4.h
Outdated
struct xIP_PACKET; | ||
|
||
#ifdef __GNUC__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed, i see that by adding -Wpedantic to the GCC compilation flags only gives error in FreeRTOS_Sockets.c which you resolved above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reproduced in GCC 13.2
It looks like -std=gnu2x
is also required to reproduce the error, but since it is a public header, this should be handled.
/opt/arm/gcc-13.2/bin/arm-none-eabi-gcc
-mcpu=cortex-m7 -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb -mlong-calls -mlittle-endian -Wall -Wextra -Werror -Wpedantic -Wno-psabi -fstack-usage -ffunction-sections -fdata-sections -fno-omit-frame-pointer -fvar-tracking -fvar-tracking-assignments -O0 -DDEBUG -ggdb3 -gdwarf-5 -std=gnu2x -fdiagnostics-color=always -Wno-array-bounds -Wno-strict-aliasing -Wno-unused-but-set-variable
...
FreeRTOS_IPv4.h:46:10: error: empty declaration of 'enum' type does not redeclare tag [-Werror=pedantic]
46 | enum eFrameProcessingResult;
Hi @Mixaill Can you please help in updating on the above review comments. |
@moninom1 Please take a look once again |
Dismissing review as we do not want to add compiler specific stuff in the common source files
Thank you for your contribution. I have the following suggestions:
Would you like to make these changes or would you like us to? |
|
Description
This PR does the following
empty declaration of 'enum' type does not redeclare tag
error in theFreeRTOS_IPv4.h
file.-Wpedantic
to the GCC compilation flags-Wno-pedantic
forFreeRTOS_Sockets.c
file in case you are using GCC to suppress warningThe main reason is that
FreeRTOS_IPv4.h
is a public header and in case an application uses-Wpedantic -Werror
to compile, it will not be able to use FreeRTOS-Plus-TCP.Checklist:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.