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

[BUG] G26 mesh_index_pair location may be used uninitialized in this function #27537

Open
1 task done
classicrocker883 opened this issue Nov 21, 2024 · 0 comments
Open
1 task done

Comments

@classicrocker883
Copy link
Contributor

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

G26_MESH_VALIDATION

  • Marlin\src\gcode\bedlevel\G26.cpp
    mesh_index_pair location;
Marlin\src\gcode\bedlevel\G26.cpp:717:19: note: '*((void*)& location +1)' was declared here
'location.mesh_index_pair::pos.XYval<signed char>::<anonymous>.XYval<signed char>::<unnamed union>::<anonymous>.XYval<signed char>::<unnamed union>::<unnamed struct>::x'
was declared here

  717 |   mesh_index_pair location;

  • Marlin\src\lcd\extui\ui_api.h
    inline void onMeshUpdate(const xy_int8_t &pos, probe_state_t state) { onMeshUpdate(pos.x, pos.y, state); }
Marlin\src\gcode\bedlevel\../../lcd/extui/ui_api.h:261:89: warning: '*((void*)& location +1)' may be used uninitialized in this function [-Wmaybe-uninitialized]
'location.mesh_index_pair::pos.XYval<signed char>::<anonymous>.XYval<signed char>::<unnamed union>::<anonymous>.XYval<signed char>::<unnamed union>::<unnamed struct>::x'
may be used uninitialized in this function [-Wmaybe-uninitialized]
  261 |       inline void onMeshUpdate(const xy_int8_t &pos, probe_state_t state) { onMeshUpdate(pos.x, pos.y, state); }

This may be related to having EXTENSIBLE_UI (ProUI) because of extui/ui_api.h

Bug Timeline

No response

Expected behavior

No warnings

Actual behavior

Warnings (see description)

Steps to Reproduce

  1. Load configs (can be any typical)
  2. Used EXTENSIBLE_UI display type - DWIN_LCD_PROUI (haven't tried any other)
  3. Have G26_MESH_VALIDATION enabled

Version of Marlin Firmware

bugfix-2.1.x

Printer model

Voxelab Aquila

Electronics

No response

LCD/Controller

No response

Other add-ons

No response

Bed Leveling

UBL Bilinear mesh

Your Slicer

None

Host Software

None

Don't forget to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.

Additional information & file uploads

Configs-UBL.zip

I tried to initialize mesh_index_pair location in G26.cpp to something like = {0, 0} or = {}, and recieved these errors:

Marlin\src\gcode\bedlevel\G26.cpp:849:3: error: jump to label 'LEAVE'
  849 |   LEAVE: 
Marlin\src\gcode\bedlevel\G26.cpp:675:60: note:   from here
  675 |   if (g26.prime_flag && g26.prime_nozzle() != G26_OK) goto LEAVE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant