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 cts build error on mariner OS #1872

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

jujiang-del
Copy link
Contributor

No description provided.

@CLAassistant
Copy link

CLAassistant commented Jan 3, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@bashbaug bashbaug left a comment

Choose a reason for hiding this comment

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

This change looks reasonable but I'm having trouble understanding why the previous code was not OK. Could you please provide more information about the build error? Thanks!

@jujiang-del
Copy link
Contributor Author

This change looks reasonable but I'm having trouble understanding why the previous code was not OK. Could you please provide more information about the build error? Thanks!

The error was"/test_conformance/extensions/cl_khr_command_buffer/command_buffer_printf.cpp:429:37: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
429 | pattern[pattern_length] = '\0';"

@jujiang-del
Copy link
Contributor Author

!verify

@bashbaug
Copy link
Contributor

bashbaug commented Apr 4, 2024

Thanks, that's helpful. I'm guessing you're building with some version of gcc? Seems like this is a known false positive.

@svenvh, you've been most active eliminating warnings and enabling warnings as errors. How would you like to resolve this?

It's interesting that almost the exact same pattern appears, here, but this doesn't seem to be causing a problem:

unsigned pattern_length =
std::max(min_pattern_length, rand() % max_pattern_length);
char pattern_character = 'a' + rand() % 26;
std::vector<cl_char> pattern(pattern_length + 1, pattern_character);
pattern[pattern_length] = '\0';

@svenvh
Copy link
Member

svenvh commented Apr 5, 2024

I've seen various Wstringop-overflow false positives over time indeed, affecting only some gcc versions. If this patch fixes the particular instance I'm okay with merging this.

@svenvh
Copy link
Member

svenvh commented Apr 5, 2024

Closing and reopening to retrigger the buildbots.

@svenvh svenvh closed this Apr 5, 2024
@svenvh svenvh reopened this Apr 5, 2024
@neiltrevett neiltrevett merged commit 6b4d57d into KhronosGroup:main Jul 2, 2024
12 of 13 checks passed
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

Successfully merging this pull request may close these issues.

5 participants