MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.06k stars 19.16k forks source link

[BUG] Compiler Warning on MarlinCore.cpp #27258

Closed fnsign closed 2 weeks ago

fnsign commented 2 weeks ago

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

Yes, and the problem still exists.

Bug Description

see screenshot CleanShot 2024-07-10 at 19 03 49@2x

Bug Timeline

first appearance ca. 3 weeks ago

Expected behavior

No compiler warning

Actual behavior

Compiler warns

Steps to Reproduce

Start compiler on VSCode

Version of Marlin Firmware

bugfix-2.1.x

Printer model

Ender 3 Pro

Electronics

BIGTREETECH SKR MINI E3 V1.2

LCD/Controller

stock

Other add-ons

--

Bed Leveling

ABL Bilinear mesh

Your Slicer

Prusa Slicer

Host Software

OctoPrint

Don't forget to include

Additional information & file uploads

No response

ellensp commented 2 weeks ago

Please attach your configuration files.

This does not occur on stock ramps configs

ellensp commented 2 weeks ago

Setting #define MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V1_2 and #define SERIAL_PORT 1 is enough to trigger this minor warning.

ellensp commented 2 weeks ago

Issue is stm32 implementation of analogInputToDigitalPin (uint32_t) vs marlins pin definition (int32_t)

Code in question was added in https://github.com/MarlinFirmware/Marlin/pull/27219

ellensp commented 2 weeks ago

code already has

pragma GCC diagnostic ignored "-Wnarrowing"

so add this line under it

pragma GCC diagnostic ignored "-Wsign-compare"

Matsavol commented 2 weeks ago

I can confirm same problem happening on Longer LK1 (Alfawise U20). Visual Studio Code does compile it showing this error, but does produce bin image. Once the printer is flashed with the resulting image it gets stuck in the "Load EEPROM defaults" screen touchscreen not responding.

ellensp commented 2 weeks ago

This warning does not cause any issues

fnsign commented 2 weeks ago

Please attach your configuration files.

This does not occur on stock ramps configs

Here are my config files:

configs.zip

ellensp commented 2 weeks ago

PR created, closing issue