Opened 5 months ago

Closed 5 months ago

#68896 closed defect (fixed)

collectd @5.12.0: error: variable 'num_entries' set but not used

Reported by: FranklinYu (Franklin Yu) Owned by: neverpanic (Clemens Lang)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: raimue (Rainer Müller)
Port: collectd

Description

Relevant error message (from the MacPorts log file):

src/bind.c:473:7: error: variable 'num_entries' set but not used [-Werror,-Wunused-but-set-variable]
  int num_entries = 0;
      ^
src/bind.c:552:7: error: variable 'num_entries' set but not used [-Werror,-Wunused-but-set-variable]
  int num_entries = 0;
      ^
src/bind.c:612:7: error: variable 'num_entries' set but not used [-Werror,-Wunused-but-set-variable]
  int num_entries = 0;
      ^
3 errors generated.
make[1]: *** [src/bind_la-bind.lo] Error 1
make: *** [all] Error 2

I was able to reproduce this after running sudo -u macports make in the build-directory.

Change History (5)

comment:1 Changed 5 months ago by FranklinYu (Franklin Yu)

I feel that -Werror is only useful in ./configure (to detect features), or during CI build (for development). Building on end-user machine sounds more harmful than helpful.

I found that it was specified in Makefile:

AM_CFLAGS = -Wall -Werror
AM_CXXFLAGS = -Wall -Werror

I removed -Werror from the Makefile, which allows me to build. I also noticed https://github.com/macports/macports-ports/blob/64319d031f9710587acc643b6a7eace717261a23/sysutils/collectd/Portfile#L34. Have we escalated to upstream about this issue (to see whether they are willing to make -Werror optional)?

comment:2 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: raimue added
Owner: set to neverpanic
Status: newassigned
Summary: collectd 5.12.0: doesn’t buildcollectd @5.12.0: error: variable 'num_entries' set but not used

comment:3 Changed 5 months ago by FranklinYu (Franklin Yu)

I noticed that the AUR package has --disable-werror: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=collectd#n67

Maybe it can help?

comment:5 Changed 5 months ago by neverpanic (Clemens Lang)

Resolution: fixed
Status: assignedclosed

In 2e8b574962a708a5fb0dda8583930995440de760/macports-ports (master):

collectd: Disable -Werror

Closes: #68896

Note: See TracTickets for help on using tickets.