Missing Field Initialisers warning in juce_Threads_mac.mm

I’m getting the following warning in juce::Threads_mac.mm when using the juce::juce_recommended_warning_flags cmake option:

[{
	"resource": "<my_project>/JUCE/modules/juce_core/native/juce_Threads_mac.mm",
	"owner": "cmake-build-diags",
	"severity": 8,
	"message": "missing field 'started' initializer [-Werror,-Wmissing-field-initializers]",
	"source": "GCC",
	"startLineNumber": 134,
	"startColumn": 35,
	"endLineNumber": 134,
	"endColumn": 1000
}]

A simple fix appears to be to replace threadData { *this } with threadData { *this, {} }.

This is on the latest tip of the develop branch.

JUCE needs an issue tracker. :laughing:

1 Like

Thanks for reporting

2 Likes

Thanks! All working well now!

Out of interest, why do you not treat warnings as errors in juce_recommended_warning_flags?

It’s a good question. The idea I think is that it makes things more flexible for users when warnings are triggered especially for new versions of tools that we may not have tested on yet. It allows users to decide if they want those warnings as errors or not, and to easily switch them should any warnings start to trigger.

We do however turn on warnings as errors for all our CI builds so that CI fails in that case.

1 Like