| View previous topic :: View next topic |
| Author |
Message |
kas
Joined: 23 Sep 2006 Posts: 6
|
Posted: Sat Sep 23, 2006 11:08 am Post subject: compiler warnings |
|
|
| i've tried compiling obfuscated sources and found that there are more than 4000 warnings with /W4. It seems that there are more of them but my compiler (vs2005) eventually crashed with ICE. As far as i understand those open sources are kinda in sync with actual commercial sources and this means that commercial sources compiles with warnings too. It would be very nice if you could take your time and with future releases fix those warnings. thanks in advance |
|
| Back to top |
|
 |
luke Site Admin
Joined: 15 Oct 2004 Posts: 621
|
Posted: Mon Sep 25, 2006 10:31 am Post subject: |
|
|
I beleive that there are no warnigs compiling with gcc and msvc with the default warning level set.
I beleive that with /w4, most of the warnings that are generated are give for intentional behavior. Changing the code to remove the warnings is not desirable or even practical in this case.
I sugest that if you wish to keep /w4, then wrap the TrueAxis source with #praga warning disabling code. |
|
| Back to top |
|
 |
Mario
Joined: 01 Jul 2006 Posts: 20
|
Posted: Mon Sep 25, 2006 12:35 pm Post subject: Re: compiler warnings |
|
|
| kas wrote: | | It would be very nice if you could take your time and (...) |
Uh, huh... I would never though that any newbie would ever accuse TA for being poorly written or even give own "brilliant" suggestions.
Damn children... they always think they would do something better.
Once again Luke remained calm and patient...  |
|
| Back to top |
|
 |
zeux
Joined: 25 Sep 2006 Posts: 2
|
Posted: Mon Sep 25, 2006 1:35 pm Post subject: |
|
|
Ok, let's see.
zcta004.cpp
Lines 10419-10435:
TA_ASSERT
(
llO\
lOlll\
Ol
.
llOOOl\
OOlO\
=
&
lO\
llOlOOl\
O\
)
;
Not exactly what you've meant, eh?
There is more, though other warnings deal with logic of the code, which is... quite hard to grasp from the obfuscated source. But I am sure that you will find something interesting if you carefully examine /W4 compiler output (if you turn C4127 before, which is generated for every ASSERT).
Also there are lots of lines which seem strange to me (like, if (...) int ... = 0 , sometimes there is a lot of code and a simple return; in front of it.
Last edited by zeux on Mon Sep 25, 2006 1:40 pm; edited 1 time in total |
|
| Back to top |
|
 |
zeux
Joined: 25 Sep 2006 Posts: 2
|
Posted: Mon Sep 25, 2006 1:39 pm Post subject: |
|
|
Though, I must admit, that the original post's author was slightly incorrect - there is indeed a lot of warning in W4 (4028, to be exact), though there is no ICE for me, even when compiling with /clr (provided you wrap files in #pragma managed( push, off ) / #pragma managed( pop ))
Mario, this forum is not for useless posts which bear no valuable content. |
|
| Back to top |
|
 |
Mario
Joined: 01 Jul 2006 Posts: 20
|
Posted: Mon Sep 25, 2006 4:29 pm Post subject: |
|
|
| zeux wrote: | | Though, I must admit, that the original post's author was slightly incorrect (...) Mario, this forum is not for useless posts which bear no valuable content. |
Who does care about the W4 warnings? They are not compatibility issues. It's a nonsense. This fact is worth enough of mentioning. |
|
| Back to top |
|
 |
luke Site Admin
Joined: 15 Oct 2004 Posts: 621
|
Posted: Wed Sep 27, 2006 3:06 am Post subject: |
|
|
Some w4 warnings can be useful, like the unintentional assignment assert above. From time to time TrueAxis is checked with all warnings turned on to check for some of these types of problems, but most of the warnings are on intentional behaviour. Even after turning off all the really silly warnings, it can still be hard to see the things that are logic erros inbetween the unimportant errors.
Still, as I said before, I believe most of the warnings with w4 are on intentional behaviour. For example, there is a fair bit of code involving macros that relies on code such as "if (constant) {}", which generates a w4 warning. |
|
| Back to top |
|
 |
|