Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

  • #008312

  • 0 - None Assigned

  • Fixed

Issue Confirmations

  • Yes (1)No (2)
Photo

Warning in latest hercules

Posted by Ancyker on 29 August 2014 - 05:43 PM

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



		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;

bump, got same one to

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)

im having same warning.

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

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)


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.

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)

[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® Core™ 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



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)
and:
./configure --enable-debug --disable-lto

Edited by Ancyker, 01 September 2014 - 12:30 PM.


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

changed status to: Started

changed status to: Fixed

This was fixed in dd907688 (and never marked as such, sorry)