Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Linux Servers

Support::Linux Servers Support forum for Linux EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 02-17-2015, 08:22 AM
vsab's Avatar
vsab
Discordant
 
Join Date: Apr 2014
Location: United Kingdom
Posts: 276
Default Compile Error

(moved from dev)

gcc 4.8.2 - latest code. Recently it looks like I have a ton more warnings than I did before regarding logging, but it bums out here:-

Code:
/home/vsab/eqemu/zone/spawngroup.cpp: In member function ‘uint32 SpawnGroup::GetNPCType()’:
/home/vsab/eqemu/zone/spawngroup.cpp:54:80: error: cast from ‘SpawnGroup*’ to ‘uint32 {aka unsigned int}’ loses precision [-fpermissive]
  Log.Out(Logs::General, Logs::None, "SpawnGroup[%08x]::GetNPCType()", (uint32) this);
                                                                                ^
make[2]: *** [zone/CMakeFiles/zone.dir/spawngroup.cpp.o] Error 1
make[1]: *** [zone/CMakeFiles/zone.dir/all] Error 2
make: *** [all] Error 2
Any ideas how I can get it to compile?
Reply With Quote
  #2  
Old 02-17-2015, 12:25 PM
jdoran
Hill Giant
 
Join Date: Jul 2012
Posts: 212
Default

There is a %p escape useful for printing pointers. Pointers do not always fit in 32-bit integers.
Reply With Quote
  #3  
Old 02-17-2015, 05:44 PM
vsab's Avatar
vsab
Discordant
 
Join Date: Apr 2014
Location: United Kingdom
Posts: 276
Default

Nice, using %p and removing the cast fixed the compile (casting in uint64 worked too....), haven't seen the actual output yet....

Code:
  Log.Out(Logs::General, Logs::None, "SpawnGroup[%p]::GetNPCType()", this);
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:00 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3