Project

General

Profile

Actions

Bug #2679

closed

build with profiling enabled on generates compile warnings

Added by Jason Taylor about 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Low
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

When building the current master branch.

On fedora when using the following configure:
./configure --enable-gccprotect --enable-pie --disable-coccinelle --enable-nfqueue --enable-af-packet --with-libnspr-includes=/usr/include/nspr4 --with-libnss-includes=/usr/include/nss3 --enable-jansson --enable-geoip --enable-lua --enable-rust --enable-debug --enable-profiling

During 'make' the following is seen:
CC util-profiling.o
util-profiling.c: In function ‘SCProfilingDumpPacketStats’:
util-profiling.c:716:19: warning: iteration 256 invokes undefined behavior [-Waggressive-loop-optimizations]
if (pd->cnt == 0) {
~^~~~
util-profiling.c:713:9: note: within this loop
for (p = 0; p < 257; p++) {
~
util-profiling.c:699:19: warning: iteration 256 invokes undefined behavior [-Waggressive-loop-optimizations]
if (pd->cnt == 0) {
~
~~~
util-profiling.c:696:9: note: within this loop
for (p = 0; p < 257; p++) {
~
util-profiling.c:684:24: warning: iteration 256 invokes undefined behavior [-Waggressive-loop-optimizations]
total = pd->tot;
~~~~
util-profiling.c:682:9: note: within this loop
for (p = 0; p < 257; p
+) {
^~~
CC util-profiling-keywords.o

Actions

Also available in: Atom PDF