report a bug |  advanced search |  statistics |  developer log in/out
Bug #67 Compile warning: comparison of unsigned expression < 0 is always false
Submitted: 2017-11-29 07:02 UTC Modified: -
From: zhb at iredmail dot org Assigned:
Status: Open
Mlmmj Version: 1.3.0.0 OS:
MTA: MTA Version:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-11-29 07:02 UTC] zhb at iredmail dot org
Description:
------------
During compile, there're few warnings:

===============================
mail-functions.c:56:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:80:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:112:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:138:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:272:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0)
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:296:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:323:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
7 warnings generated.
================================


Patches

made-some-size_t-signed-size_t (last revision 2017-11-29 19:45 UTC) by stappers at stappers dot nl)

Add a Patch

History

AllCommentsChanges
 [2017-11-29 07:07 UTC] zhb at iredmail dot org
Forgot to mention that the OS is OpenBSD 6.2 -current.

There're more warnings and errors, here's the full compile log:

=====================

Building on amd64-1 under mail/mlmmj
	 BDEPENDS = [converters/libiconv]
	 DIST = [mail/mlmmj:mlmmj-1.3.0.tar.gz]
	 FULLPKGNAME = mlmmj-1.3.0
	 RDEPENDS = [converters/libiconv]
Avoided depends for libiconv-1.14p3
distfiles size=355298
Running build in mail/mlmmj at 1511905228
===> mail/mlmmj
===> mlmmj-1.3.0 depends on: libiconv-* -> libiconv-1.14p3
===>  Verifying specs:  c iconv
===>  found c.92.0 iconv.6.0
===>  Checking files for mlmmj-1.3.0
`/usr/ports/distfiles/mlmmj-1.3.0.tar.gz' is up to date.
(SHA256) mlmmj-1.3.0.tar.gz: OK
===>  Extracting for mlmmj-1.3.0
===>  Patching for mlmmj-1.3.0
===>  Compiler link: clang -> /usr/bin/clang
===>  Compiler link: clang++ -> /usr/bin/clang++
===>  Compiler link: cc -> /usr/bin/cc
===>  Compiler link: c++ -> /usr/bin/c++
===>  Configuring for mlmmj-1.3.0
Using /usr/obj/ports/mlmmj-1.3.0/config.site (generated)
configure: WARNING: unrecognized options: --disable-gtk-doc
configure: loading site script /usr/obj/ports/mlmmj-1.3.0/config.site
checking for a BSD-compatible install... /usr/obj/ports/mlmmj-1.3.0/bin/install -c 
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... mkdir -p
checking for gawk... (cached) awk
checking whether make sets $(MAKE)... (cached) yes
checking whether make supports nested variables... yes
checking for gcc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... (cached) o
checking whether we are using the GNU C compiler... (cached) yes
checking whether cc accepts -g... (cached) yes
checking for cc option to accept ISO C89... none needed
checking whether cc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of cc... gcc3
checking for socket in -lsocket... no
checking for gethostbyname in -lnsl... no
checking for iconv_open in -liconv... no
checking how to run the C preprocessor... cc -E
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for egrep... (cached) /usr/bin/egrep
checking for ANSI C header files... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for memory.h... (cached) yes
checking for strings.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for unistd.h... (cached) yes
checking for arpa/inet.h... (cached) yes
checking for fcntl.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for stddef.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for syslog.h... (cached) yes
checking for unistd.h... (cached) yes
checking for time.h... (cached) yes
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for an ANSI C-conforming const... (cached) yes
checking for size_t... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for ftruncate... (cached) yes
checking for memset... (cached) yes
checking for socket... (cached) yes
checking for strerror... (cached) yes
checking for strncasecmp... (cached) yes
checking for snprintf... (cached) yes
checking for fcntl... (cached) yes
checking for nanosleep... (cached) yes
checking for time... (cached) yes
checking for strftime... (cached) yes
checking for syslog... (cached) yes
checking for regcomp... (cached) yes
checking for regexec... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/mlmmj-make-ml
config.status: creating listtexts/Makefile
config.status: creating contrib/Makefile
config.status: creating contrib/receivestrip/Makefile
config.status: creating config.h
config.status: executing depfiles commands
configure: WARNING: unrecognized options: --disable-gtk-doc
===>  Building for mlmmj-1.3.0
/usr/bin/make  all-recursive
Making all in src
depbase=`echo mlmmj-send.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. 
-I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
mlmmj-send.o -MD -MP -MF $depbase.Tpo -c -o mlmmj-send.o mlmmj-send.c && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo writen.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -I..    
-I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
writen.o -MD -MP -MF $depbase.Tpo -c -o writen.o writen.c && mv -f $depbase.Tpo 
$depbase.Po
depbase=`echo mail-functions.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H 
-I. -I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT mail-
functions.o -MD -MP -MF $depbase.Tpo -c -o mail-functions.o mail-functions.c && mv -f 
$depbase.Tpo $depbase.Po
mail-functions.c:56:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:80:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:112:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:138:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:272:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0)
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:296:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:323:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
7 warnings generated.
depbase=`echo itoa.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -I..    
-I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
itoa.o -MD -MP -MF $depbase.Tpo -c -o itoa.o itoa.c && mv -f $depbase.Tpo $depbase.Po
depbase=`echo chomp.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -I..    
-I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
chomp.o -MD -MP -MF $depbase.Tpo -c -o chomp.o chomp.c && mv -f $depbase.Tpo 
$depbase.Po
depbase=`echo incindexfile.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -
I. -I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
incindexfile.o -MD -MP -MF $depbase.Tpo -c -o incindexfile.o incindexfile.c && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo checkwait_smtpreply.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -
DHAVE_CONFIG_H -I. -I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
checkwait_smtpreply.o -MD -MP -MF $depbase.Tpo -c -o checkwait_smtpreply.o 
checkwait_smtpreply.c && mv -f $depbase.Tpo $depbase.Po
depbase=`echo getlistaddr.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. 
-I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
getlistaddr.o -MD -MP -MF $depbase.Tpo -c -o getlistaddr.o getlistaddr.c && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo mylocking.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -
I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
mylocking.o -MD -MP -MF $depbase.Tpo -c -o mylocking.o mylocking.c && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo init_sockfd.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. 
-I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
init_sockfd.o -MD -MP -MF $depbase.Tpo -c -o init_sockfd.o init_sockfd.c && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo strgen.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -I..    
-I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
strgen.o -MD -MP -MF $depbase.Tpo -c -o strgen.o strgen.c && mv -f $depbase.Tpo 
$depbase.Po
depbase=`echo random-int.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. 
-I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
random-int.o -MD -MP -MF $depbase.Tpo -c -o random-int.o random-int.c && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo print-version.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -
I. -I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
print-version.o -MD -MP -MF $depbase.Tpo -c -o print-version.o print-version.c && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo log_error.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -
I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
log_error.o -MD -MP -MF $depbase.Tpo -c -o log_error.o log_error.c && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo mygetline.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -
I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
mygetline.o -MD -MP -MF $depbase.Tpo -c -o mygetline.o mygetline.c && mv -f 
$depbase.Tpo $depbase.Po
mygetline.c:43:10: warning: comparison of unsigned expression < 0 is always false [-
Wtautological-compare]
               if(res < 0) {
                  ~~~ ^ ~
1 warning generated.
depbase=`echo memory.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -I..    
-I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
memory.o -MD -MP -MF $depbase.Tpo -c -o memory.o memory.c && mv -f $depbase.Tpo 
$depbase.Po
depbase=`echo statctrl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -
I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
statctrl.o -MD -MP -MF $depbase.Tpo -c -o statctrl.o statctrl.c && mv -f $depbase.Tpo 
$depbase.Po
depbase=`echo ctrlvalue.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -
I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
ctrlvalue.o -MD -MP -MF $depbase.Tpo -c -o ctrlvalue.o ctrlvalue.c && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo getaddrsfromfd.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H 
-I. -I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
getaddrsfromfd.o -MD -MP -MF $depbase.Tpo -c -o getaddrsfromfd.o getaddrsfromfd.c && mv 
-f $depbase.Tpo $depbase.Po
depbase=`echo readn.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -I..    
-I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
readn.o -MD -MP -MF $depbase.Tpo -c -o readn.o readn.c && mv -f $depbase.Tpo 
$depbase.Po
depbase=`echo getlistdelim.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -
I. -I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
getlistdelim.o -MD -MP -MF $depbase.Tpo -c -o getlistdelim.o getlistdelim.c && mv -f 
$depbase.Tpo $depbase.Po
cc -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe  -
L/usr/local/lib -liconv -o mlmmj-send mlmmj-send.o writen.o  mail-functions.o itoa.o 
chomp.o incindexfile.o checkwait_smtpreply.o  getlistaddr.o mylocking.o  init_sockfd.o 
strgen.o random-int.o  print-version.o log_error.o  mygetline.o memory.o statctrl.o  
ctrlvalue.o getaddrsfromfd.o readn.o  getlistdelim.o  
strgen.o: In function `concatstr':
/usr/obj/ports/mlmmj-1.3.0/mlmmj-1.3.0/src/strgen.c:135: warning: warning: strcat() is 
almost always misused, please use strlcat()
random-int.o: In function `random_int':
/usr/obj/ports/mlmmj-1.3.0/mlmmj-1.3.0/src/random-int.c:61: warning: warning: rand() 
may return deterministic values, is that what you want?
depbase=`echo mlmmj-receive.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -
I. -I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
mlmmj-receive.o -MD -MP -MF $depbase.Tpo -c -o mlmmj-receive.o mlmmj-receive.c && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo dumpfd2fd.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -
I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
dumpfd2fd.o -MD -MP -MF $depbase.Tpo -c -o dumpfd2fd.o dumpfd2fd.c && mv -f 
$depbase.Tpo $depbase.Po
dumpfd2fd.c:40:8: warning: comparison of unsigned expression < 0 is always false [-
Wtautological-compare]
               if(n < 0) {
                  ~ ^ ~
1 warning generated.
depbase=`echo log_oper.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -
I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
log_oper.o -MD -MP -MF $depbase.Tpo -c -o log_oper.o log_oper.c && mv -f $depbase.Tpo 
$depbase.Po
log_oper.c:89:7: warning: comparison of unsigned expression < 0 is always false [-
Wtautological-compare]
       if(i < 0) {
          ~ ^ ~
1 warning generated.
cc -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe  -
L/usr/local/lib -liconv -o mlmmj-receive mlmmj-receive.o writen.o  random-int.o 
strgen.o print-version.o  log_error.o dumpfd2fd.o memory.o  log_oper.o mylocking.o 
readn.o  
strgen.o: In function `concatstr':
/usr/obj/ports/mlmmj-1.3.0/mlmmj-1.3.0/src/strgen.c:135: warning: warning: strcat() is 
almost always misused, please use strlcat()
random-int.o: In function `random_int':
/usr/obj/ports/mlmmj-1.3.0/mlmmj-1.3.0/src/random-int.c:61: warning: warning: rand() 
may return deterministic values, is that what you want?
depbase=`echo mlmmj-process.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -
I. -I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
mlmmj-process.o -MD -MP -MF $depbase.Tpo -c -o mlmmj-process.o mlmmj-process.c && mv -f 
$depbase.Tpo $depbase.Po
mlmmj-process.c:756:14: warning: implicit declaration of function 
'unistr_header_to_utf8' is invalid in C99 [-Wimplicit-function-declaration]
                       subject = unistr_header_to_utf8(readhdrs[5].values[0]);
                                 ^
mlmmj-process.c:756:12: warning: incompatible integer to pointer conversion assigning 
to 'char *' from 'int' [-Wint-conversion]
                       subject = unistr_header_to_utf8(readhdrs[5].values[0]);
                               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mlmmj-process.c:1079:19: warning: variable 'txt' is used uninitialized whenever 'if' 
condition is false [-Wsometimes-uninitialized]
                           } else if (modonlypost) {
                                      ^~~~~~~~~~~
mlmmj-process.c:1083:18: note: uninitialized use occurs here
                           MY_ASSERT(txt);
                                     ^~~
./../include/mlmmj.h:99:37: note: expanded from macro 'MY_ASSERT'
#define MY_ASSERT(expression) if (!(expression)) { \
                                   ^~~~~~~~~~
mlmmj-process.c:1079:15: note: remove the 'if' if its condition is always true
                           } else if (modonlypost) {
                                  ^~~~~~~~~~~~~~~~~
mlmmj-process.c:467:11: note: initialize the variable 'txt' to silence this warning
       text *txt;
                ^
                 = NULL
3 warnings generated.
depbase=`echo find_email_adr.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H 
-I. -I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
find_email_adr.o -MD -MP -MF $depbase.Tpo -c -o find_email_adr.o find_email_adr.c && mv 
-f $depbase.Tpo $depbase.Po
depbase=`echo listcontrol.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. 
-I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
listcontrol.o -MD -MP -MF $depbase.Tpo -c -o listcontrol.o listcontrol.c && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo send_help.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -
I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
send_help.o -MD -MP -MF $depbase.Tpo -c -o send_help.o send_help.c && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo prepstdreply.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -
I. -I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
prepstdreply.o -MD -MP -MF $depbase.Tpo -c -o prepstdreply.o prepstdreply.c && mv -f 
$depbase.Tpo $depbase.Po
prepstdreply.c:652:9: warning: implicit declaration of function 
'unistr_escaped_to_utf8' is invalid in C99 [-Wimplicit-function-declaration]
               esc = unistr_escaped_to_utf8(tmp);
                     ^
prepstdreply.c:652:7: warning: incompatible integer to pointer conversion assigning to 
'char *' from 'int' [-Wint-conversion]
               esc = unistr_escaped_to_utf8(tmp);
                   ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
prepstdreply.c:711:24: warning: incompatible integer to pointer conversion assigning to 
'const char *' from 'int' [-Wint-conversion]
       if (!transparent) str = unistr_escaped_to_utf8(str);
                             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
prepstdreply.c:1190:25: warning: incompatible integer to pointer conversion assigning 
to 'char *' from 'int' [-Wint-conversion]
                                       txt->src->upcoming =
                                                          ^
prepstdreply.c:1701:11: warning: implicit declaration of function 
'unistr_utf8_to_header' is invalid in C99 [-Wimplicit-function-declaration]
                               tmp = unistr_utf8_to_header(tmp);
                                     ^
prepstdreply.c:1701:9: warning: incompatible integer to pointer conversion assigning to 
'char *' from 'int' [-Wint-conversion]
                               tmp = unistr_utf8_to_header(tmp);
                                   ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
6 warnings generated.
depbase=`echo do_all_the_voodoo_here.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -
DHAVE_CONFIG_H -I. -I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
do_all_the_voodoo_here.o -MD -MP -MF $depbase.Tpo -c -o do_all_the_voodoo_here.o 
do_all_the_voodoo_here.c && mv -f $depbase.Tpo $depbase.Po
depbase=`echo gethdrline.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. 
-I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
gethdrline.o -MD -MP -MF $depbase.Tpo -c -o gethdrline.o gethdrline.c && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo subscriberfuncs.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H 
-I. -I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
subscriberfuncs.o -MD -MP -MF $depbase.Tpo -c -o subscriberfuncs.o subscriberfuncs.c && 
mv -f $depbase.Tpo $depbase.Po
depbase=`echo ctrlvalues.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. 
-I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
ctrlvalues.o -MD -MP -MF $depbase.Tpo -c -o ctrlvalues.o ctrlvalues.c && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo send_list.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -
I..    -I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
send_list.o -MD -MP -MF $depbase.Tpo -c -o send_list.o send_list.c && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo unistr.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -DHAVE_CONFIG_H -I. -I..    
-I/usr/local/include -g -Wall -pedantic -Wsign-compare -
DDEFAULTTEXTDIR='"/usr/local/share/mlmmj/text.skel"' -I./../include -O2 -pipe -MT 
unistr.o -MD -MP -MF $depbase.Tpo -c -o unistr.o unistr.c && mv -f $depbase.Tpo 
$depbase.Po
unistr.c:44:1: error: unknown type name 'unistr'
unistr *unistr_new(void)
^
unistr.c:46:2: error: use of undeclared identifier 'unistr'
       unistr *ret;
       ^
unistr.c:46:10: error: use of undeclared identifier 'ret'
       unistr *ret;
               ^
unistr.c:48:2: error: use of undeclared identifier 'ret'
       ret = mymalloc(sizeof(unistr));
       ^
unistr.c:48:24: error: use of undeclared identifier 'unistr'
       ret = mymalloc(sizeof(unistr));
                             ^
unistr.c:49:2: error: use of undeclared identifier 'ret'
       ret->len = 0;
       ^
unistr.c:50:2: error: use of undeclared identifier 'ret'
       ret->alloc_len = 64;
       ^
unistr.c:51:2: error: use of undeclared identifier 'ret'
       ret->chars = mymalloc(ret->alloc_len * sizeof(unistr_char));
       ^
unistr.c:51:48: error: use of undeclared identifier 'unistr_char'
       ret->chars = mymalloc(ret->alloc_len * sizeof(unistr_char));
                                                     ^
unistr.c:51:24: error: use of undeclared identifier 'ret'
       ret->chars = mymalloc(ret->alloc_len * sizeof(unistr_char));
                             ^
unistr.c:53:9: error: use of undeclared identifier 'ret'
       return ret;
              ^
unistr.c:57:18: error: unknown type name 'unistr'
void unistr_free(unistr *str)
                ^
unistr.c:66:22: error: unknown type name 'unistr'
int unistr_cmp(const unistr *str1, const unistr *str2)
                    ^
unistr.c:66:42: error: unknown type name 'unistr'
int unistr_cmp(const unistr *str1, const unistr *str2)
                                        ^
unistr.c:84:1: error: unknown type name 'unistr'
unistr *unistr_dup(const unistr *str)
^
unistr.c:84:26: error: unknown type name 'unistr'
unistr *unistr_dup(const unistr *str)
                        ^
unistr.c:86:2: error: use of undeclared identifier 'unistr'
       unistr *ret;
       ^
unistr.c:86:10: error: use of undeclared identifier 'ret'
       unistr *ret;
               ^
unistr.c:89:2: error: use of undeclared identifier 'ret'
       ret = unistr_new();
       ^
unistr.c:91:3: warning: implicit declaration of function 'unistr_append_char' is 
invalid in C99 [-Wimplicit-function-declaration]
               unistr_append_char(ret, str->chars[i]);
               ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
*** Error 1 in src (Makefile:611 'unistr.o')
*** Error 1 in . (Makefile:460 'all-recursive')
*** Error 1 in /usr/obj/ports/mlmmj-1.3.0/mlmmj-1.3.0 (Makefile:335 'all')
*** Error 1 in mail/mlmmj (/usr/ports/infrastructure/mk/bsd.port.mk:2721 
'/usr/obj/ports/mlmmj-1.3.0/.build_done')
*** Error 1 in mail/mlmmj (/usr/ports/infrastructure/mk/bsd.port.mk:2417 'build')
===> Exiting mail/mlmmj with an error
*** Error 1 in /usr/ports (infrastructure/mk/bsd.port.subdir.mk:147 'build')
Error: job failed with 256 on amd64-1

-- 
=========================
 [2017-11-29 19:42 UTC] stappers at stappers dot nl
FWIW 

Over here not those warnings.

Did check source code anyway.

Found this:
contrib/receivestrip/mlmmj_src/writen.c:ssize_t writen(int fd, const void *vptr, size_t n)
include/wrappers.h:ssize_t writen(int fd, const void *vptr, size_t n);
src/writen.c:ssize_t writen(int fd, const void *vptr, size_t n)

Did code change like:
-	size_t bytes_written;
+	ssize_t bytes_written;

After that still not those warnings.   :-/
 [2017-11-29 19:52 UTC] stappers at stappers dot nl
The patch fixes only the original reported

mail-functions.c:56:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:80:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:112:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:138:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:272:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0)
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:296:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
mail-functions.c:323:19: warning: comparison of unsigned expression < 0 is always false 
[-Wtautological-compare]
       if(bytes_written < 0) {
          ~~~~~~~~~~~~~ ^ ~
7 warnings generated.


Cheers
Geert Stappers
 [2019-01-26 19:09 UTC] stappers at stappers dot nl
There is now https://gitlab.com/mlmmj/mlmmj/commit/a8bee54ac793bbd91dfe9a0c41bcbca89cd14a06

Please let us know if that change was an improvement.

Either here or at the mailinglist.
 
Based on the PHP bug tracker.
Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Jan 30 01:27:44 2013 UTC