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

Fix : Wrong _tcp_client[] array initialization #62

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

ABOSTM
Copy link
Contributor

@ABOSTM ABOSTM commented Apr 13, 2022

Fix : Wrong _tcp_client[] array initialization

Former "_tcp_client[MAX_CLIENT] = {};" tries to initialize
the array element with index MAX_CLIENT,
which is out of array range [0 .. (MAX_CLIENT-1)]
Fixes warning:
warning: array subscript 32 is above array bounds of 'tcp_struct* [32]' [-Warray-bounds]

Instead initialize each element of the array one by one.

Signed-off-by: Alexandre Bourdiol alexandre.bourdiol@st.com

@ABOSTM ABOSTM requested a review from fpistm April 13, 2022 08:37
@ABOSTM ABOSTM added the bug label Apr 13, 2022
Former "_tcp_client[MAX_CLIENT] = {};" tries to initialize
the array element with index MAX_CLIENT,
which is out of array range [0 .. (MAX_CLIENT-1)]
Fixes warning:
warning: array subscript 32 is above array bounds of 'tcp_struct* [32]'
[-Warray-bounds]

Instead initialize each element of the array one by one.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
@fpistm fpistm merged commit fb56c54 into stm32duino:main Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants