Skip to content
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

[Java generator] error: integer number too large #638

Closed
TSC21 opened this issue Feb 24, 2022 · 1 comment · Fixed by #639
Closed

[Java generator] error: integer number too large #638

TSC21 opened this issue Feb 24, 2022 · 1 comment · Fixed by #639

Comments

@TSC21
Copy link
Contributor

TSC21 commented Feb 24, 2022

Hey there,

I just tried to generate and compile the Java generated library from the the common dialect and the compiler fails with the following error:

output_dir_java/enums/MAV_SYS_STATUS_SENSOR.java:44: error: integer number too large
   public static final int MAV_SYS_STATUS_EXTENSION_USED = 2147483648; /* 0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only) | */
                                                           ^
output_dir_java/enums/MAV_SYS_STATUS_SENSOR.java:45: error: integer number too large
   public static final int MAV_SYS_STATUS_SENSOR_ENUM_END = 2147483649; /*  | */
                                                            ^
output_dir_java/enums/HIL_SENSOR_UPDATED_FLAGS.java:27: error: integer number too large
   public static final int HIL_SENSOR_UPDATED_RESET = 2147483648; /* Full reset of attitude/position/velocities/etc was performed in sim (Bit 31). | */
                                                      ^
output_dir_java/enums/HIL_SENSOR_UPDATED_FLAGS.java:28: error: integer number too large
   public static final int HIL_SENSOR_UPDATED_FLAGS_ENUM_END = 2147483649; /*  | */
                                                               ^
4 errors

Steps to reproduce:

  1. Use mavgen.py to generate the V2 library for Java in an output_dir
  2. javac -d output_dir find output_dir -name "*.java"
  3. The error above will pop.

This is confirmed to happen with both Java 11 and Java 14.

Thanks in advance for the assistance solving this!

@abroekhof
Copy link

This should be re-opened since the PR above was reverted. The bug still present in current versions.

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 a pull request may close this issue.

2 participants