rpmdir.c void functions and return values
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
RPM |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
Building 5.4.12 on x86_64-
The Studio compiler objects to any function that claims it's void but issues a return statement:
gmake[2]: Entering directory `/local/
source='rpmdir.c' object='rpmdir.lo' libtool=yes \
/bin/sh ../libtool --tag=CC --mode=compile cc -m64 -DHAVE_CONFIG_H -I. -I.. -I. -I.. -I../build -I../lib -I../lib -I../rpmdb -I../rpmio -I../misc -I../beecrypt/
libtool: compile: cc -m64 -DHAVE_CONFIG_H -I. -I.. -I. -I.. -I../build -I../lib -I../lib -I../rpmdb -I../rpmio -I../misc -I../beecrypt/
"rpmdir.c", line 448: void function cannot return value
"rpmdir.c", line 449: void function cannot return value
"rpmdir.c", line 513: void function cannot return value
"rpmdir.c", line 514: void function cannot return value
cc: acomp failed for rpmdir.c
gmake[2]: *** [rpmdir.lo] Error 1
gmake[2]: Leaving directory `/local/
The simple fix is to just remove the return statement. Note that there's a mix of tabs and spaces in both of the function calls, which looks a little weird on my screen since I use a 4-width tabstop, but I believe I've preserved the original spacing in the patch.
Thanks for the patch: pretty amazing what non-"portable"
extensions are routinely permitted, this code has been
fed to splint and coverity and a fair number of compilers zillions of times.
The patch isn't quite right, an else is needed.
No easy fix for "ts=4" editing: I use "ts=8" with 4 space indents
(which is the default output from indent -kr and originally
dates back to Erik Troan's coding style in vi.