rsyslog / librelp

OFFICIAL librelp repository on github
https://www.rsyslog.com/librelp/
GNU General Public License v3.0
30 stars 36 forks source link

Variable undefined fix for when HAVE_STRERROR_R is defined #167

Closed cameronpm closed 5 years ago

cameronpm commented 5 years ago

I'm building this on an old system (Debian Wheezy, gcc 4.7.2) so it's not all that surprising that this bug has existed for 6 years. The 'emsg' variable comes from the above function so just some copy/paste error.

Prior to fix:

/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -pthread -D_FORTIFY_SOURCE=2  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g -c -o librelp_la-relp.lo `test -f 'relp.c' || echo './'`relp.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -pthread -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g -c relp.c  -fPIC -DPIC -o .libs/librelp_la-relp.o
relp.c: In function '_relpEngine_strerror_r':
relp.c:77:15: error: 'emsg' undeclared (first use in this function)
relp.c:77:15: note: each undeclared identifier is reported only once for each function it appears in
relp.c:75:8: warning: variable 'p' set but not used [-Wunused-but-set-variable]
relp.c: In function 'engineEventLoopRun':
relp.c:866:13: warning: unused variable 'localRet' [-Wunused-variable]
make[2]: *** [librelp_la-relp.lo] Error 1

There was also an issue with a C99 declaration in tcp.c line 755 of int i in the for loop causing a compile time error that I did not address here with a fix. Not sure how you feel about that one.

codecov-io commented 5 years ago

Codecov Report

Merging #167 into master will decrease coverage by 0.05%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #167      +/-   ##
==========================================
- Coverage   74.58%   74.53%   -0.06%     
==========================================
  Files          21       21              
  Lines        3950     3950              
==========================================
- Hits         2946     2944       -2     
- Misses       1004     1006       +2
Impacted Files Coverage Δ
src/relp.c 77.65% <ø> (ø) :arrow_up:
src/relpsess.c 85.17% <0%> (-0.41%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f4ddc0e...5e19bb1. Read the comment docs.

rgerhards commented 5 years ago

thx for the PR! The Solaris builder is probably a false positive, but openCSW seem currently to be offline, so I cannot confirm 100%. But it's good enough to see the others pass.