printf format strings display incorrect values for floating-point specifiers

Luigi Castelli's icon

Hi there,

after the recent release of Max SDK 8, I keep experiencing a weird and annoying bug as far as printf format strings are concerned.

The floating-point format specifiers ("%f" and "%g") - in many functions where they may be used as parameters - only translate floating-point data types (float, double) to garbage or zero.
This only happens with the floating-point format specifiers ("%f" and "%g"). All other specifiers seem to work as expected.

For instance, I can no longer use object_post(), object_warn(), object_error(), to post floating-point values to the Max window.

I also coded something using dictionary_sprintf() and - sure enough - attributes created with floating-point format specifiers do not get converted correctly to dictionary entries.

For instance, the following code fails to produce the expected result:

double value1 = 7.4;
double value2 = 2.1;
t_dictionary *dict = dictionary_sprintf("@value1 %f @value2 %f", value1, value2);
if (dict) {
    dictionary_dump(dict, 1, 0);
    object_free(dict);
}

Needless to say, it makes coding with the new SDK very slow and cumbersome.
I would appreciate if someone could shed some light on this.

I am on MacOS Mojave 10.14.4, compiling with Xcode 10.2.1

It occurred to me that the bug could also be related to some setting of Xcode, so I am asking if any 3rd party developer experienced the same issue.

Thanks for any assistance.

- Luigi

P. S.
After a more thorough test it seems that floating-point values fail to be displayed correctly in the Max window, however they get assigned the correct value.

Can't spend more time on this at the moment.
Waiting for some feedback from 3rd party developers and/or Cycling74.

Thanks.