oetiker / mrtg

MRTG - Multi Router Traffic Grapher
http://www.mrtg.org
243 stars 60 forks source link

Warning: format ‘%x’ expects argument of type ‘unsigned int *’ #100

Closed youpong closed 1 year ago

youpong commented 1 year ago

Description

The following warnings are shown when building mrtg.

gcc  -Wpedantic -Wall -Wpointer-arith -Wcast-align -Wmissing-declarations -Wnested-externs -Winline -W -DHAVE_CONFIG_H -c ./src/rateup.c -o bin/rateup.o
./src/rateup.c: In function ‘main’:
./src/rateup.c:2169:39: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘int *’ [-Wformat=]
 2169 |           sscanf (argv[argi + 1], "#%2x%2x%2x", &col_in[0], &col_in[1],
      |                                     ~~^         ~~~~~~~~~~
      |                                       |         |
      |                                       |         int *
      |                                       unsigned int *
      |                                     %2x

How to reproduce

  1. $ ./configure CFLAGS=-Wpedantic
  2. $ make