MudBytes
» MUDBytes Community » Codebase Specific » DikuMUD » SMAUG » afkmud compile lots of warnin...
Pages: << prev 1, 2 next >>
afkmud compile lots of warnings
Igabod
Wizard






Group: Members
Posts: 969
Joined: Jul 23, 2008

Go to the bottom of the page Go to the top of the page
#1 Posted Sep 27, 2008, 4:35 am

i just downloaded afkmud just to check it out and i'm currently compiling it but i'm seeing something that just doesn't reflect what i expect from samson and the smaug team. i'm seeing TONS of warnings... so many in fact that the compile is taking several minutes and it's still not done yet. i just now got to chess.o after 3 or so minutes of compiling. is this because i didn't uncomment something in the makefile or is it just because it's an abandoned project? i'm totally shocked to see something with samsons name on it have this many warnings considering everything else i've downloaded that he worked on compiled completely clean (once i figured out i needed to uncomment the cygwin stuff). hopefully this is just some sort of error on my part, i would hate to think samson would leave it in this state...

[edit]
ok 4 minutes after i posted this the compile finished with a bunch of errors at the end. this is very disappointing.
.........................
http://www.dark-warriors.net/banners/sm/5.gif Join the rest of the Dark Warriors in the struggle to be the greatest.

Bored?? Click THIS and you too can build your own mini city.

Every man has his follies, and often they are the most interesting thing he has got - Josh Billings

Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. - Albert Einstein

I have a love interest in every one of my films... a gun. - Arnold Schwarzenegger

Recession is when a neighbor loses his job. Depression is when you lose yours. - Ronald Reagan

I like long walks, especially when they are taken by people who annoy me. - Fred Allen

Last edited Sep 27, 2008, 4:41 am by Igabod
kiasyn
Wizard






Group: Administrators
Posts: 857
Joined: May 15, 2006

Go to the bottom of the page Go to the top of the page
#2 Posted Sep 27, 2008, 6:23 am

what warnings, what errors, what version of compiler
.........................
http://www.mudbytes.net/kiasyn-sig.png

Chris Bailey
Sorcerer






Group: Members
Posts: 499
Joined: Sep 13, 2008

Go to the bottom of the page Go to the top of the page
#3 Posted Sep 27, 2008, 6:45 am

Yeah, you should really give some more detailed information if you would like to get any help. Continually suggesting that the author's work is poor is also a bad way of getting started.
.........................
If what Proust says is true, that happiness is the absence of fever, then I will never know happiness. For I am possessed by a fever for knowledge, experience, and creation.

Quote:
[ichat] Twisol@Talon: Do me, do me.

Igabod
Wizard






Group: Members
Posts: 969
Joined: Jul 23, 2008

Go to the bottom of the page Go to the top of the page
#4 Posted Sep 27, 2008, 7:40 am

i never once suggested that samsons work is poor, i said i am shocked to see so many warnings in something samson did. that right there implies that i believe samson is a wonderful coder, and that i've never seen something done by him with ANY warnings, let alone a couple thousand. to answer the question of what warnings, and what compiler. i'm using the latest cygwin and there were just WAY too many warnings to even begin listing them, it took me about 9 or 10 minutes just to compile the thing. i was merely posting this to find out if anybody else has encountered this, i'm not looking to fix anything unless its a simple matter of uncommenting something in the makefile but i already have the cygwin bit uncommented.
.........................
http://www.dark-warriors.net/banners/sm/5.gif Join the rest of the Dark Warriors in the struggle to be the greatest.

Bored?? Click THIS and you too can build your own mini city.

Every man has his follies, and often they are the most interesting thing he has got - Josh Billings

Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. - Albert Einstein

I have a love interest in every one of my films... a gun. - Arnold Schwarzenegger

Recession is when a neighbor loses his job. Depression is when you lose yours. - Ronald Reagan

I like long walks, especially when they are taken by people who annoy me. - Fred Allen

Chris Bailey
Sorcerer






