Skip to content

suppress compiler errors stemming from bugged warning#39

Merged
dgoffredo merged 1 commit intomainfrom
david.goffredo/alpine-spurious-warning
Jun 14, 2023
Merged

suppress compiler errors stemming from bugged warning#39
dgoffredo merged 1 commit intomainfrom
david.goffredo/alpine-spurious-warning

Conversation

@dgoffredo
Copy link
Copy Markdown
Contributor

I previously made this change to nginx-datadog, which builds dd-trace-cpp as part of its build. I didn't make the corresponding change in dd-trace-cpp itself because the build image that we use for CI isn't based on Alpine, which packages a newer GCC that has this bug.

@dgoffredo dgoffredo requested a review from cgilmour June 13, 2023 19:47
Copy link
Copy Markdown
Contributor

@cgilmour cgilmour left a comment

Choose a reason for hiding this comment

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

Approved, and it'll be good when the hack/workaround can be removed in the future.

set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# This warning has a false positive. See
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It'd be nice to have an easy / automated way to know when this can be removed again.
But it's not worth putting additional effort into it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

CMake has a feature that allows the output of a program to be used as the value of a variable.

I wrote a bin/spurious-warning script that uses g++ and grep to demonstrate whether the spurious warning is produced. But, I had trouble coming up with a minimum reproducing program. In particular, the snippet in the linked bugzilla report didn't trigger the warning in GCC 12 (which is what recent Alpines use).

You're right, it's not worth putting additional effort into it.

@dgoffredo
Copy link
Copy Markdown
Contributor Author

Thanks for the review!

@dgoffredo dgoffredo merged commit 37a5192 into main Jun 14, 2023
@dgoffredo dgoffredo deleted the david.goffredo/alpine-spurious-warning branch June 14, 2023 19:43
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.

2 participants