-
Notifications
You must be signed in to change notification settings - Fork 263
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
Use int64_t as fluid_long_long_t in C99 #1057
Conversation
According to quality gate
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Sry, I don't get this point. Why would you want to bind An why would this break something? You're essentially defining You're basically suggesting an ABI breakage for everyone. So I really need to understand your motivation. |
My situation is related to auto generation of binding code. But come to think of it, other programs using fluidsynth could produce build error if the type of |
It's pretty uncommon to mess around in 3rd party library headers. Have you considered to typecast
I do breaking change releases of fluidsynth from time to time. The next breaking change will probably be when porting to C++ (in case that ever happens, see #847). I will consider your request if or once we do so. |
It differs per target platform, as it refers to stdint.h. in armv7-eabi and x86 it is not auto casted, but in aarch64 and amd64, it works well(since both The point of my opinion is not in jni.h, but in stdint.h. The best choice of 64-bit type varies per platform, so my point is it would be better to choose type of 64-bit type with stdint.h. So for portability and clarity, I suggest you to change However, this is just a future talk, and I realized that the cost of the change is larger than maintaining the current situation. So I also think it is not that should be considered now. But when a breaking change happens, I hope that you could consider this.
Glad to hear from you! I'm looking forward to it. |
Ok thanks, I've added it to the discussion so we don't forget about it. |
OK, Thanks. |
Currently, fixed type of long long is used for fluid_long_long_t, as it is guranteed to have 64-bit wide in C99.
However, stdint.h defines int64_t as long, so it has posibillity to break codes which uses 64-bit type with stdint.
For example, jni.h defines jlong with int64_t, so some functions which uses fluid_long_long_t as parameter type breaks when binding them into jlong.
So, even though using long long as 64-bit type is reasonable, I suggest you to use int64_t since it has potential to break in some build targets.
Thanks in advance.