Group: Members
Posts: 499
Joined: Sep 13, 2008

Go to the bottom of the page Go to the top of the page
#5 Posted Sep 27, 2008, 8:12 am

Igabod: Sorry about my first post, I had just woken up to an angry wife. As far as providing more information goes, we still need a bit more. I will detail the things that we need to know.

Afkmud version:
Compier Version:
Errors:

We can work on figuring out the warnings later, for now we need the errors. Can you stick a copy of the compile up on pastebin? That will make it easier. I'm leaving right now and won't be back until this evening but with that information I'm sure somebody will be able to help you.
.........................
If what Proust says is true, that happiness is the absence of fever, then I will never know happiness. For I am possessed by a fever for knowledge, experience, and creation.

Quote:
[ichat] Twisol@Talon: Do me, do me.

Remcon
Magician




Group: Members
Posts: 60
Joined: May 17, 2006

Go to the bottom of the page Go to the top of the page
#6 Posted Sep 27, 2008, 10:35 am

On first compile ended up with alot of warnings and these errors
Code (text):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
  Compiling o/overland.o....
overland.cpp:31:16: gd.h: No such file or directory
overland.cpp:1419: error: `gdImagePtr' was not declared in this scope
overland.cpp:1419: error: expected primary-expression before "int"
overland.cpp:1419: error: expected primary-expression before "short"
overland.cpp:1419: error: expected primary-expression before "short"
overland.cpp:1419: error: expected primary-expression before "short"
overland.cpp:1420: error: initializer expression list treated as compound expres
sion
overland.cpp:1420: error: expected `,' or `;' before '{' token
overland.cpp:1426: error: `gdImagePtr' was not declared in this scope
overland.cpp:1426: error: expected primary-expression before "int"
overland.cpp:1427: error: initializer expression list treated as compound expres
sion
overland.cpp:1427: error: expected `,' or `;' before '{' token
overland.cpp: In function `void load_map_png(const char*, short int)':
overland.cpp:1484: error: `gdImagePtr' undeclared (first use this function)
overland.cpp:1484: error: (Each undeclared identifier is reported only once for
each function it appears in.)
overland.cpp:1484: error: expected `;' before "im"
overland.cpp:1505: error: `im' undeclared (first use this function)
overland.cpp:1505: error: `gdImageCreateFromPng' undeclared (first use this func
tion)
overland.cpp:1507: error: `gdImageSY' undeclared (first use this function)
overland.cpp:1509: error: `gdImageSX' undeclared (first use this function)
overland.cpp:1511: error: `gdImageGetPixel' undeclared (first use this function)
 
overland.cpp:1512: error: `get_sector_colour' cannot be used as a function
overland.cpp:1517: error: `gdImageDestroy' undeclared (first use this function)
overland.cpp: In function `void save_map_png(const char*, short int)':
overland.cpp:2823: error: `gdImagePtr' undeclared (first use this function)
overland.cpp:2823: error: expected `;' before "im"
overland.cpp:2829: error: `im' undeclared (first use this function)
overland.cpp:2829: error: `gdImageCreate' undeclared (first use this function)
overland.cpp:2832: error: `gdImageColorAllocate' undeclared (first use this func
tion)
overland.cpp:2842: error: `gdImageLine' undeclared (first use this function)
overland.cpp:2858: error: `gdImagePng' undeclared (first use this function)
overland.cpp:2868: error: `gdImageDestroy' undeclared (first use this function)
make[2]: *** [o/overland.o] Error 1
 

Looks like need to install the gd stuff in cygwin to continue (gd, libgd-devel, libgd2)

After that heres what it gives
Code (text):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
 
  Compiling o/imc.o....
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `void
 imcban(char_data*, std::string)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `void
 imcignore(char_data*, std::string)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `void
 imc_readbans()':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `bool
 imc_load_commands()':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_vector.h: In member funct
