• Welcome to Valhalla Legends Archive.
 

Warning Level 4 C4100: unreferenced formal parameter

Started by Mephisto, October 21, 2004, 07:35 PM

Previous topic - Next topic

Mephisto

What does this warning mean exactly and how can it be corrected?  I've searched online and couldn't find anything.

Mephisto


MyndFyre

Quote from: Mephisto on October 21, 2004, 07:38 PM
Nevermind, figured it out.

As we all have asked other people who have done the same thing: do you want to share the information so we know for future reference?
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Mephisto

#3
Yes.  It's a level 4 warning in VS.NET 2003 labeled C4100 called "unreferenced formal parameter."  It's basically just a parameter that you pass to a function that you never use (reference).  So if you pass in an integer variable, and you never use it, you'll get that warning.  Note that level 4 warnings are information warnings and ignoring them won't affect your program in a seriously negative way (for instance, some level 1 - 3 warnings if ignored often lead to runtime crashes).

MyndFyre

I've seen 4100 listed elsewhere as "Unreferenced formal parameter" -- are you sure it's pointer?

Anyway, thanks for the info.  You're right about it not affecting your program in a negative way, but you have to ask yourself -- is my design really that good if I'm never using a parameter?
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Mephisto

Quote from: MyndFyre on October 21, 2004, 08:11 PM
I've seen 4100 listed elsewhere as "Unreferenced formal parameter" -- are you sure it's pointer?

Anyway, thanks for the info.  You're right about it not affecting your program in a negative way, but you have to ask yourself -- is my design really that good if I'm never using a parameter?

Yeah, you're right.  I overlooked what it said.  I edited my posts accordingly...

Grok

Warnings are a kick-ass way to get a free programming guru to help you write better code.  It has been pointed out in many programming style and technique books that you should get as much help from the compiler as possible.  The guidance provided should be heeded until you know why it shouldn't.  That is to say, fix the compiler warnings until you have a specific reason for not fixing it.

I'll give you a chess metaphor.  There are well-known guidance rules that you should move knights before bishops, do not move your queen out early, move one or two pawns and support them, but leave them be!  Well these are not hard-and-fast, but if you are a novice and do not know WHY you want to violate one of them, it's probably best to follow them most of the time.

In programming it is much the same thing, you listen to the IDIOMS provided by the experienced people and try to follow those yourself, most of the time.  The compiler warnings are one such source of help.  When you get experienced enough to know why you're in a situation that the idioms do not apply, or the warnings do not apply, do your own thing!

Mephisto

Thanks for the philosophy Grok.  :)  I decided that one of the best options to fix a lot of the bugs I've been experiencing with my bot program was to turn the warning level up to 4 and go through each warning and fix them.  I got them fixed and not only did fixing them fix a few bugs I didn't even know about, but also when fixing them, I encountered many new bugs and buggy code and fixed some of the ones that I knew existed.  I'll never ignore compiler warnings again.  :)

MyndFyre

QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.