Rename pow10 to allow gcc flag -Wshadow Topic is solved

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
albinhj
Posts: 6
Joined: Mon Jun 26, 2023 10:53 am
Been thanked: 3 times

Rename pow10 to allow gcc flag -Wshadow  Topic is solved

Postby albinhj » Wed Sep 20, 2023 5:21 pm

Hi,

When enabling gcc compiler flag -Wshadow, I get this:

Code: Select all

stablChibiOS/os/hal/lib/streams/chprintf.c:78:19: warning: declaration of 'pow10' shadows a built-in function [-Wshadow]
   78 | static const long pow10[FLOAT_PRECISION] = {
      |                   ^~~~~


This is on Ubunutu, using
arm-none-eabi-gcc (GNU Arm Embedded Toolchain 9-2020-q2-update) 9.3.1 20200408 (release)


By renaming this symbol, we can avoid this warning.

This applies to ]stablChibiOS/os/hal/lib/streams/chprintf.c, but seems to be the same in os/common/lib/src/chprintf.c. (https://github.com/search?q=repo%3AChib ... &type=code)

Many thanks and best regards

Return to “Small Change Requests”

Who is online

Users browsing this forum: No registered users and 3 guests