ion `std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::ve
ctor<_Tp, _Alloc>&) [with _Tp = std::string, _Alloc = std::allocator<std::string
>]':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_vector.h:715: warning: '_
_result' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: warni
ng: '__cur' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: warni
ng: '__cur' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `void
 imccedit(char_data*, std::string)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `void
 imc_loadchar(char_data*, FILE*, const char*)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
  Compiling o/act_comm.o....
act_comm.cpp: In function `std::string act_string(const std::string&, char_data*
, char_data*, const void*, const void*, int)':
act_comm.cpp:1203: warning: cast from `const void*' to `char_data*' discards qua
lifiers from pointer target type
act_comm.cpp:1204: warning: cast from `const void*' to `obj_data*' discards qual
ifiers from pointer target type
act_comm.cpp:1205: warning: cast from `const void*' to `obj_data*' discards qual
ifiers from pointer target type
act_comm.cpp:1252: warning: cast from `const void*' to `char*' discards qualifie
rs from pointer target type
act_comm.cpp:1262: warning: cast from `const void*' to `char*' discards qualifie
rs from pointer target type
act_comm.cpp:1357: warning: cast from `const void*' to `char*' discards qualifie
rs from pointer target type
act_comm.cpp:1363: warning: cast from `const void*' to `char*' discards qualifie
rs from pointer target type
act_comm.cpp: In function `void act(short int, const std::string&, char_data*, c
onst void*, const void*, int)':
act_comm.cpp:1405: warning: cast from `const void*' to `char_data*' discards qua
lifiers from pointer target type
act_comm.cpp:1406: warning: cast from `const void*' to `char_data*' discards qua
lifiers from pointer target type
act_comm.cpp:1407: warning: cast from `const void*' to `obj_data*' discards qual
ifiers from pointer target type
act_comm.cpp:1408: warning: cast from `const void*' to `obj_data*' discards qual
ifiers from pointer target type
  Compiling o/act_info.o....
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `void
 do_ignore(char_data*, std::string)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In member functio
n `void pc_data::load_ignores(FILE*)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
  Compiling o/act_move.o....
  Compiling o/act_obj.o....
  Compiling o/act_wiz.o....
act_wiz.cpp: In function `void do_bodybag(char_data*, std::string)':
act_wiz.cpp:1753: warning: 'owner' might be used uninitialized in this function
  Compiling o/archery.o....
  Compiling o/area.o....
  Compiling o/areaconvert.o....
  Compiling o/auction.o....
  Compiling o/ban.o....
  Compiling o/bits.o....
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h: In member functio
n `typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type
 std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_copy(const std::_R
b_tree_node<_Val>*, std::_Rb_tree_node<_Val>*) [with _Key = int, _Val = std::pai
r<const int, std::string>, _KeyOfValue = std::_Select1st<std::pair<const int, st
d::string> >, _Compare = std::less<int>, _Alloc = std::allocator<std::pair<const
 int, std::string> >]':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h:1029: warning: '__
top' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h:365: warning: '__t
mp' might be used uninitialized in this function
  Compiling o/boards.o....
  Compiling o/build.o....
  Compiling o/calendar.o....
  Compiling o/channels.o....
  Compiling o/character.o....
  Compiling o/chess.o....
  Compiling o/clans.o....
  Compiling o/color.o....
  Compiling o/comm.o....
  Compiling o/commands.o....
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h: In membe
r function `void std::vector<_Tp, _Alloc>::_M_fill_insert(__gnu_cxx::__normal_it
erator<typename _Alloc::pointer, std::vector<_Tp, _Alloc> >, size_t, const _Tp&)
 [with _Tp = std::vector<cmd_type*, std::allocator<cmd_type*> >, _Alloc = std::a
llocator<std::vector<cmd_type*, std::allocator<cmd_type*> > >]':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: warni
ng: '__cur' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: warni
ng: '__cur' might be used uninitialized in this function
  Compiling o/comments.o....
  Compiling o/connhist.o....
  Compiling o/const.o....
  Compiling o/db.o....
  Compiling o/deity.o....
  Compiling o/descriptor.o....
descriptor.cpp: In member function `bool descriptor_data::write(const char*)':
descriptor.cpp:332: warning: cast from `const char*' to `unsigned char*' discard
s qualifiers from pointer target type
  Compiling o/editor.o....
  Compiling o/environment.o....
  Compiling o/event.o....
  Compiling o/event_handler.o....
  Compiling o/features.o....
  Compiling o/fight.o....
  Compiling o/finger.o....
  Compiling o/handler.o....
  Compiling o/hashstr.o....
  Compiling o/help.o....
  Compiling o/hotboot.o....
  Compiling o/imm_host.o....
  Compiling o/liquids.o....
  Compiling o/magic.o....
