c42f / tinyformat

Minimal, type safe printf replacement library for C++
532 stars 75 forks source link

Fix for Xcode 7 (issue #28): field 'm_formatterStore' is uninitialize… #29

Closed beemaster closed 8 years ago

beemaster commented 8 years ago

This fixes issue #28

c42f commented 8 years ago

Did you try turning the warning off with a pragma as suggested in #28? I'd kinda prefer that solution since I think the existing code is more logical and valid than the fix here (see http://stackoverflow.com/questions/32608458/is-passing-a-c-object-into-its-own-constructor-legal )

beemaster commented 8 years ago

Using macro with Xcode version check and disabling warning seems more ugly to me. Clang developers also introduced this warning for a reason. I think because the uninitialized object is

allowed to be used in limited ways

One day one might forget that object is not initialized yet and do something with it.

c42f commented 8 years ago

It turns out that removing the std::array seems to fix this problem in a somewhat nicer way (especially since it allows removal of an icky MSVC workaround.)

Thanks for taking the time to report the problem and propose a patch.