OpenLightingProject / libartnet

An Open Source implementation of the ArtNet protocol
https://www.openlighting.org/libartnet-main/
GNU Lesser General Public License v2.1
124 stars 56 forks source link

Warn when running "make" #13

Open linus-ha opened 5 years ago

linus-ha commented 5 years ago
linus@XXXXXXX:~/libartnet-1.1.2$ make
make  all-recursive
make[1]: Verzeichnis „/home/linus/libartnet-1.1.2“ wird betreten
Making all in artnet
make[2]: Verzeichnis „/home/linus/libartnet-1.1.2/artnet“ wird betreten
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT artnet.lo -MD -MP -MF .deps/artnet.Tpo -c -o artnet.lo artnet.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT artnet.lo -MD -MP -MF .deps/artnet.Tpo -c artnet.c  -fPIC -DPIC -o .libs/artnet.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT artnet.lo -MD -MP -MF .deps/artnet.Tpo -c artnet.c -o artnet.o >/dev/null 2>&1
mv -f .deps/artnet.Tpo .deps/artnet.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT misc.lo -MD -MP -MF .deps/misc.Tpo -c -o misc.lo misc.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT misc.lo -MD -MP -MF .deps/misc.Tpo -c misc.c  -fPIC -DPIC -o .libs/misc.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT misc.lo -MD -MP -MF .deps/misc.Tpo -c misc.c -o misc.o >/dev/null 2>&1
mv -f .deps/misc.Tpo .deps/misc.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT network.lo -MD -MP -MF .deps/network.Tpo -c -o network.lo network.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT network.lo -MD -MP -MF .deps/network.Tpo -c network.c  -fPIC -DPIC -o .libs/network.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT network.lo -MD -MP -MF .deps/network.Tpo -c network.c -o network.o >/dev/null 2>&1
mv -f .deps/network.Tpo .deps/network.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT receive.lo -MD -MP -MF .deps/receive.Tpo -c -o receive.lo receive.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT receive.lo -MD -MP -MF .deps/receive.Tpo -c receive.c  -fPIC -DPIC -o .libs/receive.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT receive.lo -MD -MP -MF .deps/receive.Tpo -c receive.c -o receive.o >/dev/null 2>&1
mv -f .deps/receive.Tpo .deps/receive.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT transmit.lo -MD -MP -MF .deps/transmit.Tpo -c -o transmit.lo transmit.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT transmit.lo -MD -MP -MF .deps/transmit.Tpo -c transmit.c  -fPIC -DPIC -o .libs/transmit.o
transmit.c: In function 'artnet_tx_tod_data':
transmit.c:166:5: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
     memset(&tod.data.toddata.tod,0x00, ARTNET_MAX_UID_COUNT);
     ^~~~~~
cc1: all warnings being treated as errors
Makefile:395: recipe for target 'transmit.lo' failed
make[2]: *** [transmit.lo] Error 1
make[2]: Verzeichnis „/home/linus/libartnet-1.1.2/artnet“ wird verlassen
Makefile:423: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Verzeichnis „/home/linus/libartnet-1.1.2“ wird verlassen
Makefile:331: recipe for target 'all' failed
make: *** [all] Error 2

Sorry, I just can't fix the problem myself / understand the problem.

Duality4Y commented 5 years ago

happens here too (currently running rolling distribution release) my gcc version: 8.2.1 Does compile on ubuntu, my guess older compiler.

Duality4Y commented 5 years ago

Can confirm compiles with: gcc-5 (GCC) 5.5.0

peternewman commented 3 years ago

It looks like that line should probably actually be: memset(&tod.data.toddata.tod,0x00, ARTNET_MAX_UID_COUNT * ARTNET_RDM_UID_WIDTH);

If someone wants to let us know if that works or better yet open a pull request we could get the change merged in.

dzelionis commented 3 years ago

Yes, that's worked like a charm. Thanks