magic.cpp: In function `ch_ret spell_animate_dead(int, int, char_data*, void*)':
 
magic.cpp:3870: warning: 'corpse' might be used uninitialized in this function
  Compiling o/mapout.o....
  Compiling o/mapper.o....
  Compiling o/md5.o....
  Compiling o/misc.o....
  Compiling o/mobindex.o....
  Compiling o/modules.o....
  Compiling o/mspecial.o....
mspecial.cpp: In function `bool summon_if_hating(char_data*)':
mspecial.cpp:208: warning: 'victim' might be used uninitialized in this function
 
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In function `void
 load_specfuns()':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
  Compiling o/mudcfg.o....
  Compiling o/mud_comm.o....
  Compiling o/mud_prog.o....
  Compiling o/new_auth.o....
  Compiling o/object.o....
  Compiling o/objindex.o....
  Compiling o/olcmob.o....
  Compiling o/olcobj.o....
  Compiling o/olcroom.o....
  Compiling o/overland.o....
overland.cpp: In function `ch_ret process_exit(char_data*, short int, short int,
 short int, int, bool)':
overland.cpp:2165: warning: 'pexit' might be used uninitialized in this function
 
  Compiling o/pfiles.o....
  Compiling o/player.o....
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In member functio
n `void char_data::update_visits(room_index*)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In member functio
n `void pc_data::load_zonedata(FILE*)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h:435: warning: '__p
' might be used uninitialized in this function
  Compiling o/polymorph.o....
  Compiling o/rare.o....
  Compiling o/renumber.o....
  Compiling o/reset.o....
  Compiling o/roomindex.o....
  Compiling o/save.o....
  Compiling o/search.o....
  Compiling o/sha256.o....
  Compiling o/ships.o....
  Compiling o/shops.o....
  Compiling o/skills.o....
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h: In member functio
n `typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type
 std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_copy(const std::_R
b_tree_node<_Val>*, std::_Rb_tree_node<_Val>*) [with _Key = std::string, _Val =
std::pair<const std::string, int>, _KeyOfValue = std::_Select1st<std::pair<const
 std::string, int> >, _Compare = string_sort, _Alloc = std::allocator<std::pair<
const std::string, int> >]':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h:1029: warning: '__
top' might be used uninitialized in this function
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h:365: warning: '__t
mp' might be used uninitialized in this function
  Compiling o/skyship.o....
  Compiling o/slay.o....
  Compiling o/tables.o....
  Compiling o/track.o....
  Compiling o/treasure.o....
  Compiling o/update.o....
  Compiling o/variables.o....
  Compiling o/web.o....
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: warning: au
to-importing has been activated without --enable-auto-import specified on the co
mmand line.
This should work unless it involves constant data structures referencing symbols
 from auto-imported DLLs.Info: resolving __timezone by linking to __imp___timezo
ne (auto-import)
Generating dependency file ...
Done building AFKMud.
 
Buidling DNS Resolver...
make -s resolver
Done buidling DNS Resolver.
 

Some of the warnings can and should be fixed but some are in include files and you can't fix through the afkcode :)
.........................
Lands of Pabulum

ShadowsDawn
Apprentice




Group: Members
Posts: 43
Joined: Jun 30, 2008

Go to the bottom of the page Go to the top of the page
#7 Posted Sep 27, 2008, 11:20 am

Also Igabod, there is a reason people were trying to steer you away from Cygwin,
and get you to either dual boot your system, use something like andLinux, get
set up with a free host, or best yet.. blow away that windows partition and go full
on Linux.

Yes Cygwin can function as a *nix environment to help learn, and do some general coding.
However, many of the projects written for *nix systems have a hard time compiling.
Granted a lot of these can be fixed as it is due to having to d/l pieces one at a time,
but if you are using Cygwin to compile code and it errors, your first stop should be
to check what libraries you are missing.  Honestly, that is true for any compile job, but
even more so for Cygwin.  Unless you have written the code yourself, and know exactly
what libraries are linked in and needed, you should always check the error messages first
for signs that you are missing something rather than suggest something is wrong with the
code.

Samson
Evil Overlord






Group: Members
Posts: 2,631
Joined: May 13, 2006

Go to the bottom of the page Go to the top of the page
#8 Posted Sep 27, 2008, 2:16 pm

Quote:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h: In member functio
# n `void char_data::update_visits(room_index*)':


