Jeffrey Walton - 2013-09-22

Here's a few more under Clang 3.3 on Ubuntu 12.10 (x64).

event.c:2139:4: warning: The left operand of '+' is a garbage value
evutil_timeradd(&now, &tmp, &ev->ev_timeout);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/event2/util.h:379:40: note: expanded from macro 'evutil_timeradd'

define evutil_timeradd(tvp, uvp, vvp) timeradd((tvp), (uvp), (vvp))

                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/x86_64-linux-gnu/sys/time.h:172:36: note: expanded from macro
'timeradd'
(result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ ~~~~~~~~~~~ ^
event.c:2143:4: warning: The left operand of '+' is a garbage value
evutil_timeradd(&now, tv, &ev->ev_timeout);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/event2/util.h:379:40: note: expanded from macro 'evutil_timeradd'

define evutil_timeradd(tvp, uvp, vvp) timeradd((tvp), (uvp), (vvp))

                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/x86_64-linux-gnu/sys/time.h:172:36: note: expanded from macro
'timeradd'
(result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ ~~~~~~~~~~~ ^
event.c:2454:3: warning: Access to field 'tv_sec' results in a dereference of a
null pointer (loaded from variable 'ev_tv')
evutil_timersub(ev_tv, &off, ev_tv);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/event2/util.h:380:40: note: expanded from macro 'evutil_timersub'

define evutil_timersub(tvp, uvp, vvp) timersub((tvp), (uvp), (vvp))

                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/x86_64-linux-gnu/sys/time.h:182:24: note: expanded from macro
'timersub'
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ ^~~~~~~~~~~
event.c:2489:7: warning: The right operand of '==' is a garbage value
if (evutil_timercmp(&ev->ev_timeout, &now, >))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/event2/util.h:412:18: note: expanded from macro 'evutil_timercmp'
(((tvp)->tv_sec == (uvp)->tv_sec) ? \ ^ ~~~~~~~~~~~~~
5 warnings generated.


/bin/bash ./libtool --tag=CC --mode=compile /usr/local/bin/clang --analyze -DHAVE_CONFIG_H -I. -I./compat -I./include -I./include -g -O2 -Wall -fno-strict-aliasing -MT evutil.lo -MD -MP -MF .deps/evutil.Tpo -c -o evutil.lo evutil.c
libtool: compile: /usr/local/bin/clang --analyze -DHAVE_CONFIG_H -I. -I./compat -I./include -I./include -g -O2 -Wall -fno-strict-aliasing -MT evutil.lo -MD -MP -MF .deps/evutil.Tpo -c evutil.c -fPIC -DPIC -o .libs/evutil.o
evutil.c:268:29: warning: The right operand of '!=' is a garbage value
|| listen_addr.sin_family != connect_addr.sin_family
^ ~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.