Welcome to the Builder Academy

Question Warnings compiling with gcc 4.7.2

More
14 Jan 2013 23:28 - 14 Jan 2013 23:28 #1288 by Axanon
I don't think this is anything major, but I thought I'd post it anyways. its rather long, so I used a pastebin service.
on sprunge
Last edit: 14 Jan 2013 23:28 by Axanon.

Please Log in or Create an account to join the conversation.

More
14 Jan 2013 23:37 #1290 by Liko

Axanon wrote: I don't think this is anything major, but I thought I'd post it anyways. its rather long, so I used a pastebin service.
on sprunge


Pretty much telling you that the variables are set, but aren't being called anywhere.

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

More
15 Jan 2013 01:40 #1292 by Axanon
Is there anything that can be done to get rid of the warnings? Is it even worth the effort? I'm assuming it IS nothing significant, right?

Please Log in or Create an account to join the conversation.

More
15 Jan 2013 03:35 #1293 by Vatiken
1:
A) Tell the compiler to not print warnings
OR
B) Fix them

2:
Yes and no...

3:
Many of the system functions force the programmer to take their return values and place them in a variable, preferably so that we can use that variable to better diagnose issues that may arise. A lot of the old code just assigns the variable, then forgets about it.

So it's not causing any harm, but it could be handled better. I've fixed a couple, but there are numerous occurances and each takes a chunk of time to address since it means fully interpreting each function before initiating a proper fix.

If everyone on the forum picked 1, 2, or 3 instances and fixed them, tbaMUD could be warning free pretty quickly. The difficulty of this task is low-moderate.

tbaMUD developer/programmer
The following user(s) said Thank You: Maximus

Please Log in or Create an account to join the conversation.

More
15 Jan 2013 13:38 #1323 by Rumble
I looked at a few of them and will clean some up. But like Vatiken said even though some are not used they do serve a purpose. I'll post some of the odd ones and see what people think.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com

Please Log in or Create an account to join the conversation.

More
21 Aug 2013 23:32 #4129 by Rumble
So the github shell compiler also lists all these warnings so I was going to start tackling them.

act.comm.c: In function ‘do_tell’:
act.comm.c:158:9: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
act.wizard.c: In function ‘mod_llog_entry’:
act.wizard.c:1855:27: warning: variable ‘j’ set but not used [-Wunused-but-set-variable]
act.wizard.c:1855:24: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
act.wizard.c: In function ‘add_llog_entry’:
act.wizard.c:1901:7: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
act.wizard.c: In function ‘clean_llog_entries’:
act.wizard.c:1940:16: warning: variable ‘j’ set but not used [-Wunused-but-set-variable]
act.wizard.c:1940:13: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
act.wizard.c: In function ‘list_llog_entries’:
act.wizard.c:1980:7: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
act.wizard.c: In function ‘do_last’:
act.wizard.c:2012:13: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
act.wizard.c: In function ‘do_wiznet’:
act.wizard.c:2155:8: warning: variable ‘any’ set but not used [-Wunused-but-set-variable]
act.wizard.c: In function ‘do_copyover’:
act.wizard.c:4130:7: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
act.wizard.c: In function ‘do_file’:
act.wizard.c:4268:10: warning: variable ‘j’ set but not used [-Wunused-but-set-variable]
act.wizard.c: In function ‘change_player_name’:
act.wizard.c:4583:21: warning: variable ‘j’ set but not used [-Wunused-but-set-variable]
boards.c: In function ‘board_save_board’:
boards.c:414:10: warning: variable ‘j’ set but not used [-Wunused-but-set-variable]
boards.c: In function ‘board_load_board’:
boards.c:453:10: warning: variable ‘j’ set but not used [-Wunused-but-set-variable]
db.c: In function ‘fread_action’:
db.c:159:9: warning: variable ‘buf1’ set but not used [-Wunused-but-set-variable]
db.c: In function ‘boot_social_messages’:
db.c:190:64: warning: variable ‘buf’ set but not used [-Wunused-but-set-variable]
db.c:189:68: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
db.c: In function ‘reset_time’:
db.c:798:7: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
db.c: In function ‘index_boot’:
db.c:916:31: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
dg_scripts.c: In function ‘do_vdelete’:
dg_scripts.c:2156:13: warning: variable ‘context’ set but not used [-Wunused-but-set-variable]
dg_scripts.c: In function ‘process_rdelete’:
dg_scripts.c:2264:13: warning: variable ‘context’ set but not used [-Wunused-but-set-variable]
genolc.c: In function ‘do_export_zone’:
genolc.c:313:16: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
ibt.c: In function ‘read_ibt’:
ibt.c:123:17: warning: variable ‘flgCheck’ set but not used [-Wunused-but-set-variable]
ibt.c: In function ‘save_ibt_file’:
ibt.c:290:36: warning: variable ‘last_ibt’ set but not used [-Wunused-but-set-variable]
ibt.c: In function ‘do_ibt’:
ibt.c:458:35: warning: variable ‘last_ibt’ set but not used [-Wunused-but-set-variable]
ibt.c: In function ‘do_oasis_ibtedit’:
ibt.c:759:59: warning: variable ‘buf3’ set but not used [-Wunused-but-set-variable]
limits.c: In function ‘run_autowiz’:
limits.c:201:9: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
medit.c: In function ‘do_oasis_medit’:
medit.c:48:9: warning: variable ‘buf3’ set but not used [-Wunused-but-set-variable]
msgedit.c: In function ‘load_messages’:
msgedit.c:78:19: warning: variable ‘buf’ set but not used [-Wunused-but-set-variable]
mud_event.c: In function ‘event_countdown’:
mud_event.c:57:22: warning: variable ‘ch’ set but not used [-Wunused-but-set-variable]
oedit.c: In function ‘do_oasis_oedit’:
oedit.c:56:9: warning: variable ‘buf3’ set but not used [-Wunused-but-set-variable]
prefedit.c: In function ‘do_oasis_prefedit’:
prefedit.c:897:9: warning: variable ‘buf3’ set but not used [-Wunused-but-set-variable]
protocol.c: In function ‘PerformHandshake’:
protocol.c:1531:11: warning: variable ‘bResult’ set but not used [-Wunused-but-set-variable]
qedit.c: In function ‘do_oasis_qedit’:
qedit.c:59:9: warning: variable ‘buf3’ set but not used [-Wunused-but-set-variable]
redit.c: In function ‘do_oasis_redit’:
redit.c:37:9: warning: variable ‘buf3’ set but not used [-Wunused-but-set-variable]
sedit.c: In function ‘do_oasis_sedit’:
sedit.c:53:9: warning: variable ‘buf3’ set but not used [-Wunused-but-set-variable]
sedit.c: In function ‘sedit_types_menu’:
sedit.c:357:21: warning: variable ‘shop’ set but not used [-Wunused-but-set-variable]
shop.c: In function ‘read_type_list’:
shop.c:1088:39: warning: variable ‘buf1’ set but not used [-Wunused-but-set-variable]
zedit.c: In function ‘zedit_disp_menu’:
zedit.c:415:19: warning: variable ‘room’ set but not used [-Wunused-but-set-variable]

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com
The following user(s) said Thank You: Maximus

Please Log in or Create an account to join the conversation.

Time to create page: 0.226 seconds