Stuff like that is beyond my control. Those are being reported by the C++ library itself. One thing you should probably have been able to pick up on immediately knowing the history of the site you got it from is that none of those warnings triggered an error and aborted the compile. The -Werror flag is something I use religiously to catch new stuff. But when compiling in Cygwin it had to be disabled because there's no way to compile the code otherwise.

Quote:
mspecial.cpp: In function `bool summon_if_hating(char_data*)':
mspecial.cpp:208: warning: 'victim' might be used uninitialized in this function


You got me as to why this is even being reported. It does not come up when compiling with gcc 4, which is the target platform for the codebase. It might be worth looking into if you can get gcc 4 in Cygwin, and if not, seriously consider abandoning it as a platform in favor of andlinux or one of the other solutions. It should be becoming quite obvious at this point that the platform is to blame, not the code.
.........................
PDNS-Admin | SmaugMuds.org | Arthmoor MUD Hosting Services | The Truth About Medievia: A Saga of Code Theft.

http://www.mudbytes.net/samson-sig.png

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984

David Haley
Wizard






Group: Members
Posts: 5,730
Joined: Jun 30, 2007

Go to the bottom of the page Go to the top of the page
#9 Posted Sep 27, 2008, 2:27 pm

Samson said:
Quote:
mspecial.cpp: In function `bool summon_if_hating(char_data*)':
mspecial.cpp:208: warning: 'victim' might be used uninitialized in this function

You got me as to why this is even being reported.

Because the compiler is being cautious. To see that victim will always have a value when it's used, you have to note that 'found' is set to false, and 'victim' is only used if 'found' is true -- which will only happen if victim has some value in it. I'm not sure why it would not be seeing that before and would suddenly be seeing it now, though.
.........................
-- d.c.h --
BabbleMUD Project (custom codebase)
Legends of the Darkstone (head coder)
http://david.the-haleys.org
.........................

Samson
Evil Overlord






Group: Members
Posts: 2,631
Joined: May 13, 2006

Go to the bottom of the page Go to the top of the page
#10 Posted Sep 27, 2008, 2:56 pm

DavidHaley said:
Because the compiler is being cautious. To see that victim will always have a value when it's used, you have to note that 'found' is set to false, and 'victim' is only used if 'found' is true -- which will only happen if victim has some value in it. I'm not sure why it would not be seeing that before and would suddenly be seeing it now, though.


Well apparently this is caution that GNU figured out how to parse with later versions of the compiler than gcc 3.4 which is why it doesn't come up in a current compiler.
.........................
PDNS-Admin | SmaugMuds.org | Arthmoor MUD Hosting Services | The Truth About Medievia: A Saga of Code Theft.

http://www.mudbytes.net/samson-sig.png

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984

David Haley
Wizard






Group: Members
Posts: 5,730
Joined: Jun 30, 2007

Go to the bottom of the page Go to the top of the page
#11 Posted Sep 27, 2008, 3:13 pm

