syzygy1 / tb

GNU General Public License v2.0
229 stars 53 forks source link

Some warnings. Don't know if need to be addressed #45

Closed oppiet30 closed 1 month ago

oppiet30 commented 1 year ago

[oppie@dell src]$ make make[1]: Entering directory '/home/oppie/tb/src' gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -c tbgen.c -DMAGIC -DUSE_POPCNT -DTBPIECES=7 -DUSE_ZSTD -DCOMPRESSION_THREADS=6 -DREGULAR -o objsr/tbgen.o In file included from tbgen.c:93: rtbgen.c: In function ‘reset_captures_w’: rtbgen.c:816:11: warning: storing the address of local variable ‘v’ in ‘reset_v’ [-Wdangling-pointer=] 816 | reset_v = v; | ~~^ rtbgen.c:814:11: note: ‘v’ declared here 814 | uint8_t v[256]; | ^ rtbgen.c:741:17: note: ‘reset_v’ declared here 741 | static uint8_t reset_v; | ^~~ rtbgen.c: In function ‘reset_captures_b’: rtbgen.c:852:11: warning: storing the address of local variable ‘v’ in ‘reset_v’ [-Wdangling-pointer=] 852 | reset_v = v; | ~~^ rtbgen.c:850:11: note: ‘v’ declared here 850 | uint8_t v[256]; | ^ rtbgen.c:741:17: note: ‘reset_v’ declared here 741 | static uint8_t reset_v; | ^~~ gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -c permute.c -DMAGIC -DUSE_POPCNT -DTBPIECES=7 -DUSE_ZSTD -DCOMPRESSION_THREADS=6 -DREGULAR -o objsr/permute.o gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -c compress.c -DMAGIC -DUSE_POPCNT -DTBPIECES=7 -DUSE_ZSTD -DCOMPRESSION_THREADS=6 -DREGULAR -o objsr/compress.o gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -c huffman.c -DMAGIC -DUSE_POPCNT -DTBPIECES=7 -DUSE_ZSTD -DCOMPRESSION_THREADS=6 -DREGULAR -o objsr/huffman.o gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -c threads.c -DMAGIC -DUSE_POPCNT -DTBPIECES=7 -DUSE_ZSTD -DCOMPRESSION_THREADS=6 -DREGULAR -o objsr/threads.o gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -c lz4.c -DMAGIC -DUSE_POPCNT -DTBPIECES=7 -DUSE_ZSTD -DCOMPRESSION_THREADS=6 -DREGULAR -o objsr/lz4.o gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -c checksum.c -DMAGIC -DUSE_POPCNT -DTBPIECES=7 -DUSE_ZSTD -DCOMPRESSION_THREADS=6 -DREGULAR -o objsr/checksum.o gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -c city-c.c -DMAGIC -DUSE_POPCNT -DTBPIECES=7 -DUSE_ZSTD -DCOMPRESSION_THREADS=6 -DREGULAR -o objsr/city-c.o gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -c util.c -DMAGIC -DUSE_POPCNT -DTBPIECES=7 -DUSE_ZSTD -DCOMPRESSION_THREADS=6 -DREGULAR -o objsr/util.o gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -o rtbgen objsr/tbgen.o objsr/permute.o objsr/compress.o objsr/huffman.o objsr/threads.o objsr/lz4.o objsr/checksum.o objsr/city-c.o objsr/util.o -lzstd lto-wrapper: warning: using serial compilation of 2 LTRANS jobs lto-wrapper: note: see the ‘-flto’ option documentation for more information make[1]: Leaving directory '/home/oppie/tb/src' make[1]: Entering directory '/home/oppie/tb/src' gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -c tbgenp.c -DMAGIC -DUSE_POPCNT -DTBPIECES=7 -DUSE_ZSTD -DCOMPRESSION_THREADS=6 -DREGULAR -o objsr/tbgenp.o gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -o rtbgenp objsr/tbgenp.o objsr/permute.o objsr/compress.o objsr/huffman.o objsr/threads.o objsr/lz4.o objsr/checksum.o objsr/city-c.o objsr/util.o -lzstd lto-wrapper: warning: using serial compilation of 3 LTRANS jobs lto-wrapper: note: see the ‘-flto’ option documentation for more information make[1]: Leaving directory '/home/oppie/tb/src' make[1]: Entering directory '/home/oppie/tb/src' gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -c tbver.c -DMAGIC -DUSE_POPCNT -DTBPIECES=7 -DUSE_ZSTD -DCOMPRESSION_THREADS=6 -DREGULAR -o objsr/tbver.o gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -c decompress.c -DMAGIC -DUSE_POPCNT -DTBPIECES=7 -DUSE_ZSTD -DCOMPRESSION_THREADS=6 -DREGULAR -o objsr/decompress.o gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -o rtbver objsr/tbver.o objsr/decompress.o objsr/threads.o objsr/checksum.o objsr/city-c.o objsr/util.o -lzstd make[1]: Leaving directory '/home/oppie/tb/src' make[1]: Entering directory '/home/oppie/tb/src' gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -c tbverp.c -DMAGIC -DUSE_POPCNT -DTBPIECES=7 -DUSE_ZSTD -DCOMPRESSION_THREADS=6 -DREGULAR -o objsr/tbverp.o gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -o rtbverp objsr/tbverp.o objsr/decompress.o objsr/threads.o objsr/checksum.o objsr/city-c.o objsr/util.o -lzstd lto-wrapper: warning: using serial compilation of 2 LTRANS jobs lto-wrapper: note: see the ‘-flto’ option documentation for more information make[1]: Leaving directory '/home/oppie/tb/src' make[1]: Entering directory '/home/oppie/tb/src' gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -c tbcheck.c -DMAGIC -DUSE_POPCNT -DTBPIECES=7 -DUSE_ZSTD -DCOMPRESSION_THREADS=6 -DREGULAR -o objsr/tbcheck.o gcc -pthread -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto -o tbcheck objsr/tbcheck.o objsr/threads.o objsr/checksum.o objsr/city-c.o objsr/util.o make[1]: Leaving directory '/home/oppie/tb/src' [oppie@dell src]$

oppiet30 commented 6 months ago

If you change the line in the Makefile that reads:

CFLAGS = -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto

to:

CFLAGS = -O3 -march=native -pipe -D_GNU_SOURCE -Wall -std=c11 -Wno-array-bounds -flto=auto

The flt-wrapper warnings don't show up.

syzygy1 commented 1 month ago

I've now fixed the warnings. Thanks.