Issue information

Issue ID
#8312
Status
Fixed
Severity
None
Started
Ancyker
Aug 29, 2014 17:43
Last Post
Haru
Jun 7, 2015 14:33
Confirmation
Yes (1)
No (2)

Ancyker - Aug 29, 2014 17:43

[quote]

battle.c: In function 'battle_calc_damage':
battle.c:2719: warning: 'd_bl' may be used uninitialized in this function[/quote]


[code=auto:0] if( (sce=sc->data[SC_AUTOGUARD]) && flag&BF_WEAPON && !(skill->get_nk(skill_id)&NK_NO_CARDFIX_ATK) && rnd()%100 < sce->val2 ) { int delay; struct block_list *d_bl; [/code]

Litro - Aug 30, 2014 2:26

bump, got same one to

Dastgir - Aug 30, 2014 6:26

Any more info, which git version, compiler and renewal or pre-renewal?(dont seem to have that warnings as of now, with gcc on re and even checked on pre-re, still no warnings)

tlacson7 - Aug 30, 2014 10:35

im having same warning.

./configure --disable-renewal --disable-64bit
make clean
make sql

csnv - Aug 30, 2014 16:16

[quote name="Dastgir" timestamp="1409380014"]
Any more info, which git version, compiler and renewal or pre-renewal?(dont seem to have that warnings as of now, with gcc on re and even checked on pre-re, still no warnings)[/quote]

I'm the author of that commit and I didn't get any warning so I'm assuming it's warning just for older versions of GCC. I'm gonna try with a centos machine (which has an older gcc version).

Anyway I think it's just a matter of initializing the variable first, no much problem.

Litro - Aug 31, 2014 0:42

[quote name="Dastgir" timestamp="1409380014"]

Any more info, which git version, compiler and renewal or pre-renewal?(dont seem to have that warnings as of now, with gcc on re and even checked on pre-re, still no warnings)[/quote]
[code=auto:0] [Info]: Hercules 32-bit for Linux [Info]: SVN revision (src): '14581M' [Info]: SVN revision (scripts): '14581' [Info]: OS version: 'CentOS release 5.10 (Final) [i686]' [Info]: CPU: 'Intel(R) Core(TM) i5-4670K CPU @ 3.40GHz [2]' [Info]: Compiled with GCC v4.1.2 [Info]: Compile Flags: -g -O2 -pipe -ffast-math -Wall -Wextra -Wno-sign-compare -march=i686 -Wno-unused-parameter -Wno-switch -Wno-missing-field-initializers -Wno-format-security -Wno-format-nonliteral -fno-strict-aliasing -DMAXCONN=16384 -I../common -DHAS_TLS -DHAVE_SETRLIMIT -DHAVE_STRNLEN -I/usr/include -DHAVE_MONOTONIC_CLOCK [/code]

Litro - Sep 1, 2014 9:04

[font='lucida sans unicode', 'lucida grande', sans-serif]bump a bit[/font]

Ancyker - Sep 1, 2014 12:29

[code=auto:0] Using built-in specs. Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)[/code]
and:
[code=:0] ./configure --enable-debug --disable-lto [/code]

This post has been edited by Ancyker on Sep 1, 2014 12:30

Haru - Sep 1, 2014 13:06

Only seems to happen on very outdated versions of GCC that can't properly detect correctly initialized vars. Gonna try and fix it.

Haru - Jun 7, 2015 14:33

This was fixed in [commit]dd907688[/commit] (and never marked as such, sorry)