I'm not convinced that they were doing it right before and suddenly started doing it wrong. I think they're just improving their static analysis and it's finding something that it didn't find before, but it's not smart enough to realize that it's not actually a problem. Contrast with not finding it in the first place.
.........................
-- d.c.h --
BabbleMUD Project (custom codebase)
Legends of the Darkstone (head coder)
http://david.the-haleys.org
.........................

Samson
Evil Overlord






Group: Members
Posts: 2,631
Joined: May 13, 2006

Go to the bottom of the page Go to the top of the page
#12 Posted Sep 27, 2008, 4:01 pm

No no, I'm saying they're doing it RIGHT now and WRONG before by being able to detect this particular type of situation and know that the variable is initialized in the one place it's used.
.........................
PDNS-Admin | SmaugMuds.org | Arthmoor MUD Hosting Services | The Truth About Medievia: A Saga of Code Theft.

http://www.mudbytes.net/samson-sig.png

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984

David Haley
Wizard






Group: Members
Posts: 5,730
Joined: Jun 30, 2007

Go to the bottom of the page Go to the top of the page
#13 Posted Sep 27, 2008, 4:09 pm

Oh... he was using an older version of gcc, not a very-new one? My compiler (4.2) doesn't emit a warning here but I thought he might be using 4.3. In that case good on gcc for figuring this one out.
.........................
-- d.c.h --
BabbleMUD Project (custom codebase)
Legends of the Darkstone (head coder)
http://david.the-haleys.org
.........................

Remcon
Magician




Group: Members
Posts: 60
Joined: May 17, 2006

Go to the bottom of the page Go to the top of the page
#14 Posted Sep 27, 2008, 6:48 pm

Code (text):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
$ gcc -v
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with: /usr/build/package/orig/test.respin/gcc-3.4.4-3/configure --ver
bose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libe
xecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-langu
ages=c,ada,c++,d,f77,pascal,java,objc --enable-nls --without-included-gettext --
enable-version-specific-runtime-libs --without-x --enable-libgcj --disable-java-
awt --with-system-zlib --enable-interpreter --disable-libgcj-debug --enable-thre
ads=posix --enable-java-gc=boehm --disable-win32-registry --enable-sjlj-exceptio
ns --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: posix
gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
 

So yea it is an older version of gcc in cygwin. I wasn't posting to point out issues just that it seems to compile fine as long as you have the things you need in cygwin (even though there are some warnings)
.........................
Lands of Pabulum

Igabod
Wizard






Group: Members
Posts: 969
Joined: Jul 23, 2008

Go to the bottom of the page Go to the top of the page
#15 Posted Sep 28, 2008, 1:05 pm

i just typed up a long reply to all of this and tried to preview it but due to an intermittent wireless connection i lost everything so i'll just summarize by saying the following and hoping it doesn't get lost too.

i thought 4.1 was the latest gcc cause thats what cygwin lists as the latest. i'm definately gonna switch to andlinux now due to all the problems i'm encountering with cygwin. i don't know how to copy/paste from cygwin, but thats a moot point now because i'm getting andLinux. i'm hung over so i can't remember what else i typed but i accept chris baileys apology for his earlier response refering to me saying samsons work was shoddy or something like that. and now i'm gonna go take some asprin and get some food from Sonic to try and get rid of this hangover.
.........................
http://www.dark-warriors.net/banners/sm/5.gif Join the rest of the Dark Warriors in the struggle to be the greatest.

Bored?? Click THIS and you too can build your own mini city.

Every man has his follies, and often they are the most interesting thing he has got - Josh Billings

Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. - Albert Einstein

I have a love interest in every one of my films... a gun. - Arnold Schwarzenegger

Recession is when a neighbor loses his job. Depression is when you lose yours. - Ronald Reagan

I like long walks, especially when they are taken by people who annoy me. - Fred Allen

Pages:<< prev 1, 2 next >>

Valid XHTML 1.1! Valid CSS!